[Libreoffice-commits] core.git: 2 commits - formula/source sot/source svx/source sw/source

Stephan Bergmann sbergman at redhat.com
Wed Oct 30 18:29:51 CET 2013


 formula/source/core/api/FormulaOpCodeMapperObj.cxx                         |   11 --
 sot/source/unoolestorage/xolesimplestorage.cxx                             |   15 --
 svx/source/accessibility/AccessibleFrameSelector.cxx                       |   25 ----
 svx/source/accessibility/GraphCtlAccessibleContext.cxx                     |   21 ---
 svx/source/accessibility/svxrectctaccessiblecontext.cxx                    |   15 --
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx                      |   16 ---
 svx/source/fmcomp/fmgridif.cxx                                             |   11 --
 svx/source/form/formcontroller.cxx                                         |   12 --
 svx/source/tbxctrls/tbunocontroller.cxx                                    |   10 -
 svx/source/tbxctrls/tbunosearchcontrollers.cxx                             |   53 +---------
 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx |   24 ----
 svx/source/unodraw/UnoGraphicExporter.cxx                                  |   10 -
 svx/source/unodraw/UnoNameItemTable.cxx                                    |   10 -
 svx/source/unodraw/XPropertyTable.cxx                                      |   13 --
 svx/source/unodraw/recoveryui.cxx                                          |   33 ------
 svx/source/unodraw/unomod.cxx                                              |    2 
 svx/source/unodraw/unomtabl.cxx                                            |   10 -
 svx/source/unodraw/unopool.cxx                                             |   11 --
 svx/source/unodraw/unoshape.cxx                                            |   13 --
 svx/source/unogallery/unogalitem.cxx                                       |   18 ---
 svx/source/xml/xmlgrhlp.cxx                                                |    8 -
 sw/source/filter/ww8/docxtablestyleexport.hxx                              |    2 
 22 files changed, 59 insertions(+), 284 deletions(-)

New commits:
commit 83397d0415f248bb61829b13eb7c6364d7a71508
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 30 18:22:29 2013 +0100

    -Werror,-Wmismatched-tags
    
    Change-Id: Iec4f78de9e52144b84baaa739d97681343ae5a27

diff --git a/sw/source/filter/ww8/docxtablestyleexport.hxx b/sw/source/filter/ww8/docxtablestyleexport.hxx
index c66372e..77e7036 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.hxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.hxx
@@ -18,7 +18,7 @@ class SwDoc;
 /// Handles DOCX export of table styles, based on InteropGrabBag.
 class DocxTableStyleExport
 {
-    class Impl;
+    struct Impl;
     boost::shared_ptr<Impl> m_pImpl;
 public:
     void TableStyles();
commit 2b01553fa5982ed50fd37f346a150d1aac8dcd6f
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Sat Oct 26 13:11:42 2013 -0200

    fdo#54938: Convert svx to use cppu::supportsService
    
    Change-Id: I3ab178924cb1c4240511f08625f244dac54e3913
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/formula/source/core/api/FormulaOpCodeMapperObj.cxx b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
index d7bbaf4..4439834 100644
--- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx
+++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
@@ -19,21 +19,17 @@
 #include "formula/FormulaOpCodeMapperObj.hxx"
 #include "formula/opcode.hxx"
 #include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
-// =============================================================================
 namespace formula
 {
-// =============================================================================
-
     using namespace ::com::sun::star;
 
-    // -----------------------------------------------------------------------------
-// --------------------------------------------------------------------------------
 sal_Bool SAL_CALL FormulaOpCodeMapperObj::supportsService( const OUString& _rServiceName ) throw(uno::RuntimeException)
 {
-    return ::comphelper::findValue( getSupportedServiceNames_Static(), _rServiceName, sal_True ).getLength() != 0;
+    return cppu::supportsService(this, _rServiceName);
 }
-//------------------------------------------------------------------------
+
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
 FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler)
 : m_pCompiler(_pCompiler)
@@ -45,7 +41,6 @@ FormulaOpCodeMapperObj::~FormulaOpCodeMapperObj()
 {
 }
 
-
 ::sal_Int32 SAL_CALL FormulaOpCodeMapperObj::getOpCodeExternal()
     throw (::com::sun::star::uno::RuntimeException)
 {
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx
index d2fbf32..712f351 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -30,6 +30,7 @@
 #include <unotools/ucbstreamhelper.hxx>
 
 #include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <sot/storinfo.hxx>
 
@@ -769,31 +770,19 @@ void SAL_CALL OLESimpleStorage::setClassInfo( const uno::Sequence< sal_Int8 >& /
     throw lang::NoSupportException();
 }
 
-//____________________________________________________________________________________________________
 //  XServiceInfo
-//____________________________________________________________________________________________________
-
-// --------------------------------------------------------------------------------
 OUString SAL_CALL OLESimpleStorage::getImplementationName()
     throw ( uno::RuntimeException )
 {
     return impl_staticGetImplementationName();
 }
 
-// --------------------------------------------------------------------------------
 sal_Bool SAL_CALL OLESimpleStorage::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 OLESimpleStorage::getSupportedServiceNames()
         throw ( uno::RuntimeException )
 {
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx
index 1a21e7c..64dd1d1 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 df0d9f8..0b230a6 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 da72392..66812ff 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 46bca87..bfaa791 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 358328b..939069f 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 dcd2b18..f4e5e00 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 6131c24..e340161 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 f2558d9..e1bac23 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 5c8e11f..cff819f 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 21dcfd9..21a5560 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 c902f34..b696c29 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 7c4ac26..6c74a99 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 e1da634..ce51832 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 6ee8b68..2c7fef5 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 5673056..76c3e1b 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 48dd8b4..8686e0a 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 f5f14a4..e580014 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 3eeba97..620ee9f 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 42c9c21..b26c811 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)
 {


More information about the Libreoffice-commits mailing list