summaryrefslogtreecommitdiff
path: root/sfx2/source/view
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-07 09:26:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-07 12:39:11 +0100
commit5404f75a2fa863b97bdf8432f647053f0bff726e (patch)
tree119d2cede534f5ce1173422df99a0e532d6a7a28 /sfx2/source/view
parent39efec060719bb2654ba20844ba02429371a4ffb (diff)
loplugin:collapseif in sdext..svx
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f Reviewed-on: https://gerrit.libreoffice.org/62985 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r--sfx2/source/view/lokcharthelper.cxx23
1 files changed, 10 insertions, 13 deletions
diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx
index 04b433c66677..dd68454b8e59 100644
--- a/sfx2/source/view/lokcharthelper.cxx
+++ b/sfx2/source/view/lokcharthelper.cxx
@@ -45,24 +45,21 @@ Size lcl_TwipsToHMM( const Size& rSize )
css::uno::Reference<css::frame::XController>& LokChartHelper::GetXController()
{
- if(!mxController.is() )
+ if(!mxController.is() && mpViewShell)
{
- if (mpViewShell)
+ SfxInPlaceClient* pIPClient = mpViewShell->GetIPClient();
+ if (pIPClient)
{
- SfxInPlaceClient* pIPClient = mpViewShell->GetIPClient();
- if (pIPClient)
+ const css::uno::Reference< ::css::embed::XEmbeddedObject >& xEmbObj = pIPClient->GetObject();
+ if( xEmbObj.is() )
{
- const css::uno::Reference< ::css::embed::XEmbeddedObject >& xEmbObj = pIPClient->GetObject();
- if( xEmbObj.is() )
+ ::css::uno::Reference< ::css::chart2::XChartDocument > xChart( xEmbObj->getComponent(), uno::UNO_QUERY );
+ if( xChart.is() )
{
- ::css::uno::Reference< ::css::chart2::XChartDocument > xChart( xEmbObj->getComponent(), uno::UNO_QUERY );
- if( xChart.is() )
+ ::css::uno::Reference< ::css::frame::XController > xChartController = xChart->getCurrentController();
+ if( xChartController.is() )
{
- ::css::uno::Reference< ::css::frame::XController > xChartController = xChart->getCurrentController();
- if( xChartController.is() )
- {
- mxController = xChartController;
- }
+ mxController = xChartController;
}
}
}