summaryrefslogtreecommitdiff
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
parentfd7b4908ead77c7f0fb8894cf78401468c5160a9 (diff)
use standard pattern for this
-rw-r--r--svx/source/accessibility/AccessibleShape.cxx26
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx1
-rw-r--r--svx/source/accessibility/svxrectctaccessiblecontext.cxx1
-rw-r--r--svx/source/fmcomp/fmgridif.cxx20
-rw-r--r--svx/source/fmcomp/gridcell.cxx20
-rw-r--r--svx/source/inc/charmapacc.hxx1
-rw-r--r--svx/source/svdraw/svdmodel.cxx20
-rw-r--r--svx/source/unodraw/unomod.cxx14
-rw-r--r--svx/source/unodraw/unopage.cxx1
-rw-r--r--svx/source/unodraw/unopool.cxx17
-rw-r--r--svx/source/unodraw/unoshap2.cxx55
-rw-r--r--svx/source/unodraw/unoshap3.cxx15
-rw-r--r--svx/source/unodraw/unoshape.cxx26
-rw-r--r--svx/source/unogallery/unogalitem.cxx18
-rw-r--r--svx/source/unogallery/unogaltheme.cxx18
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx18
16 files changed, 102 insertions, 169 deletions
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index 9db19e3cb067..6de9d83f1a0f 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -32,7 +32,6 @@
#include "svx/DescriptionGenerator.hxx"
#include <svx/AccessibleShapeInfo.hxx>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <rtl/uuid.h>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -59,6 +58,7 @@
#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <svx/svdview.hxx>
+#include <comphelper/servicehelper.hxx>
#include "AccessibleEmptyEditSource.hxx"
using namespace ::com::sun::star;
@@ -907,30 +907,18 @@ void SAL_CALL
}
}
-
-
-
//===== lang::XUnoTunnel ================================================
+namespace
+{
+ class theAccessibleShapeImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleShapeImplementationId > {};
+}
+
const uno::Sequence< sal_Int8 >&
AccessibleShape::getUnoTunnelImplementationId()
throw()
{
- static uno::Sequence< sal_Int8 >* pSeq = 0;
-
- if( !pSeq )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-
- if( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*) aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
-
- return( *pSeq );
+ return theAccessibleShapeImplementationId::get().getSeq();
}
//------------------------------------------------------------------------------
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 1e5b9b123b27..a98a404bf1df 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -39,7 +39,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
-#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <tools/gen.hxx>
#include <svl/smplhint.hxx>
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index c34702052013..0e65b6c31de8 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -42,7 +42,6 @@
#include <toolkit/helper/convert.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
-#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <tools/gen.hxx>
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 4cbed7d8fdba..c0b929bdf7c2 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -61,6 +61,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -1182,21 +1183,14 @@ FmXGridPeer::~FmXGridPeer()
delete m_pGridListener;
}
-//------------------------------------------------------------------------------
+namespace
+{
+ class theFmXGridPeerImplementationId : public rtl::Static< UnoTunnelIdInit, theFmXGridPeerImplementationId > {};
+}
+
const Sequence< sal_Int8 >& FmXGridPeer::getUnoTunnelImplementationId() throw()
{
- static Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theFmXGridPeerImplementationId::get().getSeq();
}
//------------------------------------------------------------------------------
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index e17b5afd9072..a713dc83a650 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -59,6 +59,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/numbers.hxx>
#include <comphelper/property.hxx>
+#include <comphelper/servicehelper.hxx>
#include <connectivity/formattedcolumnvalue.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <i18npool/lang.h>
@@ -4691,21 +4692,14 @@ sal_Int64 SAL_CALL FmXFilterCell::getSomething( const Sequence< sal_Int8 >& _rId
return nReturn;
}
-//------------------------------------------------------------------------------
+namespace
+{
+ class theFmXFilterCellUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theFmXFilterCellUnoTunnelId > {};
+}
+
const Sequence<sal_Int8>& FmXFilterCell::getUnoTunnelId()
{
- static Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theFmXFilterCellUnoTunnelId::get().getSeq();
}
//------------------------------------------------------------------------------
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index 8887eb98ffcc..0d47f4a149bd 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -30,7 +30,6 @@
#include <tools/color.hxx>
#include <tools/string.hxx>
#include <vcl/image.hxx>
-#include <rtl/uuid.h>
#include <comphelper/accessibleselectionhelper.hxx>
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 594f116ae545..f7a18f4f2d1d 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -31,7 +31,6 @@
#include <svx/svdmodel.hxx>
-#include <rtl/uuid.h>
#include <com/sun/star/lang/XComponent.hpp>
#include <osl/endian.h>
#include <rtl/logfile.hxx>
@@ -83,6 +82,7 @@
#include "editeng/forbiddencharacterstable.hxx"
#include <svl/zforlist.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
// #90477#
#include <tools/tenccvt.hxx>
@@ -2146,20 +2146,14 @@ void SdrModel::SetAllowShapePropertyChangeListener( bool bAllow )
}
}
+namespace
+{
+ class theSdrModelUnoTunnelImplementationId : public rtl::Static< UnoTunnelIdInit, theSdrModelUnoTunnelImplementationId > {};
+}
+
const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImplementationId()
{
- static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theSdrModelUnoTunnelImplementationId::get().getSeq();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index ac8e59655b31..d0e2475ac41f 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -38,6 +38,7 @@
#include <svl/itemprop.hxx>
#include <svtools/unoevent.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/serviceinfohelper.hxx>
#include <cppuhelper/implbase2.hxx>
@@ -302,15 +303,14 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoDrawingModel::getTypes( ) throw(uno::
return maTypeSequence;
}
+namespace
+{
+ class theSvxUnoDrawingModelImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoDrawingModelImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoDrawingModel::getImplementationId( ) throw(uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvxUnoDrawingModelImplementationId::get().getSeq();
}
void SAL_CALL SvxUnoDrawingModel::lockControllers( )
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 2131881456d6..2b0298b26b74 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -38,7 +38,6 @@
#include <sot/clsids.hxx>
#include <comphelper/serviceinfohelper.hxx>
-#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <sfx2/objsh.hxx>
#include <svx/svdpool.hxx>
diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index 8ca49e90eb7d..74e2235b1b8f 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/beans/PropertyState.hpp>
#include <comphelper/propertysetinfo.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "svx/unopool.hxx"
@@ -387,18 +387,15 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoDrawPool::getTypes()
return aTypes;
}
+namespace
+{
+ class theSvxUnoDrawPoolImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoDrawPoolImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoDrawPool::getImplementationId()
throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
-
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvxUnoDrawPoolImplementationId::get().getSeq();
}
// XServiceInfo
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 2f72f92db5a0..b0e1ace320f0 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -49,7 +49,6 @@
#include <boost/scoped_ptr.hpp>
#include <svx/svdpool.hxx>
-#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <tools/urlobj.hxx>
@@ -73,6 +72,8 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <comphelper/servicehelper.hxx>
+
using ::rtl::OUString;
using namespace ::osl;
using namespace ::cppu;
@@ -152,16 +153,15 @@ uno::Sequence< uno::Type > SAL_CALL SvxShapeGroup::getTypes()
return SvxShape::getTypes();
}
+namespace
+{
+ class theSvxShapeGroupImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxShapeGroupImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SvxShapeGroup::getImplementationId()
throw (uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvxShapeGroupImplementationId::get().getSeq();
}
// ::com::sun::star::drawing::XShape
@@ -426,16 +426,15 @@ uno::Sequence< uno::Type > SAL_CALL SvxShapeConnector::getTypes()
return SvxShape::getTypes();
}
+namespace
+{
+ class theSvxShapeConnectorImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxShapeConnectorImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SvxShapeConnector::getImplementationId()
throw (uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvxShapeConnectorImplementationId::get().getSeq();
}
// ::com::sun::star::drawing::XShape
@@ -594,16 +593,15 @@ uno::Sequence< uno::Type > SAL_CALL SvxShapeControl::getTypes()
return SvxShape::getTypes();
}
+namespace
+{
+ class theSvxShapeControlImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxShapeControlImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SvxShapeControl::getImplementationId()
throw (uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvxShapeControlImplementationId::get().getSeq();
}
// ::com::sun::star::drawing::XShape
@@ -1939,16 +1937,15 @@ uno::Sequence< uno::Type > SAL_CALL SvxCustomShape::getTypes()
return SvxShapeText::getTypes();
}
+namespace
+{
+ class theSvxCustomShapeImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxCustomShapeImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SvxCustomShape::getImplementationId()
throw (uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvxCustomShapeImplementationId::get().getSeq();
}
// ::com::sun::star::drawing::XShape
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 32d37e1df90d..f56f870c006b 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -37,9 +37,9 @@
#include <com/sun/star/drawing/CameraGeometry.hpp>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/serviceinfohelper.hxx>
-#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <svx/svdpool.hxx>
#include <svx/unoshape.hxx>
@@ -135,16 +135,15 @@ uno::Sequence< uno::Type > SAL_CALL Svx3DSceneObject::getTypes()
return SvxShape::getTypes();
}
+namespace
+{
+ class theSvx3DSceneObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSvx3DSceneObjectImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL Svx3DSceneObject::getImplementationId()
throw (uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
- {
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- }
- return aId;
+ return theSvx3DSceneObjectImplementationId::get().getSeq();
}
//----------------------------------------------------------------------
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 677ac702d8a3..82a2c0ea13ab 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -43,12 +43,12 @@
#include <svx/svdobj.hxx>
#include <svx/svdoole2.hxx>
#include <osl/mutex.hxx>
-#include <comphelper/extract.hxx>
#include "svx/shapepropertynotifier.hxx"
+#include <comphelper/extract.hxx>
+#include <comphelper/scopeguard.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/serviceinfohelper.hxx>
#include <toolkit/unohlp.hxx>
-#include <comphelper/serviceinfohelper.hxx>
-#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <vcl/gfxlink.hxx>
#include <vcl/virdev.hxx>
@@ -106,7 +106,6 @@
#include "svx/extrud3d.hxx"
#include "unopolyhelper.hxx"
-#include <comphelper/scopeguard.hxx>
#include <boost/bind.hpp>
using ::rtl::OUString;
@@ -341,21 +340,14 @@ uno::Any SAL_CALL SvxShape::queryAggregation( const uno::Type& rType ) throw (un
return SvxShape_UnoImplHelper::queryAggregation(rType);
}
-//----------------------------------------------------------------------
+namespace
+{
+ class theSvxShapeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvxShapeUnoTunnelId > {};
+}
+
const ::com::sun::star::uno::Sequence< sal_Int8 > & SvxShape::getUnoTunnelId() throw()
{
- static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theSvxShapeUnoTunnelId::get().getSeq();
}
//----------------------------------------------------------------------
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();
}
// ------------------------------------------------------------------------------