From c18d183c9fdadea3d3d28a14b417f5c9620eb439 Mon Sep 17 00:00:00 2001 From: Vasily Melenchuk Date: Tue, 16 Jan 2018 11:34:51 +0300 Subject: tdf#113572: removed redundant calc service calc service introduced previously in commit 0074951704022d173a5fdb9df933f47be1dcbb91 is not required, interface is enough for feature implementation. Change-Id: I9cf30f2201619465da9061c7ef1e574209062cf9 Reviewed-on: https://gerrit.libreoffice.org/47960 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- chart2/source/controller/main/ChartController.cxx | 19 +++++++------------ .../controller/main/ControllerCommandDispatch.cxx | 4 +++- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 1348c7aedb1b..c992e03070fe 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1333,8 +1333,9 @@ void ChartController::executeDispatch_SourceData() if ( rModel.hasInternalDataProvider() ) { // Check if we will able to create data provider later - Reference< lang::XServiceInfo > xParentServiceInfo( rModel.getParent(), uno::UNO_QUERY ); - if ( !xParentServiceInfo.is() || !xParentServiceInfo->supportsService("com.sun.star.chart2.XDataProviderAccess") ) + css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc( + rModel.getParent(), uno::UNO_QUERY); + if (!xCreatorDoc.is()) return; SolarMutexGuard aSolarGuard; @@ -1349,18 +1350,12 @@ void ChartController::executeDispatch_SourceData() rModel.removeDataProviders(); // Ask parent document to create new data provider - css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc( - rModel.getParent(), uno::UNO_QUERY ); - SAL_WARN_IF( !xCreatorDoc.is(), "chart2.main", "Invalid XDataProviderAccess" ); - if ( xCreatorDoc.is() ) + uno::Reference< data::XDataProvider > xDataProvider = xCreatorDoc->createDataProvider(); + SAL_WARN_IF( !xDataProvider.is(), "chart2.main", "Data provider was not created" ); + if (xDataProvider.is()) { - uno::Reference< data::XDataProvider > xDataProvider = xCreatorDoc->createDataProvider(); - SAL_WARN_IF( !xDataProvider.is(), "chart2.main", "Data provider was not created" ); - if ( xDataProvider.is() ) - { - rModel.attachDataProvider(xDataProvider); - } + rModel.attachDataProvider(xDataProvider); } } diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 81c31baa2c0a..537c54c77b58 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -41,6 +41,7 @@ #include #include #include +#include // only needed until #i68864# is fixed #include @@ -555,7 +556,8 @@ void ControllerCommandDispatch::updateCommandAvailability() OSL_ENSURE(xParentServiceInfo.is(), "Invalid XServiceInfo"); if ( xParentServiceInfo.is() ) { - bCanCreateDataProvider = xParentServiceInfo->supportsService("com.sun.star.chart2.XDataProviderAccess"); + css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(rModel.getParent(), uno::UNO_QUERY); + bCanCreateDataProvider = xCreatorDoc.is(); } } } -- cgit