summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2014-01-14 13:05:02 -0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-16 10:26:03 +0100
commitccf47bd943bf8d09e60fd3310ba31d550e744765 (patch)
tree7cc54d98b14a79a96cddf82da52d00d75da9d53c /canvas
parenta2218b0d8b39e5018342b9085a3ec98941631952 (diff)
fdo#54938: Convert canvas to cppu::supportsService
Final part Change-Id: I5ff8e4aacf7be7c0cb1eab520f01cc312143641e
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_canvasbitmap.cxx10
-rw-r--r--canvas/source/cairo/cairo_canvascustomsprite.cxx10
-rw-r--r--canvas/source/cairo/cairo_canvasfont.cxx10
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx10
-rw-r--r--canvas/source/directx/dx_canvasbitmap.cxx10
-rw-r--r--canvas/source/directx/dx_canvascustomsprite.cxx10
-rw-r--r--canvas/source/directx/dx_canvasfont.cxx9
-rw-r--r--canvas/source/directx/dx_textlayout.cxx12
-rw-r--r--canvas/source/factory/cf_service.cxx9
-rw-r--r--canvas/source/tools/cachedprimitivebase.cxx10
-rw-r--r--canvas/source/tools/parametricpolypolygon.cxx10
-rw-r--r--canvas/source/vcl/canvasbitmap.cxx10
-rw-r--r--canvas/source/vcl/canvascustomsprite.cxx10
-rw-r--r--canvas/source/vcl/canvasfont.cxx10
-rw-r--r--canvas/source/vcl/textlayout.cxx11
15 files changed, 57 insertions, 94 deletions
diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx
index 277c1333f4c9..380499f2944d 100644
--- a/canvas/source/cairo/cairo_canvasbitmap.cxx
+++ b/canvas/source/cairo/cairo_canvasbitmap.cxx
@@ -19,6 +19,7 @@
#include <canvas/debug.hxx>
#include <canvas/canvastools.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include "cairo_canvasbitmap.hxx"
@@ -259,23 +260,20 @@ namespace cairocanvas
return aRV;
}
-#define IMPLEMENTATION_NAME "CairoCanvas.CanvasBitmap"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap"
-
OUString SAL_CALL CanvasBitmap::getImplementationName( ) throw (uno::RuntimeException)
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "CairoCanvas.CanvasBitmap" );
}
sal_Bool SAL_CALL CanvasBitmap::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasBitmap::getSupportedServiceNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CanvasBitmap";
return aRet;
}
diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx
index e0c59b77a9b8..b772406137b9 100644
--- a/canvas/source/cairo/cairo_canvascustomsprite.cxx
+++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx
@@ -19,6 +19,7 @@
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include <rtl/math.hxx>
@@ -138,23 +139,20 @@ namespace cairocanvas
return mpSpriteCanvas->getOutputDevice();
}
-#define IMPLEMENTATION_NAME "CairoCanvas.CanvasCustomSprite"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite"
-
OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "CairoCanvas.CanvasCustomSprite" );
}
sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CanvasCustomSprite";
return aRet;
}
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index 4c627f7276bf..7a1a78e7a240 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -20,6 +20,7 @@
#include <canvas/debug.hxx>
#include <com/sun/star/rendering/PanoseProportion.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <rtl/math.hxx>
#include <basegfx/numeric/ftools.hxx>
@@ -138,23 +139,20 @@ namespace cairocanvas
return uno::Sequence< beans::PropertyValue >();
}
-#define IMPLEMENTATION_NAME "CairoCanvas::CanvasFont"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
-
OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "CairoCanvas::CanvasFont" );
}
sal_Bool SAL_CALL CanvasFont::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CanvasFont";
return aRet;
}
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 35defcd9080b..3477c1bcf220 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -21,6 +21,7 @@
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/metric.hxx>
@@ -631,23 +632,20 @@ namespace cairocanvas
OffsetTransformer( aMatrix ) );
}
-#define SERVICE_NAME "com.sun.star.rendering.TextLayout"
-#define IMPLEMENTATION_NAME "CairoCanvas::TextLayout"
-
OUString SAL_CALL TextLayout::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "CairoCanvas::TextLayout" );
}
sal_Bool SAL_CALL TextLayout::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL TextLayout::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = OUString( SERVICE_NAME );
+ aRet[0] = "com.sun.star.rendering.TextLayout";
return aRet;
}
diff --git a/canvas/source/directx/dx_canvasbitmap.cxx b/canvas/source/directx/dx_canvasbitmap.cxx
index 1527896aee45..2d14d3f3e75f 100644
--- a/canvas/source/directx/dx_canvasbitmap.cxx
+++ b/canvas/source/directx/dx_canvasbitmap.cxx
@@ -21,6 +21,7 @@
#include <ctype.h>
#include <canvas/debug.hxx>
#include <canvas/canvastools.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/bitmapex.hxx>
@@ -243,23 +244,20 @@ namespace dxcanvas
return aRes;
}
-#define IMPLEMENTATION_NAME "DXCanvas.CanvasBitmap"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap"
-
OUString SAL_CALL CanvasBitmap::getImplementationName( ) throw (uno::RuntimeException)
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "DXCanvas.CanvasBitmap" );
}
sal_Bool SAL_CALL CanvasBitmap::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasBitmap::getSupportedServiceNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CanvasBitmap";
return aRet;
}
diff --git a/canvas/source/directx/dx_canvascustomsprite.cxx b/canvas/source/directx/dx_canvascustomsprite.cxx
index 3aac160064e0..1be4db519080 100644
--- a/canvas/source/directx/dx_canvascustomsprite.cxx
+++ b/canvas/source/directx/dx_canvascustomsprite.cxx
@@ -21,6 +21,7 @@
#include <ctype.h>
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include <rtl/math.hxx>
@@ -82,23 +83,20 @@ namespace dxcanvas
CanvasCustomSpriteBaseT::disposeThis();
}
-#define IMPLEMENTATION_NAME "DXCanvas.CanvasCustomSprite"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite"
-
OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "DXCanvas.CanvasCustomSprite" );
}
sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CanvasCustomSprite";
return aRet;
}
diff --git a/canvas/source/directx/dx_canvasfont.cxx b/canvas/source/directx/dx_canvasfont.cxx
index 3d0d564cc479..9362cac4fda4 100644
--- a/canvas/source/directx/dx_canvasfont.cxx
+++ b/canvas/source/directx/dx_canvasfont.cxx
@@ -119,23 +119,20 @@ namespace dxcanvas
return rendering::FontMetrics();
}
-#define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
-#define IMPLEMENTATION_NAME "DXCanvas::CanvasFont"
-
OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "DXCanvas::CanvasFont" );
}
sal_Bool SAL_CALL CanvasFont::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CanvasFont";
return aRet;
}
diff --git a/canvas/source/directx/dx_textlayout.cxx b/canvas/source/directx/dx_textlayout.cxx
index 4909b0161861..6ac0d70a888d 100644
--- a/canvas/source/directx/dx_textlayout.cxx
+++ b/canvas/source/directx/dx_textlayout.cxx
@@ -21,6 +21,7 @@
#include <ctype.h>
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
@@ -29,7 +30,6 @@
#include "dx_spritecanvas.hxx"
#include "dx_textlayout_drawhelper.hxx"
-
using namespace ::com::sun::star;
namespace dxcanvas
@@ -246,24 +246,20 @@ namespace dxcanvas
return true;
}
-
-#define SERVICE_NAME "com.sun.star.rendering.TextLayout"
-#define IMPLEMENTATION_NAME "DXCanvas::TextLayout"
-
OUString SAL_CALL TextLayout::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "DXCanvas::TextLayout" );
}
sal_Bool SAL_CALL TextLayout::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL TextLayout::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.TextLayout";
return aRet;
}
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index 441ec1545c03..60306f6f3988 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -23,6 +23,7 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -59,7 +60,6 @@ Sequence<OUString> SAL_CALL getSuppServices()
return Sequence<OUString>(&name, 1);
}
-//==============================================================================
class CanvasFactory
: public ::cppu::WeakImplHelper3< lang::XServiceInfo,
lang::XMultiComponentFactory,
@@ -226,20 +226,17 @@ Reference<XInterface> create( Reference<XComponentContext> const & xContext )
}
// XServiceInfo
-//______________________________________________________________________________
OUString CanvasFactory::getImplementationName() throw (RuntimeException)
{
return getImplName();
}
-//______________________________________________________________________________
sal_Bool CanvasFactory::supportsService( OUString const & serviceName )
throw (RuntimeException)
{
- return serviceName.equals(getSuppServices()[0]);
+ return cppu::supportsService(this, serviceName);
}
-//______________________________________________________________________________
Sequence<OUString> CanvasFactory::getSupportedServiceNames()
throw (RuntimeException)
{
@@ -247,7 +244,6 @@ Sequence<OUString> CanvasFactory::getSupportedServiceNames()
}
// XMultiComponentFactory
-//______________________________________________________________________________
Sequence<OUString> CanvasFactory::getAvailableServiceNames()
throw (RuntimeException)
{
@@ -259,7 +255,6 @@ Sequence<OUString> CanvasFactory::getAvailableServiceNames()
return aServiceNames;
}
-//______________________________________________________________________________
Reference<XInterface> CanvasFactory::createInstanceWithContext(
OUString const & name, Reference<XComponentContext> const & xContext )
throw (Exception)
diff --git a/canvas/source/tools/cachedprimitivebase.cxx b/canvas/source/tools/cachedprimitivebase.cxx
index 63a62b52c2c4..89067e12db02 100644
--- a/canvas/source/tools/cachedprimitivebase.cxx
+++ b/canvas/source/tools/cachedprimitivebase.cxx
@@ -22,15 +22,13 @@
#include <canvas/base/cachedprimitivebase.hxx>
#include <com/sun/star/rendering/RepaintResult.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/tools/canvastools.hxx>
using namespace ::com::sun::star;
-#define IMPLEMENTATION_NAME "canvas::CachedPrimitiveBase"
-#define SERVICE_NAME "com.sun.star.rendering.CachedBitmap"
-
namespace canvas
{
CachedPrimitiveBase::CachedPrimitiveBase( const rendering::ViewState& rUsedViewState,
@@ -83,18 +81,18 @@ namespace canvas
OUString SAL_CALL CachedPrimitiveBase::getImplementationName( ) throw (uno::RuntimeException)
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString("canvas::CachedPrimitiveBase");
}
sal_Bool SAL_CALL CachedPrimitiveBase::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL CachedPrimitiveBase::getSupportedServiceNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.CachedBitmap";
return aRet;
}
diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx
index 11ca7ed0b59c..67b15d6952bd 100644
--- a/canvas/source/tools/parametricpolypolygon.cxx
+++ b/canvas/source/tools/parametricpolypolygon.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <canvas/debug.hxx>
#include <canvas/canvastools.hxx>
@@ -30,6 +29,7 @@
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/tools/tools.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <limits>
@@ -199,23 +199,21 @@ namespace canvas
return mxDevice.is() ? mxDevice->getDeviceColorSpace() : uno::Reference< rendering::XColorSpace >();
}
-#define IMPLEMENTATION_NAME "Canvas::ParametricPolyPolygon"
-#define SERVICE_NAME "com.sun.star.rendering.ParametricPolyPolygon"
OUString SAL_CALL ParametricPolyPolygon::getImplementationName( ) throw (uno::RuntimeException)
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "Canvas::ParametricPolyPolygon" );
}
sal_Bool SAL_CALL ParametricPolyPolygon::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL ParametricPolyPolygon::getSupportedServiceNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = SERVICE_NAME;
+ aRet[0] = "com.sun.star.rendering.ParametricPolyPolygon";
return aRet;
}
diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx
index a469e448ed41..0585fa7e1af7 100644
--- a/canvas/source/vcl/canvasbitmap.cxx
+++ b/canvas/source/vcl/canvasbitmap.cxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <canvas/debug.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include "canvasbitmap.hxx"
@@ -71,23 +71,21 @@ namespace vclcanvas
maCanvasHelper.init( rBitmap, rDevice, rOutDevProvider );
}
-#define IMPLEMENTATION_NAME "VCLCanvas.CanvasBitmap"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap"
OUString SAL_CALL CanvasBitmap::getImplementationName( ) throw (uno::RuntimeException)
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "VCLCanvas.CanvasBitmap" );
}
sal_Bool SAL_CALL CanvasBitmap::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasBitmap::getSupportedServiceNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = OUString( SERVICE_NAME );
+ aRet[0] = "com.sun.star.rendering.CanvasBitmap";
return aRet;
}
diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx
index 9dead83713de..98339506642d 100644
--- a/canvas/source/vcl/canvascustomsprite.cxx
+++ b/canvas/source/vcl/canvascustomsprite.cxx
@@ -21,6 +21,7 @@
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/verbosetrace.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <rtl/math.hxx>
@@ -117,23 +118,20 @@ namespace vclcanvas
maCanvasHelper.clear();
}
-#define IMPLEMENTATION_NAME "VCLCanvas.CanvasCustomSprite"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite"
-
OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "VCLCanvas.CanvasCustomSprite" );
}
sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = OUString( SERVICE_NAME );
+ aRet[0] = "com.sun.star.rendering.CanvasCustomSprite";
return aRet;
}
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 783ace10ff64..6229072c2925 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -26,6 +26,7 @@
#include <vcl/metric.hxx>
#include <com/sun/star/rendering/PanoseProportion.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include "canvasfont.hxx"
#include "textlayout.hxx"
@@ -150,23 +151,20 @@ namespace vclcanvas
return uno::Sequence< beans::PropertyValue >();
}
-#define IMPLEMENTATION_NAME "VCLCanvas::CanvasFont"
-#define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
-
OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "VCLCanvas::CanvasFont" );
}
sal_Bool SAL_CALL CanvasFont::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = OUString( SERVICE_NAME );
+ aRet[0] = "com.sun.star.rendering.CanvasFont";
return aRet;
}
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index 29134850e9fc..1ef4fa6176d6 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/TextDirection.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <vcl/metric.hxx>
#include <vcl/virdev.hxx>
@@ -461,24 +462,20 @@ namespace vclcanvas
OffsetTransformer( aMatrix ) );
}
-
-#define IMPLEMENTATION_NAME "VCLCanvas::TextLayout"
-#define SERVICE_NAME "com.sun.star.rendering.TextLayout"
-
OUString SAL_CALL TextLayout::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( IMPLEMENTATION_NAME );
+ return OUString( "VCLCanvas::TextLayout" );
}
sal_Bool SAL_CALL TextLayout::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
- return ServiceName == SERVICE_NAME;
+ return cppu::supportsService( this, ServiceName );
}
uno::Sequence< OUString > SAL_CALL TextLayout::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
- aRet[0] = OUString( SERVICE_NAME );
+ aRet[0] = "com.sun.star.rendering.TextLayout";
return aRet;
}