summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-26 13:11:42 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-30 18:17:11 +0100
commit2b01553fa5982ed50fd37f346a150d1aac8dcd6f (patch)
tree1daf00bf4b69950c5b75e98571d2b839d5b83327 /svx
parent9ab844c7fa907e2d1119a316c695198ef888a059 (diff)
fdo#54938: Convert svx to use cppu::supportsService
Change-Id: I3ab178924cb1c4240511f08625f244dac54e3913 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/AccessibleFrameSelector.cxx25
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx21
-rw-r--r--svx/source/accessibility/svxrectctaccessiblecontext.cxx15
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx16
-rw-r--r--svx/source/fmcomp/fmgridif.cxx11
-rw-r--r--svx/source/form/formcontroller.cxx12
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx10
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx53
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx24
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx10
-rw-r--r--svx/source/unodraw/UnoNameItemTable.cxx10
-rw-r--r--svx/source/unodraw/XPropertyTable.cxx13
-rw-r--r--svx/source/unodraw/recoveryui.cxx33
-rw-r--r--svx/source/unodraw/unomod.cxx2
-rw-r--r--svx/source/unodraw/unomtabl.cxx10
-rw-r--r--svx/source/unodraw/unopool.cxx11
-rw-r--r--svx/source/unodraw/unoshape.cxx13
-rw-r--r--svx/source/unogallery/unogalitem.cxx18
-rw-r--r--svx/source/xml/xmlgrhlp.cxx8
19 files changed, 53 insertions, 262 deletions
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx
index 1a21e7cfd5dd..64dd1d1b497d 100644
--- a/svx/source/accessibility/AccessibleFrameSelector.cxx
+++ b/svx/source/accessibility/AccessibleFrameSelector.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/awt/FocusChangeReason.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <osl/mutex.hxx>
@@ -552,50 +553,34 @@ void AccFrameSelector::removeAccessibleEventListener( const Reference< XAccessib
}
}
-// ----------------------------------------------------------------------------
-
OUString AccFrameSelector::getImplementationName( ) throw (RuntimeException)
{
return OUString("AccFrameSelector");
}
-// ----------------------------------------------------------------------------
-
-const sal_Char sAccessible[] = "Accessible";
-const sal_Char sAccessibleContext[] = "AccessibleContext";
-const sal_Char sAccessibleComponent[] = "AccessibleComponent";
-
sal_Bool AccFrameSelector::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
- return rServiceName.equalsAsciiL( sAccessible , sizeof(sAccessible )-1 ) ||
- rServiceName.equalsAsciiL( sAccessibleContext , sizeof(sAccessibleContext )-1 ) ||
- rServiceName.equalsAsciiL( sAccessibleComponent, sizeof(sAccessibleComponent)-1 );
+ return cppu::supportsService(this, rServiceName);
}
-// ----------------------------------------------------------------------------
-
Sequence< OUString > AccFrameSelector::getSupportedServiceNames( )
throw (RuntimeException)
{
Sequence< OUString > aRet(3);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString( sAccessible );
- pArray[1] = OUString( sAccessibleContext );
- pArray[2] = OUString( sAccessibleComponent );
+ pArray[0] = OUString( "Accessible" );
+ pArray[1] = OUString( "AccessibleContext" );
+ pArray[2] = OUString( "AccessibleComponent" );
return aRet;
}
-// ----------------------------------------------------------------------------
-
void AccFrameSelector::IsValid() throw (RuntimeException)
{
if(!mpFrameSel)
throw RuntimeException();
}
-// ----------------------------------------------------------------------------
-
void AccFrameSelector::NotifyFocusListeners(sal_Bool bGetFocus)
{
SolarMutexGuard aGuard;
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index df0d9f8104a7..0b230a6faf61 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <unotools/accessiblestatesethelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
@@ -555,33 +556,16 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getBackground (void)
//===== XServiceInfo ========================================================
-
OUString SAL_CALL SvxGraphCtrlAccessibleContext::getImplementationName( void ) throw( RuntimeException )
{
return OUString( "com.sun.star.comp.ui.SvxGraphCtrlAccessibleContext" );
}
-//-----------------------------------------------------------------------------
-
sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::supportsService( const OUString& sServiceName ) throw( RuntimeException )
{
- ::SolarMutexGuard aGuard;
- // Iterate over all supported service names and return true if on of them
- // matches the given name.
- Sequence< OUString > aSupportedServices( getSupportedServiceNames() );
- int nLenght = aSupportedServices.getLength();
-
- for( int i = 0 ; i < nLenght ; ++i )
- {
- if( sServiceName == aSupportedServices[ i ] )
- return sal_True;
- }
-
- return sal_False;
+ return cppu::supportsService(this, sServiceName);
}
-//-----------------------------------------------------------------------------
-
Sequence< OUString > SAL_CALL SvxGraphCtrlAccessibleContext::getSupportedServiceNames( void ) throw( RuntimeException )
{
Sequence< OUString > aSNs( 3 );
@@ -594,7 +578,6 @@ Sequence< OUString > SAL_CALL SvxGraphCtrlAccessibleContext::getSupportedService
}
//===== XTypeProvider =======================================================
-
Sequence<sal_Int8> SAL_CALL SvxGraphCtrlAccessibleContext::getImplementationId( void ) throw( RuntimeException )
{
::SolarMutexGuard aGuard;
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index da7239296197..66812ff0ac68 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -1019,7 +1019,6 @@ Any SAL_CALL SvxRectCtlChildAccessibleContext::getMinimumValue() throw( RuntimeE
}
//===== XServiceInfo ========================================================
-
OUString SAL_CALL SvxRectCtlChildAccessibleContext::getImplementationName( void ) throw( RuntimeException )
{
return OUString( "com.sun.star.comp.ui.SvxRectCtlChildAccessibleContext" );
@@ -1027,18 +1026,7 @@ OUString SAL_CALL SvxRectCtlChildAccessibleContext::getImplementationName( void
sal_Bool SAL_CALL SvxRectCtlChildAccessibleContext::supportsService( const OUString& sServiceName ) throw( RuntimeException )
{
- // Iterate over all supported service names and return true if on of them
- // matches the given name.
- ::osl::MutexGuard aGuard( maMutex );
- Sequence< OUString > aSupportedServices ( getSupportedServiceNames() );
- int nLength = aSupportedServices.getLength();
- for( int i = 0 ; i < nLength; ++i )
- {
- if( sServiceName == aSupportedServices[ i ] )
- return sal_True;
- }
-
- return sal_False;
+ return cppu::supportsService(this, sServiceName);
}
Sequence< OUString > SAL_CALL SvxRectCtlChildAccessibleContext::getSupportedServiceNames( void ) throw( RuntimeException )
@@ -1048,7 +1036,6 @@ Sequence< OUString > SAL_CALL SvxRectCtlChildAccessibleContext::getSupportedServ
}
//===== XTypeProvider =======================================================
-
Sequence< sal_Int8 > SAL_CALL SvxRectCtlChildAccessibleContext::getImplementationId( void ) throw( RuntimeException )
{
static OImplementationId* pId = 0;
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 46bca87b1b5b..bfaa79119530 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -42,24 +42,18 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/tools/unotools.hxx>
#include <com/sun/star/document/XActionLockable.hpp>
+#include <cppuhelper/supportsservice.hxx>
using namespace css;
using namespace css::uno;
-// ---------------------------
// - EnhancedCustomShapeEngine -
-// ---------------------------
-
OUString EnhancedCustomShapeEngine_getImplementationName()
throw( RuntimeException )
{
return OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" );
}
-sal_Bool SAL_CALL EnhancedCustomShapeEngine_supportsService( const OUString& ServiceName )
- throw( RuntimeException )
-{
- return ServiceName == "com.sun.star.drawing.CustomShapeEngine";
-}
+
Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames()
throw( RuntimeException )
{
@@ -69,8 +63,6 @@ Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames
return aRet;
}
-// -----------------------------------------------------------------------------
-
EnhancedCustomShapeEngine::EnhancedCustomShapeEngine( const Reference< lang::XMultiServiceFactory >& rxMgr ) :
mxFact ( rxMgr ),
mbForceGroupWithText ( sal_False )
@@ -114,7 +106,6 @@ void SAL_CALL EnhancedCustomShapeEngine::initialize( const Sequence< Any >& aArg
}
// XServiceInfo ---------------------------------------------------------------
-
OUString SAL_CALL EnhancedCustomShapeEngine::getImplementationName()
throw( RuntimeException )
{
@@ -123,7 +114,7 @@ OUString SAL_CALL EnhancedCustomShapeEngine::getImplementationName()
sal_Bool SAL_CALL EnhancedCustomShapeEngine::supportsService( const OUString& rServiceName )
throw( RuntimeException )
{
- return EnhancedCustomShapeEngine_supportsService( rServiceName );
+ return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine::getSupportedServiceNames()
throw ( RuntimeException )
@@ -132,7 +123,6 @@ Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine::getSupportedServiceName
}
// XCustomShapeEngine -----------------------------------------------------------
-
SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText( const SdrObjCustomShape* pCustoObj, SdrObject* pRenderedShape )
{
bool bHasText = pCustoObj->HasText();
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 358328bfc844..939069f13375 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -51,6 +51,7 @@
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
@@ -408,24 +409,16 @@ Sequence<sal_Int8> SAL_CALL FmXGridControl::getImplementationId( ) throw(Runtim
}
// XServiceInfo
-//------------------------------------------------------------------------------
sal_Bool SAL_CALL FmXGridControl::supportsService(const OUString& ServiceName) throw()
{
- ::comphelper::StringSequence aSupported = getSupportedServiceNames();
- const OUString * pArray = aSupported.getConstArray();
- for( sal_Int32 i = 0; i < aSupported.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-//------------------------------------------------------------------------------
OUString SAL_CALL FmXGridControl::getImplementationName() throw()
{
return OUString("com.sun.star.form.FmXGridControl");
}
-//------------------------------------------------------------------------------
::comphelper::StringSequence SAL_CALL FmXGridControl::getSupportedServiceNames() throw()
{
Sequence< OUString > aServiceNames(2);
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index dcd2b18aa2eb..f4e5e0002649 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -75,6 +75,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/flagguard.hxx>
#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <connectivity/IParseContext.hxx>
#include <toolkit/controls/unocontrol.hxx>
@@ -674,7 +675,6 @@ Sequence< sal_Int8 > SAL_CALL FormController::getImplementationId() throw( Runti
return pId->getImplementationId();
}
-//------------------------------------------------------------------------------
Sequence< Type > SAL_CALL FormController::getTypes( ) throw(RuntimeException)
{
return comphelper::concatSequences(
@@ -684,24 +684,16 @@ Sequence< Type > SAL_CALL FormController::getTypes( ) throw(RuntimeException)
}
// XServiceInfo
-//------------------------------------------------------------------------------
sal_Bool SAL_CALL FormController::supportsService(const OUString& ServiceName) throw( RuntimeException )
{
- Sequence< OUString> aSNL(getSupportedServiceNames());
- const OUString * pArray = aSNL.getConstArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-//------------------------------------------------------------------------------
OUString SAL_CALL FormController::getImplementationName() throw( RuntimeException )
{
return OUString("org.openoffice.comp.svx.FormController");
}
-//------------------------------------------------------------------------------
Sequence< OUString> SAL_CALL FormController::getSupportedServiceNames(void) throw( RuntimeException )
{
// service names which are supported only, but cannot be used to created an
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 6131c24ebc56..e3401615d00a 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -31,6 +31,7 @@
#include <svtools/ctrlbox.hxx>
#include <osl/mutex.hxx>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <memory>
@@ -277,14 +278,7 @@ void SAL_CALL FontHeightToolBoxControl::release() throw ()
sal_Bool SAL_CALL FontHeightToolBoxControl::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- const 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);
}
OUString SAL_CALL FontHeightToolBoxControl::getImplementationName()
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index f2558d9d2b10..e1bac23aad38 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -23,6 +23,7 @@
#include <svx/dialmgr.hxx>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
@@ -383,14 +384,7 @@ OUString SAL_CALL FindTextToolbarController::getImplementationName() throw( css:
sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
{
- const css::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);
}
css::uno::Sequence< OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames() throw( css::uno::RuntimeException )
@@ -556,14 +550,7 @@ OUString SAL_CALL UpDownSearchToolboxController::getImplementationName() throw(
sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
{
- const css::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);
}
css::uno::Sequence< OUString > SAL_CALL UpDownSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
@@ -664,14 +651,7 @@ OUString SAL_CALL MatchCaseToolboxController::getImplementationName() throw( css
sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
{
- const css::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);
}
css::uno::Sequence< OUString > SAL_CALL MatchCaseToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
@@ -783,15 +763,7 @@ OUString SAL_CALL FindAllToolboxController::getImplementationName() throw( css::
sal_Bool SAL_CALL FindAllToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
{
- const css::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);
}
css::uno::Sequence< OUString > SAL_CALL FindAllToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
@@ -886,15 +858,7 @@ OUString SAL_CALL ExitSearchToolboxController::getImplementationName() throw( cs
sal_Bool SAL_CALL ExitSearchToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
{
- const css::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);
}
css::uno::Sequence< OUString > SAL_CALL ExitSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
@@ -1002,10 +966,7 @@ OUString SAL_CALL FindbarDispatcher::getImplementationName() throw( css::uno::Ru
sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
{
- return (
- ServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.comp.svx.FindbarDispatcher")) ||
- ServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.frame.ProtocolHandler"))
- );
+ return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence< OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() throw( css::uno::RuntimeException )
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index 5c8e11f0d8db..cff819f6fb58 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -28,21 +28,17 @@
#include <vcl/msgbox.hxx>
// header for class OImplementationId
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-//.............................................................................
namespace textconversiondlgs
{
-//.............................................................................
using namespace ::com::sun::star;
-#define SERVICE_IMPLEMENTATION_NAME OUString("com.sun.star.comp.linguistic2.ChineseTranslationDialog")
-#define SERVICE_NAME OUString("com.sun.star.linguistic2.ChineseTranslationDialog")
-
ChineseTranslation_UnoDialog::ChineseTranslation_UnoDialog( const uno::Reference< uno::XComponentContext >& xContext )
: m_xCC( xContext )
, m_xParentWindow( 0 )
@@ -70,9 +66,8 @@ void ChineseTranslation_UnoDialog::impl_DeleteDialog()
m_pDialog = 0;
}
}
-//-------------------------------------------------------------------------
-// lang::XServiceInfo
+// lang::XServiceInfo
OUString SAL_CALL ChineseTranslation_UnoDialog::getImplementationName() throw( uno::RuntimeException )
{
return getImplementationName_Static();
@@ -80,19 +75,12 @@ OUString SAL_CALL ChineseTranslation_UnoDialog::getImplementationName() throw( u
OUString ChineseTranslation_UnoDialog::getImplementationName_Static()
{
- return SERVICE_IMPLEMENTATION_NAME;
+ return OUString("com.sun.star.comp.linguistic2.ChineseTranslationDialog");
}
sal_Bool SAL_CALL ChineseTranslation_UnoDialog::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- uno::Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString* pArray = aSNL.getArray();
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- {
- if( pArray[ i ] == ServiceName )
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL ChineseTranslation_UnoDialog::getSupportedServiceNames() throw( uno::RuntimeException )
@@ -103,13 +91,11 @@ uno::Sequence< OUString > SAL_CALL ChineseTranslation_UnoDialog::getSupportedSer
uno::Sequence< OUString > ChineseTranslation_UnoDialog::getSupportedServiceNames_Static()
{
uno::Sequence< OUString > aSNS( 1 );
- aSNS.getArray()[ 0 ] = SERVICE_NAME;
+ aSNS.getArray()[ 0 ] = OUString("com.sun.star.linguistic2.ChineseTranslationDialog");
return aSNS;
}
-//-------------------------------------------------------------------------
// ui::dialogs::XExecutableDialog
-
void SAL_CALL ChineseTranslation_UnoDialog::setTitle( const OUString& ) throw(uno::RuntimeException)
{
//not implemented - fell free to do so, if you do need this
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 21dcfd901236..21a55605d270 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/drawing/GraphicFilterRequest.hpp>
#include <com/sun/star/util/URL.hpp>
#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
#include <vcl/metaact.hxx>
#include <vcl/svapp.hxx>
@@ -1229,14 +1230,7 @@ OUString SAL_CALL GraphicExporter::getImplementationName( )
sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
- Sequence< OUString > aSeq( GraphicExporter_getSupportedServiceNames() );
- sal_Int32 nArgs = aSeq.getLength();
- const OUString* pService = aSeq.getConstArray();
- while( nArgs-- )
- if( *pService++ == ServiceName )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL GraphicExporter::getSupportedServiceNames( )
diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx
index c902f341359b..b696c29665cd 100644
--- a/svx/source/unodraw/UnoNameItemTable.cxx
+++ b/svx/source/unodraw/UnoNameItemTable.cxx
@@ -23,6 +23,7 @@
#include <svl/itemset.hxx>
#include <svl/style.hxx>
#include <comphelper/stl_types.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <svx/svdmodel.hxx>
#include "UnoNameItemTable.hxx"
@@ -79,14 +80,7 @@ void SvxUnoNameItemTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw(
sal_Bool SAL_CALL SvxUnoNameItemTable::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 sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
void SAL_CALL SvxUnoNameItemTable::ImplInsertByName( const OUString& aName, const uno::Any& aElement )
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx
index 7c4ac26097c4..6c74a99386fc 100644
--- a/svx/source/unodraw/XPropertyTable.cxx
+++ b/svx/source/unodraw/XPropertyTable.cxx
@@ -29,6 +29,7 @@
#include <vcl/svapp.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <svx/xdef.hxx>
#include "svx/unoapi.hxx"
@@ -96,17 +97,7 @@ XPropertyEntry* SvxUnoXPropertyTable::get( long index ) const
sal_Bool SAL_CALL SvxUnoXPropertyTable::supportsService( const OUString& ServiceName )
throw( uno::RuntimeException)
{
- const uno::Sequence< OUString > aServices( getSupportedServiceNames() );
- const OUString* pServices = aServices.getConstArray();
- const sal_Int32 nCount = aServices.getLength();
- sal_Int32 i;
- for( i = 0; i < nCount; i++ )
- {
- if( *pServices++ == ServiceName )
- return sal_True;
- }
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
// XNameContainer
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index e1da634b103a..ce51832b621b 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -28,17 +28,13 @@
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <boost/scoped_ptr.hpp>
#include <officecfg/Office/Recovery.hxx>
-
-#define IMPLEMENTATIONNAME_RECOVERYUI OUString("com.sun.star.comp.svx.RecoveryUI")
-#define SERVICENAME_RECOVERYUI OUString("com.sun.star.dialog.RecoveryUI")
-
-
namespace svx
{
@@ -47,7 +43,6 @@ namespace svxdr = ::svx::DocRecovery;
using namespace ::rtl;
using namespace ::osl;
-//===============================================
RecoveryUI::RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: m_xContext (xContext )
, m_pParentWindow(0 )
@@ -55,42 +50,28 @@ RecoveryUI::RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >&
{
}
-//===============================================
RecoveryUI::~RecoveryUI()
{
}
-//===============================================
OUString SAL_CALL RecoveryUI::getImplementationName()
throw(css::uno::RuntimeException)
{
return RecoveryUI::st_getImplementationName();
}
-//===============================================
sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName)
throw(css::uno::RuntimeException)
{
- const css::uno::Sequence< OUString > lServices = RecoveryUI::st_getSupportedServiceNames();
- sal_Int32 c = lServices.getLength();
- sal_Int32 i = 0;
- for (i=0; i<c; ++i)
- {
- const OUString& sSupportedService = lServices[i];
- if (sSupportedService.equals(sServiceName))
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, sServiceName);
}
-//===============================================
css::uno::Sequence< OUString > SAL_CALL RecoveryUI::getSupportedServiceNames()
throw(css::uno::RuntimeException)
{
return RecoveryUI::st_getSupportedServiceNames();
}
-//===============================================
css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& aURL,
const css::uno::Sequence< css::beans::PropertyValue >& )
throw(css::uno::RuntimeException)
@@ -151,28 +132,24 @@ void SAL_CALL RecoveryUI::removeStatusListener(const css::uno::Reference< css::f
OSL_FAIL("RecoveryUI::removeStatusListener()\nNot implemented yet!");
}
-//===============================================
OUString RecoveryUI::st_getImplementationName()
{
- return OUString(IMPLEMENTATIONNAME_RECOVERYUI);
+ return OUString("com.sun.star.comp.svx.RecoveryUI");
}
-//===============================================
css::uno::Sequence< OUString > RecoveryUI::st_getSupportedServiceNames()
{
- css::uno::Sequence< OUString > lServiceNames(1); lServiceNames.getArray() [0] = SERVICENAME_RECOVERYUI;
+ css::uno::Sequence< OUString > lServiceNames(1);
+ lServiceNames.getArray() [0] = OUString("com.sun.star.dialog.RecoveryUI");
return lServiceNames;
}
-//===============================================
css::uno::Reference< css::uno::XInterface > SAL_CALL RecoveryUI::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
{
RecoveryUI* pNew = new RecoveryUI(comphelper::getComponentContext(xSMGR));
return css::uno::Reference< css::uno::XInterface >(static_cast< css::lang::XServiceInfo* >(pNew));
}
-//===============================================
-
static OUString GetCrashConfigDir()
{
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 6ee8b68b93bf..2c7fef5c6500 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -708,7 +708,7 @@ OUString SAL_CALL SvxUnoDrawPagesAccess::getImplementationName( ) throw(uno::Ru
sal_Bool SAL_CALL SvxUnoDrawPagesAccess::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return ServiceName == pSvxUnoDrawPagesAccessService;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL SvxUnoDrawPagesAccess::getSupportedServiceNames( ) throw(uno::RuntimeException)
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index 5673056ba446..76c3e1b5a334 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -26,6 +26,7 @@
#include <svl/style.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
#include <svl/lstner.hxx>
@@ -131,14 +132,7 @@ void SvxUnoMarkerTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
sal_Bool SAL_CALL SvxUnoMarkerTable::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 sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
OUString SAL_CALL SvxUnoMarkerTable::getImplementationName() throw( uno::RuntimeException )
diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index 48dd8b4a36ac..8686e0a55f1e 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -22,6 +22,7 @@
#include <comphelper/propertysetinfo.hxx>
#include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "svx/unopool.hxx"
@@ -393,17 +394,9 @@ uno::Sequence< sal_Int8 > SAL_CALL SvxUnoDrawPool::getImplementationId()
}
// XServiceInfo
-
sal_Bool SAL_CALL SvxUnoDrawPool::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 sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
OUString SAL_CALL SvxUnoDrawPool::getImplementationName() throw( uno::RuntimeException )
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index f5f14a43e0f0..e580014b9743 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -18,6 +18,7 @@
*/
#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/drawing/CircleKind.hpp>
@@ -3793,21 +3794,11 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
return aSeq;
}
-//----------------------------------------------------------------------
sal_Bool SAL_CALL SvxShape::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException )
{
- Sequence< OUString > SupportedServices( getSupportedServiceNames() );
- const OUString * pArray = SupportedServices.getConstArray();
- const sal_Int32 nCount = SupportedServices.getLength();
- sal_Int32 i;
- for( i = 0; i < nCount; i++ )
- if( *pArray++ == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-//----------------------------------------------------------------------
-
// XGluePointsSupplier
uno::Reference< container::XIndexContainer > SAL_CALL SvxShape::getGluePoints()
throw(uno::RuntimeException)
diff --git a/svx/source/unogallery/unogalitem.cxx b/svx/source/unogallery/unogalitem.cxx
index 3eeba97be520..620ee9fcfdd6 100644
--- a/svx/source/unogallery/unogalitem.cxx
+++ b/svx/source/unogallery/unogalitem.cxx
@@ -29,6 +29,7 @@
#include <svl/itemprop.hxx>
#include <svl/itempool.hxx>
#include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include "galobj.hxx"
#include <com/sun/star/beans/PropertyState.hpp>
@@ -143,39 +144,24 @@ uno::Sequence< OUString > GalleryItem::getSupportedServiceNames_Static()
return aSeq;
}
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL GalleryItem::getImplementationName()
throw( uno::RuntimeException )
{
return getImplementationName_Static();
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL GalleryItem::supportsService( const OUString& ServiceName )
throw( uno::RuntimeException )
{
- uno::Sequence< OUString > aSNL( getSupportedServiceNames() );
- const OUString* pArray = aSNL.getConstArray();
-
- for( int i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return true;
-
- return false;
+ return cppu::supportsService(this, ServiceName);
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< OUString > SAL_CALL GalleryItem::getSupportedServiceNames()
throw( uno::RuntimeException )
{
return getSupportedServiceNames_Static();
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< uno::Type > SAL_CALL GalleryItem::getTypes()
throw(uno::RuntimeException)
{
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 42c9c213f704..b26c811b7e15 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <cppuhelper/compbase4.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/streamwrap.hxx>
@@ -1017,14 +1018,13 @@ OUString SAL_CALL SvXMLGraphicImportExportHelper::getImplementationName()
return SvXMLGraphicImportHelper_getImplementationName();
return SvXMLGraphicExportHelper_getImplementationName();
}
+
::sal_Bool SAL_CALL SvXMLGraphicImportExportHelper::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- Sequence< OUString > aServiceNames( getSupportedServiceNames());
- const OUString * pBegin = aServiceNames.getConstArray();
- const OUString * pEnd = pBegin + aServiceNames.getLength();
- return (::std::find( pBegin, pEnd, ServiceName ) != pEnd);
+ return cppu::supportsService(this, ServiceName);
}
+
Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServiceNames()
throw (uno::RuntimeException)
{