summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2014-01-14 12:27:09 -0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-16 10:25:53 +0100
commita2218b0d8b39e5018342b9085a3ec98941631952 (patch)
tree5aa97c50be7479c6d301fdd5718424debbff5a38
parentf32f8285966a0455a7c0db71e196e5ea92390329 (diff)
fdo#54938: Convert svx and svl to cppu::supportsService...
...final season Change-Id: Ie51ac231def4a8a6e2681b81de7580798c95eed2
-rw-r--r--svl/source/numbers/numfmuno.cxx23
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx11
-rw-r--r--svx/source/accessibility/svxpixelctlaccessiblecontext.cxx33
-rw-r--r--svx/source/inc/unogalthemeprovider.hxx7
-rw-r--r--svx/source/table/cell.cxx19
-rw-r--r--svx/source/unodraw/UnoNamespaceMap.cxx5
-rw-r--r--svx/source/unodraw/unoctabl.cxx10
-rw-r--r--svx/source/unogallery/unogaltheme.cxx18
-rw-r--r--svx/source/unogallery/unogaltheme.hxx6
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx22
10 files changed, 39 insertions, 115 deletions
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index b71d52bcd9ff..b733602d564a 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <tools/color.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <osl/mutex.hxx>
@@ -25,6 +24,7 @@
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include "numfmuno.hxx"
#include <svl/numuno.hxx>
@@ -34,11 +34,6 @@
using namespace com::sun::star;
-#define SERVICENAME_NUMBERFORMATTER "com.sun.star.util.NumberFormatter"
-#define SERVICENAME_NUMBERSETTINGS "com.sun.star.util.NumberFormatSettings"
-#define SERVICENAME_NUMBERFORMATS "com.sun.star.util.NumberFormats"
-#define SERVICENAME_NUMBERFORMAT "com.sun.star.util.NumberFormatProperties"
-
#define PROPERTYNAME_FMTSTR "FormatString"
#define PROPERTYNAME_LOCALE "Locale"
#define PROPERTYNAME_TYPE "Type"
@@ -384,7 +379,7 @@ OUString SAL_CALL SvNumberFormatterServiceObj::getImplementationName()
sal_Bool SAL_CALL SvNumberFormatterServiceObj::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- return ServiceName.equalsAscii(SERVICENAME_NUMBERFORMATTER);
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence<OUString> SAL_CALL SvNumberFormatterServiceObj::getSupportedServiceNames()
@@ -392,7 +387,7 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatterServiceObj::getSupportedServic
{
uno::Sequence<OUString> aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = SERVICENAME_NUMBERFORMATTER;
+ pArray[0] = "com.sun.star.util.NumberFormatter";
return aRet;
}
@@ -676,7 +671,7 @@ OUString SAL_CALL SvNumberFormatsObj::getImplementationName()
sal_Bool SAL_CALL SvNumberFormatsObj::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- return ServiceName.equalsAscii(SERVICENAME_NUMBERFORMATS);
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence<OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNames()
@@ -684,7 +679,7 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNames()
{
uno::Sequence<OUString> aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString(SERVICENAME_NUMBERFORMATS);
+ pArray[0] = "com.sun.star.util.NumberFormats";
return aRet;
}
@@ -933,7 +928,7 @@ OUString SAL_CALL SvNumberFormatObj::getImplementationName()
sal_Bool SAL_CALL SvNumberFormatObj::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- return ServiceName.equalsAscii(SERVICENAME_NUMBERFORMAT);
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence<OUString> SAL_CALL SvNumberFormatObj::getSupportedServiceNames()
@@ -941,7 +936,7 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatObj::getSupportedServiceNames()
{
uno::Sequence<OUString> aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = SERVICENAME_NUMBERFORMAT;
+ pArray[0] = "com.sun.star.util.NumberFormatProperties";
return aRet;
}
@@ -1092,7 +1087,7 @@ OUString SAL_CALL SvNumberFormatSettingsObj::getImplementationName()
sal_Bool SAL_CALL SvNumberFormatSettingsObj::supportsService( const OUString& ServiceName )
throw(uno::RuntimeException)
{
- return ServiceName.equalsAscii(SERVICENAME_NUMBERSETTINGS);
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence<OUString> SAL_CALL SvNumberFormatSettingsObj::getSupportedServiceNames()
@@ -1100,7 +1095,7 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatSettingsObj::getSupportedServiceN
{
uno::Sequence<OUString> aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = SERVICENAME_NUMBERSETTINGS;
+ pArray[0] = "com.sun.star.util.NumberFormatSettings";
return aRet;
}
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index c59e296c43a6..215758b50a03 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -22,6 +22,7 @@
#include <unotools/pathoptions.hxx>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
@@ -1357,28 +1358,21 @@ void PasswordContainer::Notify()
}
}
-
OUString SAL_CALL PasswordContainer::getImplementationName( ) throw(uno::RuntimeException)
{
return impl_getStaticImplementationName();
}
-
sal_Bool SAL_CALL PasswordContainer::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- if ( ServiceName.equalsAscii("com.sun.star.task.PasswordContainer") )
- return sal_True;
- else
- return sal_False;
+ return cppu::supportsService( this, ServiceName );
}
-
Sequence< OUString > SAL_CALL PasswordContainer::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return impl_getStaticSupportedServiceNames();
}
-
Sequence< OUString > SAL_CALL PasswordContainer::impl_getStaticSupportedServiceNames( ) throw(uno::RuntimeException)
{
Sequence< OUString > aRet(1);
@@ -1386,7 +1380,6 @@ Sequence< OUString > SAL_CALL PasswordContainer::impl_getStaticSupportedServiceN
return aRet;
}
-
OUString SAL_CALL PasswordContainer::impl_getStaticImplementationName() throw(uno::RuntimeException)
{
return OUString("stardiv.svl.PasswordContainer");
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index 926affdf8949..78cb15124489 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/awt/XWindow.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/helper/convert.hxx>
@@ -362,33 +363,21 @@ OUString SvxPixelCtlAccessible::getImplementationName( ) throw (uno::RuntimeExc
{
return OUString("SvxPixelCtlAccessible");
}
-/*-- 04.02.2002 14:12:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-const sal_Char sAccessible[] = "Accessible";
-const sal_Char sAccessibleContext[] = "AccessibleContext";
-const sal_Char sAccessibleComponent[] = "AccessibleComponent";
sal_Bool SvxPixelCtlAccessible::supportsService( const OUString& rServiceName )
throw (uno::RuntimeException)
{
- return rServiceName.equalsAsciiL( sAccessible , sizeof(sAccessible )-1 ) ||
- rServiceName.equalsAsciiL( sAccessibleContext , sizeof(sAccessibleContext )-1 ) ||
- rServiceName.equalsAsciiL( sAccessibleComponent, sizeof(sAccessibleComponent)-1 );// ||
-// rServiceName.equalsAsciiL( sAccessibleTable, sizeof(sAccessibleTable)-1 );
+ return cppu::supportsService( this, rServiceName );
}
-/*-- 04.02.2002 14:12:05---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SvxPixelCtlAccessible::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessible ) );
- pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleContext ) );
- pArray[2] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleComponent) );
-// pArray[3] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleTable) );
+ pArray[0] = "Accessible";
+ pArray[1] = "AccessibleContext";
+ pArray[2] = "AccessibleComponent";
return aRet;
}
@@ -951,7 +940,6 @@ void SAL_CALL SvxPixelCtlAccessibleChild::removeAccessibleEventListener( const u
//===== XServiceInfo ========================================================
-
OUString SAL_CALL SvxPixelCtlAccessibleChild::getImplementationName( void ) throw( RuntimeException )
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SvxPixelCtlAccessibleChild" ) );
@@ -959,19 +947,16 @@ OUString SAL_CALL SvxPixelCtlAccessibleChild::getImplementationName( void ) thro
sal_Bool SAL_CALL SvxPixelCtlAccessibleChild::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 > SAL_CALL SvxPixelCtlAccessibleChild::getSupportedServiceNames( void ) throw( RuntimeException )
{
uno::Sequence< OUString > aRet(3);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessible ) );
- pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleContext ) );
- pArray[2] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleComponent) );
+ pArray[0] = "Accessible";
+ pArray[1] = "AccessibleContext";
+ pArray[2] = "AccessibleComponent";
return aRet;
}
diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx
index 84980ab408c7..9d8fa3cea5d4 100644
--- a/svx/source/inc/unogalthemeprovider.hxx
+++ b/svx/source/inc/unogalthemeprovider.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_SVX_SOURCE_INC_UNOGALTHEMEPROVIDER_HXX
#define INCLUDED_SVX_SOURCE_INC_UNOGALTHEMEPROVIDER_HXX
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/gallery/XGalleryThemeProvider.hpp>
@@ -29,8 +29,9 @@ class Gallery;
namespace {
-class GalleryThemeProvider : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XInitialization,
- ::com::sun::star::gallery::XGalleryThemeProvider >
+class GalleryThemeProvider : public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::gallery::XGalleryThemeProvider,
+ ::com::sun::star::lang::XServiceInfo >
{
public:
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 8685e7a647b9..09c21e2a67d6 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -26,6 +26,7 @@
#include <comphelper/string.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <svl/style.hxx>
#include <svl/itemset.hxx>
@@ -867,30 +868,17 @@ Sequence< sal_Int8 > SAL_CALL Cell::getImplementationId( ) throw (RuntimeExcept
return pId->getImplementationId();
}
-// -----------------------------------------------------------------------------
// XServiceInfo
-// -----------------------------------------------------------------------------
-
OUString SAL_CALL Cell::getImplementationName( ) throw (RuntimeException)
{
return OUString( "com.sun.star.comp.svx.table.Cell" );
}
-// -----------------------------------------------------------------------------
-
sal_Bool SAL_CALL Cell::supportsService( const OUString& ServiceName ) throw (RuntimeException)
{
- if( ServiceName == "com.sun.star.table.cell" )
- return sal_True;
-
- if( ServiceName == "com.sun.star.drawing.cell" )
- return sal_True;
-
- return SvxUnoTextBase::supportsService( ServiceName );
+ return cppu::supportsService( this, ServiceName );
}
-// -----------------------------------------------------------------------------
-
Sequence< OUString > SAL_CALL Cell::getSupportedServiceNames( ) throw (RuntimeException)
{
Sequence< OUString > aSeq( SvxUnoTextBase::getSupportedServiceNames() );
@@ -901,10 +889,7 @@ Sequence< OUString > SAL_CALL Cell::getSupportedServiceNames( ) throw (RuntimeE
return aSeq;
}
-// -----------------------------------------------------------------------------
// XLayoutConstrains
-// -----------------------------------------------------------------------------
-
::com::sun::star::awt::Size SAL_CALL Cell::getMinimumSize( ) throw (RuntimeException)
{
return ::com::sun::star::awt::Size( getMinimumWidth(), getMinimumHeight() );
diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx
index b6add6abf219..361596df2686 100644
--- a/svx/source/unodraw/UnoNamespaceMap.cxx
+++ b/svx/source/unodraw/UnoNamespaceMap.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <svl/itempool.hxx>
@@ -281,10 +282,10 @@ OUString SAL_CALL NamespaceMap::getImplementationName( )
return NamespaceMap_getImplementationName();
}
-sal_Bool SAL_CALL NamespaceMap::supportsService( const OUString& )
+sal_Bool SAL_CALL NamespaceMap::supportsService( const OUString& serviceName )
throw(RuntimeException)
{
- return sal_True;
+ return cppu::supportsService( this, serviceName );
}
Sequence< OUString > SAL_CALL NamespaceMap::getSupportedServiceNames( )
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index c1afe3db6dcf..019654c5fd91 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <svx/xtable.hxx>
using namespace ::com::sun::star;
@@ -72,14 +73,7 @@ SvxUnoColorTable::~SvxUnoColorTable() throw()
sal_Bool SAL_CALL SvxUnoColorTable::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 SvxUnoColorTable::getImplementationName() throw( uno::RuntimeException )
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index 692305232dbc..7017871b7519 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -32,6 +32,7 @@
#include <vcl/svapp.hxx>
#include <unotools/pathoptions.hxx>
#include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star;
@@ -89,39 +90,24 @@ uno::Sequence< OUString > GalleryTheme::getSupportedServiceNames_Static()
return aSeq;
}
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL GalleryTheme::getImplementationName()
throw( uno::RuntimeException )
{
return getImplementationName_Static();
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL GalleryTheme::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 GalleryTheme::getSupportedServiceNames()
throw( uno::RuntimeException )
{
return getSupportedServiceNames_Static();
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< uno::Type > SAL_CALL GalleryTheme::getTypes()
throw(uno::RuntimeException)
{
diff --git a/svx/source/unogallery/unogaltheme.hxx b/svx/source/unogallery/unogaltheme.hxx
index c2d06898528b..5359d14c0b75 100644
--- a/svx/source/unogallery/unogaltheme.hxx
+++ b/svx/source/unogallery/unogaltheme.hxx
@@ -22,7 +22,7 @@
#include <list>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <svl/lstner.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/gallery/XGalleryTheme.hpp>
@@ -38,7 +38,9 @@ namespace unogallery {
// - GalleryTheme -
// ----------------
-class GalleryTheme : public ::cppu::WeakImplHelper1< ::com::sun::star::gallery::XGalleryTheme >,
+class GalleryTheme : public ::cppu::WeakImplHelper2<
+ ::com::sun::star::gallery::XGalleryTheme,
+ ::com::sun::star::lang::XServiceInfo >,
public SfxListener
{
friend class ::unogallery::GalleryItem;
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index 2400573197be..7878e906ecd7 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -25,6 +25,7 @@
#include <vcl/svapp.hxx>
#include <unotools/pathoptions.hxx>
#include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/gallery/XGalleryTheme.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -38,37 +39,22 @@ GalleryThemeProvider::GalleryThemeProvider() :
mpGallery = ::Gallery::GetGalleryInstance();
}
-// ------------------------------------------------------------------------------
-
GalleryThemeProvider::~GalleryThemeProvider()
{
}
-// ------------------------------------------------------------------------------
-
OUString SAL_CALL GalleryThemeProvider::getImplementationName()
throw( uno::RuntimeException )
{
return OUString( "com.sun.star.comp.gallery.GalleryThemeProvider" );
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL GalleryThemeProvider::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 GalleryThemeProvider::getSupportedServiceNames()
throw( uno::RuntimeException )
{
@@ -77,8 +63,6 @@ uno::Sequence< OUString > SAL_CALL GalleryThemeProvider::getSupportedServiceName
return aSeq;
}
-// ------------------------------------------------------------------------------
-
uno::Sequence< uno::Type > SAL_CALL GalleryThemeProvider::getTypes()
throw(uno::RuntimeException)
{
@@ -106,8 +90,6 @@ uno::Sequence< sal_Int8 > SAL_CALL GalleryThemeProvider::getImplementationId()
return theGalleryThemeProviderImplementationId::get().getSeq();
}
-// ------------------------------------------------------------------------------
-
void SAL_CALL GalleryThemeProvider::initialize( const uno::Sequence< uno::Any >& rArguments )
throw ( uno::Exception, uno::RuntimeException )
{