Kaydet (Commit) b26b1f79 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Reduce scope by early bailout.

Change-Id: Icd344caf6e52ef568361078455d4e8d5cf0d40a8
üst 6d0592b4
......@@ -2232,23 +2232,24 @@ boost::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
}
uno::Reference< XTitle > xTitle( TitleHelper::getTitle( eType, rModel ) );
OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) );
if( !aCompleteString.isEmpty() )
{
OUString aCompleteString = TitleHelper::getCompleteString(xTitle);
if (aCompleteString.isEmpty())
return apVTitle;
//create title
apVTitle.reset(new VTitle(xTitle));
OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, rModel ) );
apVTitle->init(xPageShapes,xShapeFactory,aCID);
apVTitle->createShapes( awt::Point(0,0), rPageSize );
OUString aCID = ObjectIdentifier::createClassifiedIdentifierForObject(xTitle, rModel);
apVTitle->init(xPageShapes, xShapeFactory, aCID);
apVTitle->createShapes(awt::Point(0,0), rPageSize);
awt::Size aTitleUnrotatedSize = apVTitle->getUnrotatedSize();
awt::Size aTitleSize = apVTitle->getFinalSize();
//position
rbAutoPosition=true;
rbAutoPosition = true;
awt::Point aNewPosition(0,0);
chart2::RelativePosition aRelativePosition;
uno::Reference< beans::XPropertySet > xProp(xTitle, uno::UNO_QUERY);
if( xProp.is() && (xProp->getPropertyValue( "RelativePosition" )>>=aRelativePosition) )
uno::Reference<beans::XPropertySet> xProp(xTitle, uno::UNO_QUERY);
if (xProp.is() && (xProp->getPropertyValue("RelativePosition") >>= aRelativePosition))
{
rbAutoPosition = false;
......@@ -2292,23 +2293,26 @@ boost::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
switch( eAlignment )
{
case ALIGN_TOP:
// Push the remaining space down from top.
rRemainingSpace.Y += ( aTitleSize.Height + nYDistance );
rRemainingSpace.Height -= ( aTitleSize.Height + nYDistance );
break;
case ALIGN_BOTTOM:
// Push the remaining space up from bottom.
rRemainingSpace.Height -= ( aTitleSize.Height + nYDistance );
break;
case ALIGN_LEFT:
// Push the remaining space to the right from left edge.
rRemainingSpace.X += ( aTitleSize.Width + nXDistance );
rRemainingSpace.Width -= ( aTitleSize.Width + nXDistance );
break;
case ALIGN_RIGHT:
// Push the remaining space to the left from right edge.
rRemainingSpace.Width -= ( aTitleSize.Width + nXDistance );
break;
default:
break;
}
}
return apVTitle;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment