summaryrefslogtreecommitdiff
path: root/svx/source/unogallery
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-05 16:18:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-07 08:58:49 +0100
commitdc7daa5e9b5fb3b7db31b272fac977d747fbbf6d (patch)
tree667968b48f01d51c56cdfa72075827c8cbe3ab70 /svx/source/unogallery
parentfd7b4908ead77c7f0fb8894cf78401468c5160a9 (diff)
use standard pattern for this
Diffstat (limited to 'svx/source/unogallery')
-rw-r--r--svx/source/unogallery/unogalitem.cxx18
-rw-r--r--svx/source/unogallery/unogaltheme.cxx18
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx18
3 files changed, 18 insertions, 36 deletions
diff --git a/svx/source/unogallery/unogalitem.cxx b/svx/source/unogallery/unogalitem.cxx
index a802f504e437..2e9da27b76ab 100644
--- a/svx/source/unogallery/unogalitem.cxx
+++ b/svx/source/unogallery/unogalitem.cxx
@@ -34,12 +34,12 @@
#include "svx/galtheme.hxx"
#include "svx/galmisc.hxx"
#include <svx/fmmodel.hxx>
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/graph.hxx>
#include <svl/itemprop.hxx>
#include <svl/itempool.hxx>
+#include <comphelper/servicehelper.hxx>
#include "galobj.hxx"
#include <com/sun/star/beans/PropertyState.hpp>
@@ -203,21 +203,15 @@ uno::Sequence< uno::Type > SAL_CALL GalleryItem::getTypes()
return aTypes;
}
-// ------------------------------------------------------------------------------
+namespace
+{
+ class theGalleryItemImplementationId : public rtl::Static< UnoTunnelIdInit, theGalleryItemImplementationId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL GalleryItem::getImplementationId()
throw(uno::RuntimeException)
{
- const 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 theGalleryItemImplementationId::get().getSeq();
}
// ------------------------------------------------------------------------------
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index 34deddca08de..673a99041241 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -40,10 +40,10 @@
#include <svx/svdpage.hxx>
#include <svx/unopage.hxx>
#include <svl/itempool.hxx>
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unotools/pathoptions.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -149,21 +149,15 @@ uno::Sequence< uno::Type > SAL_CALL GalleryTheme::getTypes()
return aTypes;
}
-// ------------------------------------------------------------------------------
+namespace
+{
+ class theGalleryThemeImplementationId : public rtl::Static< UnoTunnelIdInit, theGalleryThemeImplementationId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL GalleryTheme::getImplementationId()
throw(uno::RuntimeException)
{
- const 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 theGalleryThemeImplementationId::get().getSeq();
}
// ------------------------------------------------------------------------------
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index 3e21addcaa7a..d5cd542c6c1f 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -32,10 +32,10 @@
#include "unogalthemeprovider.hxx"
#include "unogaltheme.hxx"
#include "svx/gallery1.hxx"
-#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unotools/pathoptions.hxx>
+#include <comphelper/servicehelper.hxx>
#include <com/sun/star/gallery/XGalleryTheme.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -155,21 +155,15 @@ uno::Sequence< uno::Type > SAL_CALL GalleryThemeProvider::getTypes()
return aTypes;
}
-// ------------------------------------------------------------------------------
+namespace
+{
+ class theGalleryThemeProviderImplementationId : public rtl::Static< UnoTunnelIdInit, theGalleryThemeProviderImplementationId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL GalleryThemeProvider::getImplementationId()
throw(uno::RuntimeException)
{
- const 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 theGalleryThemeProviderImplementationId::get().getSeq();
}
// ------------------------------------------------------------------------------