summaryrefslogtreecommitdiff
path: root/xmloff/source/transform
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-05-31 22:55:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 15:21:18 +0100
commit6ae5667c07ae7047ce47e8f9fba5ea3e5f569286 (patch)
tree6498d230b3a8ea49b6e92e10bd2ddb20d1b74846 /xmloff/source/transform
parentd322f8701aa8eb9ba69385d1cbcd4435a2d2b297 (diff)
use this pattern throughout
Diffstat (limited to 'xmloff/source/transform')
-rw-r--r--xmloff/source/transform/MutableAttrList.cxx19
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx14
-rw-r--r--xmloff/source/transform/Oasis2OOo.cxx13
3 files changed, 14 insertions, 32 deletions
diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx
index 94606585fdd9..202b9cf84304 100644
--- a/xmloff/source/transform/MutableAttrList.cxx
+++ b/xmloff/source/transform/MutableAttrList.cxx
@@ -30,9 +30,9 @@
#include "precompiled_xmloff.hxx"
#include <osl/mutex.hxx>
#include <xmloff/xmltoken.hxx>
-#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <xmloff/attrlist.hxx>
+#include <comphelper/servicehelper.hxx>
#include "MutableAttrList.hxx"
using ::rtl::OUString;
@@ -74,22 +74,15 @@ XMLMutableAttributeList::~XMLMutableAttributeList()
m_xAttrList = 0;
}
+namespace
+{
+ class theXMLMutableAttributeListUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theXMLMutableAttributeListUnoTunnelId> {};
+}
// XUnoTunnel & co
const Sequence< sal_Int8 > & XMLMutableAttributeList::getUnoTunnelId() throw()
{
- static Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theXMLMutableAttributeListUnoTunnelId::get().getSeq();
}
// XUnoTunnel
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 2df52defcf0c..f94794ef4831 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
-#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
@@ -1996,20 +1996,14 @@ void SAL_CALL OOo2OasisTransformer::Initialize(
}
}
-
-Sequence< sal_Int8 > static CreateUnoTunnelId()
+namespace
{
- static osl::Mutex aCreateMutex;
- ::osl::Guard<osl::Mutex> aGuard( aCreateMutex );
- Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- return aSeq;
+ class theOOo2OasisTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOOo2OasisTransformerUnoTunnelId> {};
}
const Sequence< sal_Int8 > & OOo2OasisTransformer::getUnoTunnelId() throw()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theOOo2OasisTransformerUnoTunnelId::get().getSeq();
}
// XUnoTunnel
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index e4788a7ecaf2..90765e472ca5 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
#include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx"
@@ -52,6 +51,7 @@
#include "TransformerActions.hxx"
#include "FamilyType.hxx"
#include <xmloff/xmluconv.hxx>
+#include <comphelper/servicehelper.hxx>
#include "Oasis2OOo.hxx"
using ::rtl::OUString;
@@ -2005,19 +2005,14 @@ Oasis2OOoTransformer::~Oasis2OOoTransformer() throw()
XMLEventOASISTransformerContext::FlushEventMap( m_pFormEventMap );
}
-::com::sun::star::uno::Sequence< sal_Int8 > static CreateUnoTunnelId()
+namespace
{
- static osl::Mutex aCreateMutex;
- Guard<osl::Mutex> aGuard( aCreateMutex );
- Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- return aSeq;
+ class theOasis2OOoTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOasis2OOoTransformerUnoTunnelId> {};
}
const Sequence< sal_Int8 > & Oasis2OOoTransformer::getUnoTunnelId() throw()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theOasis2OOoTransformerUnoTunnelId::get().getSeq();
}
// XUnoTunnel