summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-12-05 19:18:01 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-12-09 17:08:33 +0100
commitcccc6c4ebcc508576d9cf609a649d4d3d76d61eb (patch)
tree0e467741d6abd39915ecd6ed4ffbf71cce956c0c /sd/source/ui/unoidl
parent326aa3ff4d86c5709ae85ab71fd2c6828bbe7559 (diff)
fdo#54938: Convert sd to use cppu::supportsService
Change-Id: I1aaecbc9f7b5ca0ca2009caf38013054f84cbecc Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r--sd/source/ui/unoidl/DrawController.cxx20
-rw-r--r--sd/source/ui/unoidl/randomnode.cxx13
-rw-r--r--sd/source/ui/unoidl/sddetect.cxx12
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx16
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx3
5 files changed, 15 insertions, 49 deletions
diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx
index ff5bad215461..2efc800eafcb 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -34,6 +34,7 @@
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/bootstrap.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/framework/ConfigurationController.hpp>
@@ -222,9 +223,7 @@ void SAL_CALL DrawController::removeEventListener (
return SfxBaseController::suspend( Suspend );
}
-
// XServiceInfo
-
OUString SAL_CALL DrawController::getImplementationName( ) throw(RuntimeException)
{
// Do not throw an excepetion at the moment. This leads to a crash
@@ -233,23 +232,14 @@ OUString SAL_CALL DrawController::getImplementationName( ) throw(RuntimeExcepti
return OUString("DrawController") ;
}
-
-
static OUString ssServiceName( "com.sun.star.drawing.DrawingDocumentDrawView");
-sal_Bool SAL_CALL DrawController::supportsService (
- const OUString& rsServiceName)
+sal_Bool SAL_CALL DrawController::supportsService (const OUString& rsServiceName)
throw(RuntimeException)
{
- // Do not throw an exception at the moment. This leads to a crash
- // under Solaris on relead. See issue i70929 for details.
- // ThrowIfDisposed();
- return rsServiceName.equals(ssServiceName);
+ return cppu::supportsService(this, rsServiceName);
}
-
-
-
Sequence<OUString> SAL_CALL DrawController::getSupportedServiceNames (void)
throw(RuntimeException)
{
@@ -260,11 +250,7 @@ Sequence<OUString> SAL_CALL DrawController::getSupportedServiceNames (void)
return aSupportedServices;
}
-
-
-
//------ XSelectionSupplier --------------------------------------------
-
sal_Bool SAL_CALL DrawController::select (const Any& aSelection)
throw(lang::IllegalArgumentException, RuntimeException)
{
diff --git a/sd/source/ui/unoidl/randomnode.cxx b/sd/source/ui/unoidl/randomnode.cxx
index a18fd1c22619..45221ce0fc48 100644
--- a/sd/source/ui/unoidl/randomnode.cxx
+++ b/sd/source/ui/unoidl/randomnode.cxx
@@ -31,6 +31,7 @@
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include "CustomAnimationPreset.hxx"
@@ -153,11 +154,6 @@ private:
// --------------------------------------------------------------------
-static const sal_Char* pSN1 = "com.sun.star.animations.ParallelTimeContainer";
-static const sal_Char* pSN2 = "com.sun.star.comp.sd.RandomAnimationNode";
-
-// --------------------------------------------------------------------
-
SD_DLLPUBLIC Reference< XInterface > RandomAnimationNode_createInstance( sal_Int16 nPresetClass )
{
Reference< XInterface > xInt( static_cast<XWeak*>( new RandomAnimationNode( nPresetClass ) ) );
@@ -183,8 +179,9 @@ OUString RandomNode__getImplementationName() throw( RuntimeException )
Sequence< OUString > SAL_CALL RandomNode_getSupportedServiceNames() throw( RuntimeException )
{
- static const OUString aSN2( OUString::createFromAscii( pSN2 ) );
- Sequence< OUString > aSeq( &aSN2, 1 );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[0] = "com.sun.star.animations.ParallelTimeContainer";
+ aSeq[1] = "com.sun.star.comp.sd.RandomAnimationNode";
return aSeq;
}
@@ -671,7 +668,7 @@ OUString RandomAnimationNode::getImplementationName() throw()
// XServiceInfo
sal_Bool RandomAnimationNode::supportsService(const OUString& ServiceName) throw()
{
- return ServiceName.equalsAscii( pSN1 ) || ServiceName.equalsAscii( pSN2 );
+ return cppu::supportsService(this, ServiceName);
}
// XServiceInfo
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 0fddd1be6459..d07c2007b4fe 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
@@ -511,16 +512,7 @@ OUString SAL_CALL SdFilterDetect::getImplementationName() throw( RuntimeExceptio
/* XServiceInfo */
sal_Bool SAL_CALL SdFilterDetect::supportsService( const OUString& sServiceName ) throw( RuntimeException )
{
- Sequence< OUString > seqServiceNames = getSupportedServiceNames();
- const OUString* pArray = seqServiceNames.getConstArray();
- for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
- {
- if ( pArray[nCounter] == sServiceName )
- {
- return sal_True ;
- }
- }
- return sal_False ;
+ return cppu::supportsService(this, sServiceName);
}
/* XServiceInfo */
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 7db34251daff..3e1b95752dcb 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1173,17 +1173,7 @@ OUString SAL_CALL SdXImpressDocument::getImplementationName()
sal_Bool SAL_CALL SdXImpressDocument::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- ::SolarMutexGuard aGuard;
-
- if ( ServiceName == "com.sun.star.document.OfficeDocument"
- || ServiceName == "com.sun.star.drawing.GenericDrawingDocument"
- || ServiceName == "com.sun.star.drawing.DrawingDocumentFactory" )
- {
- return sal_True;
- }
-
- return ( ( mbImpressDoc && ServiceName == "com.sun.star.presentation.PresentationDocument" )
- || ( !mbImpressDoc && ServiceName == "com.sun.star.drawing.DrawingDocument" ) );
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL SdXImpressDocument::getSupportedServiceNames() throw(uno::RuntimeException)
@@ -2569,7 +2559,7 @@ OUString SAL_CALL SdDrawPagesAccess::getImplementationName( ) throw(uno::Runtim
sal_Bool SAL_CALL SdDrawPagesAccess::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return ServiceName == pSdDrawPagesAccessService;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL SdDrawPagesAccess::getSupportedServiceNames( ) throw(uno::RuntimeException)
@@ -2837,7 +2827,7 @@ OUString SAL_CALL SdMasterPagesAccess::getImplementationName( ) throw(uno::Runt
sal_Bool SAL_CALL SdMasterPagesAccess::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return ServiceName == pSdMasterPagesAccessService;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL SdMasterPagesAccess::getSupportedServiceNames( ) throw(uno::RuntimeException)
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 49c61762bd2b..e864e1906cfa 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -39,6 +39,7 @@
#include <sfx2/bindings.hxx>
#include <sfx2/sfxsids.hrc>
#include <comphelper/extract.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <svx/unoprov.hxx>
#include <svx/unoshape.hxx>
#include <svx/svditer.hxx>
@@ -1699,7 +1700,7 @@ OUString SAL_CALL SdUnoEventsAccess::getImplementationName( )
sal_Bool SAL_CALL SdUnoEventsAccess::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- return ServiceName == maStrServiceName;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL SdUnoEventsAccess::getSupportedServiceNames( )