diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-09-19 11:36:23 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-09-19 13:46:08 -0400 |
commit | 4e58aa02bf7a61804a64626cf9b9d3f36a1959da (patch) | |
tree | 8aefe52ec6b3a48e222542e0fa16620efc3ce137 /chart2/source | |
parent | b26b1f79b70fb0f7ee049033039925854259f227 (diff) |
Scope reduction.
Change-Id: Id677971ccd6959356a781a2d8c35ab864b35a62e
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 9e7519094076..7194c3c4b9d4 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -1384,15 +1384,15 @@ void lcl_setDefaultWritingMode( ::boost::shared_ptr< DrawModelWrapper > pDrawMod } } -sal_Int16 lcl_getDefaultWritingModeFromPool( ::boost::shared_ptr< DrawModelWrapper > pDrawModelWrapper ) +sal_Int16 lcl_getDefaultWritingModeFromPool( const boost::shared_ptr<DrawModelWrapper>& pDrawModelWrapper ) { sal_Int16 nWritingMode = text::WritingMode2::LR_TB; - if( pDrawModelWrapper.get() ) - { - const SfxPoolItem* pItem = &(pDrawModelWrapper->GetItemPool().GetDefaultItem( EE_PARA_WRITINGDIR )); - if( pItem ) - nWritingMode = static_cast< sal_Int16 >((static_cast< const SvxFrameDirectionItem * >( pItem ))->GetValue()); - } + if(!pDrawModelWrapper) + return nWritingMode; + + const SfxPoolItem* pItem = &(pDrawModelWrapper->GetItemPool().GetDefaultItem( EE_PARA_WRITINGDIR )); + if( pItem ) + nWritingMode = static_cast< sal_Int16 >((static_cast< const SvxFrameDirectionItem * >( pItem ))->GetValue()); return nWritingMode; } @@ -2327,17 +2327,16 @@ bool lcl_createLegend( const uno::Reference< XLegend > & xLegend , const std::vector< LegendEntryProvider* >& rLegendEntryProviderList , sal_Int16 nDefaultWritingMode ) { - if( VLegend::isVisible( xLegend )) - { - VLegend aVLegend( xLegend, xContext, rLegendEntryProviderList, - xPageShapes, xShapeFactory, rModel); - aVLegend.setDefaultWritingMode( nDefaultWritingMode ); - aVLegend.createShapes( awt::Size( rRemainingSpace.Width, rRemainingSpace.Height ), - rPageSize ); - aVLegend.changePosition( rRemainingSpace, rPageSize ); - return true; - } - return false; + if (!VLegend::isVisible(xLegend)) + return false; + + VLegend aVLegend( xLegend, xContext, rLegendEntryProviderList, + xPageShapes, xShapeFactory, rModel); + aVLegend.setDefaultWritingMode( nDefaultWritingMode ); + aVLegend.createShapes( awt::Size( rRemainingSpace.Width, rRemainingSpace.Height ), + rPageSize ); + aVLegend.changePosition( rRemainingSpace, rPageSize ); + return true; } void formatPage( |