diff options
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx')
-rw-r--r-- | chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx index d4d262995afc..5e7a2808f832 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx @@ -79,28 +79,28 @@ void WrappedStockProperty::setPropertyValue( const css::uno::Any& rOuterValue, c Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() ); Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() ); sal_Int32 nDimension = ::chart::DiagramHelper::getDimension( xDiagram ); - if( xChartDoc.is() && xDiagram.is() && nDimension==2 ) - { - Reference< lang::XMultiServiceFactory > xFactory( xChartDoc->getChartTypeManager(), uno::UNO_QUERY ); - DiagramHelper::tTemplateWithServiceName aTemplateAndService = - DiagramHelper::getTemplateForDiagram( xDiagram, xFactory ); + if( !(xChartDoc.is() && xDiagram.is() && nDimension==2) ) + return; - uno::Reference< chart2::XChartTypeTemplate > xTemplate = - getNewTemplate( bNewValue, aTemplateAndService.second, xFactory ); + Reference< lang::XMultiServiceFactory > xFactory( xChartDoc->getChartTypeManager(), uno::UNO_QUERY ); + DiagramHelper::tTemplateWithServiceName aTemplateAndService = + DiagramHelper::getTemplateForDiagram( xDiagram, xFactory ); - if(xTemplate.is()) - { - try - { - // locked controllers - ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() ); - xTemplate->changeDiagram( xDiagram ); - } - catch( const uno::Exception & ) - { - DBG_UNHANDLED_EXCEPTION("chart2"); - } - } + uno::Reference< chart2::XChartTypeTemplate > xTemplate = + getNewTemplate( bNewValue, aTemplateAndService.second, xFactory ); + + if(!xTemplate.is()) + return; + + try + { + // locked controllers + ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() ); + xTemplate->changeDiagram( xDiagram ); + } + catch( const uno::Exception & ) + { + DBG_UNHANDLED_EXCEPTION("chart2"); } } |