diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-16 19:25:05 -0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-17 14:43:28 +0200 |
commit | 3d3293144b0e0d2d28136b1b2c7154d6352463b8 (patch) | |
tree | 1ef57838dc7fa88515a69dce12612e6071bc08b9 /svtools | |
parent | 6fe26facd06d4d1e5e37384d25d83209209229fa (diff) |
fdo#54938: Adapt svtools and comphelper module ...
to use cppu::supportsService and other pieces.
Change-Id: I16893b3d31a8055acd214ff23d01e63d38fe0826
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/graphic/descriptor.cxx | 12 | ||||
-rw-r--r-- | svtools/source/graphic/renderer.cxx | 12 | ||||
-rw-r--r-- | svtools/source/hatchwindow/documentcloser.cxx | 15 | ||||
-rw-r--r-- | svtools/source/hatchwindow/hatchwindowfactory.cxx | 14 | ||||
-rw-r--r-- | svtools/source/uno/genericunodialog.cxx | 9 | ||||
-rw-r--r-- | svtools/source/uno/popupmenucontrollerbase.cxx | 17 | ||||
-rw-r--r-- | svtools/source/uno/popupwindowcontroller.cxx | 11 | ||||
-rw-r--r-- | svtools/source/uno/unoimap.cxx | 12 |
8 files changed, 16 insertions, 86 deletions
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 1f6515a5e143..16f3e507ff24 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -24,6 +24,7 @@ #include <vcl/graphicfilter.hxx> #include <svl/itemprop.hxx> #include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -245,19 +246,10 @@ OUString SAL_CALL GraphicDescriptor::getImplementationName() return getImplementationName_Static(); } -// ------------------------------------------------------------------------------ - sal_Bool SAL_CALL GraphicDescriptor::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - uno::Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString* pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return true; - - return false; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------------------------------------ diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx index 95097fbe7bd1..7d687ef96dce 100644 --- a/svtools/source/graphic/renderer.cxx +++ b/svtools/source/graphic/renderer.cxx @@ -25,6 +25,7 @@ #include <vcl/svapp.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/propertysetinfo.hxx> +#include <cppuhelper/supportsservice.hxx> #include <svl/itemprop.hxx> #include <svtools/grfmgr.hxx> #include <comphelper/servicehelper.hxx> @@ -139,19 +140,10 @@ OUString SAL_CALL GraphicRendererVCL::getImplementationName() return getImplementationName_Static(); } -// ------------------------------------------------------------------------------ - sal_Bool SAL_CALL GraphicRendererVCL::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - uno::Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString* pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return true; - - return false; + return cppu::supportsService(this, ServiceName); } // ------------------------------------------------------------------------------ diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx index e0de3c2ed98a..9bd174609642 100644 --- a/svtools/source/hatchwindow/documentcloser.cxx +++ b/svtools/source/hatchwindow/documentcloser.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/frame/DoubleInitializationException.hpp> #include <com/sun/star/awt/XVclWindowPeer.hpp> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/mutex.hxx> #include <osl/thread.hxx> #include <vcl/svapp.hxx> @@ -220,29 +221,19 @@ void SAL_CALL ODocumentCloser::initialize( const uno::Sequence< uno::Any >& aArg m_bInitialized = sal_True; } - // XServiceInfo -// -------------------------------------------------------- OUString SAL_CALL ODocumentCloser::getImplementationName( ) throw (uno::RuntimeException) { return impl_staticGetImplementationName(); } -// -------------------------------------------------------- ::sal_Bool SAL_CALL ODocumentCloser::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException) { - uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames(); - - for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( ServiceName == aSeq[nInd] ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -// -------------------------------------------------------- uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames() throw (uno::RuntimeException) { @@ -250,14 +241,12 @@ uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames() } // Static methods -// -------------------------------------------------------- uno::Sequence< OUString > SAL_CALL ODocumentCloser::impl_staticGetSupportedServiceNames() { const OUString aServiceName( "com.sun.star.embed.DocumentCloser" ); return uno::Sequence< OUString >( &aServiceName, 1 ); } -// -------------------------------------------------------- OUString SAL_CALL ODocumentCloser::impl_staticGetImplementationName() { return OUString( "com.sun.star.comp.embed.DocumentCloser" ); diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index 51566f408fba..b4bb86298104 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -21,6 +21,7 @@ #include "hatchwindowfactory.hxx" #include "hatchwindow.hxx" #include "cppuhelper/factory.hxx" +#include <cppuhelper/supportsservice.hxx> #include <vcl/svapp.hxx> #include "documentcloser.hxx" @@ -66,35 +67,24 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) ); } -//------------------------------------------------------------------------- OUString SAL_CALL OHatchWindowFactory::getImplementationName() throw ( uno::RuntimeException ) { return impl_staticGetImplementationName(); } -//------------------------------------------------------------------------- sal_Bool SAL_CALL OHatchWindowFactory::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames(); - - for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( ServiceName == aSeq[nInd] ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::getSupportedServiceNames() throw ( uno::RuntimeException ) { return impl_staticGetSupportedServiceNames(); } -//------------------------------------------------------------------------- - extern "C" { diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx index 22d4d52123f5..2e821bf42937 100644 --- a/svtools/source/uno/genericunodialog.cxx +++ b/svtools/source/uno/genericunodialog.cxx @@ -25,6 +25,7 @@ #include <toolkit/awt/vclxwindow.hxx> #include <comphelper/extract.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <comphelper/property.hxx> #include <osl/diagnose.h> @@ -97,15 +98,9 @@ Sequence<Type> SAL_CALL OGenericUnoDialog::getTypes( ) throw(RuntimeException) ); } -//------------------------------------------------------------------------- sal_Bool SAL_CALL OGenericUnoDialog::supportsService(const OUString& ServiceName) throw(RuntimeException) { - Sequence< OUString > aSupported(getSupportedServiceNames()); - const OUString* pArray = aSupported.getConstArray(); - for (sal_Int32 i = 0; i < aSupported.getLength(); ++i, ++pArray) - if (pArray->equals(ServiceName)) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } //------------------------------------------------------------------------- diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx index 952b304d79d8..06953fbfa8e9 100644 --- a/svtools/source/uno/popupmenucontrollerbase.cxx +++ b/svtools/source/uno/popupmenucontrollerbase.cxx @@ -31,12 +31,7 @@ #include <rtl/ustrbuf.hxx> #include <osl/mutex.hxx> #include <comphelper/processfactory.hxx> - -//_________________________________________________________________________________________________________________ -// Defines -//_________________________________________________________________________________________________________________ -// - +#include <cppuhelper/supportsservice.hxx> using namespace com::sun::star; using namespace com::sun::star::uno; @@ -97,17 +92,9 @@ void SAL_CALL PopupMenuControllerBase::disposing() } // XServiceInfo - sal_Bool SAL_CALL PopupMenuControllerBase::supportsService( const OUString& ServiceName ) throw (RuntimeException) { - const Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return true; - - return false; + return cppu::supportsService(this, ServiceName); } // XEventListener diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx index 87846819092a..772577aa4f25 100644 --- a/svtools/source/uno/popupwindowcontroller.cxx +++ b/svtools/source/uno/popupwindowcontroller.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include <cppuhelper/supportsservice.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/toolbox.hxx> @@ -169,14 +169,7 @@ void SAL_CALL PopupWindowController::release() throw () // XServiceInfo sal_Bool SAL_CALL PopupWindowController::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - const Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return true; - - return false; + return cppu::supportsService(this, ServiceName); } // XInitialization diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 7071d86d5e77..02e0bf250782 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -31,6 +31,7 @@ #include <comphelper/propertysetinfo.hxx> #include <cppuhelper/weakagg.hxx> #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/supportsservice.hxx> #include <list> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> @@ -383,18 +384,9 @@ uno::Sequence< sal_Int8 > SAL_CALL SvUnoImageMapObject::getImplementationId() } // XServiceInfo - sal_Bool SAL_CALL SvUnoImageMapObject::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - const Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString * pArray = aSNL.getConstArray(); - - const sal_Int32 nCount = aSNL.getLength(); - for( sal_Int32 i = 0; i < nCount; i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL SvUnoImageMapObject::getSupportedServiceNames() |