summaryrefslogtreecommitdiff
path: root/svtools/source/graphic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-01 10:02:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 15:21:54 +0100
commitd248451ca3e7599145103be6c79c2b78699f12c9 (patch)
treedf3ee19a784c41344297c569d56dd851d1652de0 /svtools/source/graphic
parentd3050b7e9ff741dec96f374a71f33774f32274b1 (diff)
use tunnel pattern here
Diffstat (limited to 'svtools/source/graphic')
-rw-r--r--svtools/source/graphic/descriptor.cxx18
-rw-r--r--svtools/source/graphic/graphic.cxx18
-rw-r--r--svtools/source/graphic/provider.cxx18
-rw-r--r--svtools/source/graphic/renderer.cxx18
-rw-r--r--svtools/source/graphic/transformer.cxx1
5 files changed, 25 insertions, 48 deletions
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index 623c698bcae8..d76b50b54a01 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -31,11 +31,11 @@
#include "descriptor.hxx"
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <svtools/filter.hxx>
#include <svl/itemprop.hxx>
+#include <comphelper/servicehelper.hxx>
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -305,21 +305,15 @@ uno::Sequence< uno::Type > SAL_CALL GraphicDescriptor::getTypes()
return aTypes;
}
-// ------------------------------------------------------------------------------
+namespace
+{
+ class theGraphicDescriptorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theGraphicDescriptorUnoTunnelId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL GraphicDescriptor::getImplementationId()
throw( uno::RuntimeException )
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId;
-
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aId.getArray() ), 0, sal_True );
- }
-
- return aId;
+ return theGraphicDescriptorUnoTunnelId::get().getSeq();
}
// ------------------------------------------------------------------------------
diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx
index 19c8d904b3d9..cf212d9d8fce 100644
--- a/svtools/source/graphic/graphic.cxx
+++ b/svtools/source/graphic/graphic.cxx
@@ -29,13 +29,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/graphic/GraphicType.hpp>
#include <com/sun/star/graphic/XGraphicTransformer.hpp>
#include <vcl/graph.hxx>
#include "graphic.hxx"
+#include <comphelper/servicehelper.hxx>
using namespace com::sun::star;
@@ -114,19 +114,15 @@ void SAL_CALL Graphic::release() throw()
// ------------------------------------------------------------------------------
+namespace
+{
+ class theGraphicUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theGraphicUnoTunnelId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL Graphic::getImplementationId_Static()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId;
-
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aId.getArray() ), 0, sal_True );
- }
-
- return aId;
+ return theGraphicUnoTunnelId::get().getSeq();
}
// ------------------------------------------------------------------------------
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index b08c1eab2035..a8785a5381b1 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/image.hxx>
@@ -46,6 +45,7 @@
#include <vcl/virdev.hxx>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
+#include <comphelper/servicehelper.hxx>
#include "descriptor.hxx"
#include "graphic.hxx"
@@ -143,21 +143,15 @@ uno::Sequence< uno::Type > SAL_CALL GraphicProvider::getTypes()
return aTypes;
}
-// ------------------------------------------------------------------------------
+namespace
+{
+ class theGraphicProviderUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theGraphicProviderUnoTunnelId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL GraphicProvider::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId;
-
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aId.getArray() ), 0, sal_True );
- }
-
- return aId;
+ return theGraphicProviderUnoTunnelId::get().getSeq();
}
// ------------------------------------------------------------------------------
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index d955fca30cac..ef6385c1298c 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -32,13 +32,13 @@
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <svl/itemprop.hxx>
#include <svtools/grfmgr.hxx>
+#include <comphelper/servicehelper.hxx>
#include "graphic.hxx"
#include "renderer.hxx"
@@ -192,21 +192,15 @@ uno::Sequence< uno::Type > SAL_CALL GraphicRendererVCL::getTypes()
return aTypes;
}
-// ------------------------------------------------------------------------------
+namespace
+{
+ class theGraphicRendererVCLUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theGraphicRendererVCLUnoTunnelId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL GraphicRendererVCL::getImplementationId()
throw( uno::RuntimeException )
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId;
-
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aId.getArray() ), 0, sal_True );
- }
-
- return aId;
+ return theGraphicRendererVCLUnoTunnelId::get().getSeq();
}
// ------------------------------------------------------------------------------
diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx
index 3a0d3c8e2fd4..03c470d2ac69 100644
--- a/svtools/source/graphic/transformer.cxx
+++ b/svtools/source/graphic/transformer.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/image.hxx>