summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <Vasily.Melenchuk@cib.de>2018-01-16 11:34:51 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-01-21 19:22:25 +0100
commitc18d183c9fdadea3d3d28a14b417f5c9620eb439 (patch)
tree9842c838f35c7280becb3708c40ed72fcf74ed13
parent19181fd45735005aad7cb910ca1bf3dd7fb687fb (diff)
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 <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--chart2/source/controller/main/ChartController.cxx19
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx4
-rw-r--r--sc/source/ui/unoobj/docuno.cxx3
3 files changed, 11 insertions, 15 deletions
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 <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
+#include <com/sun/star/chart2/XDataProviderAccess.hpp>
// only needed until #i68864# is fixed
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -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();
}
}
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a54f054bd664..70c8123711af 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -228,7 +228,6 @@ using sc::TwipsToHMM;
#define SCMODELOBJ_SERVICE "com.sun.star.sheet.SpreadsheetDocument"
#define SCDOCSETTINGS_SERVICE "com.sun.star.sheet.SpreadsheetDocumentSettings"
#define SCDOC_SERVICE "com.sun.star.document.OfficeDocument"
-#define SCDATAPROVIDERACCESS_SERVICE "com.sun.star.chart2.XDataProviderAccess"
SC_SIMPLE_SERVICE_INFO( ScAnnotationsObj, "ScAnnotationsObj", "com.sun.star.sheet.CellAnnotations" )
SC_SIMPLE_SERVICE_INFO( ScDrawPagesObj, "ScDrawPagesObj", "com.sun.star.drawing.DrawPages" )
@@ -2855,7 +2854,7 @@ sal_Bool SAL_CALL ScModelObj::supportsService( const OUString& rServiceName )
uno::Sequence<OUString> SAL_CALL ScModelObj::getSupportedServiceNames()
{
- return {SCMODELOBJ_SERVICE, SCDOCSETTINGS_SERVICE, SCDOC_SERVICE, SCDATAPROVIDERACCESS_SERVICE};
+ return {SCMODELOBJ_SERVICE, SCDOCSETTINGS_SERVICE, SCDOC_SERVICE};
}
// XUnoTunnel