diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-11-09 03:45:33 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-11-09 06:35:19 +0100 |
commit | 1812d606b7c9c16d4123fc8b911fe3f790a31b2b (patch) | |
tree | 1863048c6d8aed4152160b7cdd478ae18ee309fa | |
parent | Typo (diff) | |
download | core-1812d606b7c9c16d4123fc8b911fe3f790a31b2b.tar.gz core-1812d606b7c9c16d4123fc8b911fe3f790a31b2b.zip |
rptui::OShape make getSupportedServiceNames and supportsService
at the cost of inconsistency between getSupportedServiceNames and getSupportedServiceNames_Static
Change-Id: I940b23c35a6c4080eb6575adff1de0b08cdb3698
-rw-r--r-- | reportdesign/source/core/api/Shape.cxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx index d22ed658bad5..9b3a436ab920 100644 --- a/reportdesign/source/core/api/Shape.cxx +++ b/reportdesign/source/core/api/Shape.cxx @@ -117,6 +117,12 @@ void SAL_CALL OShape::dispose() throw(uno::RuntimeException) ShapePropertySet::dispose(); cppu::WeakComponentImplHelperBase::dispose(); } +//------------------------------------------------------------------------------ +uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext) +{ + return *(new OShape(xContext)); +} + // ----------------------------------------------------------------------------- OUString OShape::getImplementationName_Static( ) throw(uno::RuntimeException) { @@ -136,22 +142,27 @@ uno::Sequence< OUString > OShape::getSupportedServiceNames_Static( ) throw(uno: return aServices; } -//------------------------------------------------------------------------------ -uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext) -{ - return *(new OShape(xContext)); -} - //-------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames( ) throw(uno::RuntimeException) { - return getSupportedServiceNames_Static(); + if(m_sServiceName.isEmpty()) + { + return getSupportedServiceNames_Static(); + } + else + { + uno::Sequence< OUString > aServices(2); + aServices.getArray()[0] = SERVICE_SHAPE; + aServices.getArray()[1] = m_sServiceName; + + return aServices; + } } //------------------------------------------------------------------------------ sal_Bool SAL_CALL OShape::supportsService(const OUString& ServiceName) throw( uno::RuntimeException ) { - return m_sServiceName == ServiceName || cppu::supportsService(this, ServiceName); + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- // XReportComponent |