summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-01 22:40:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 22:40:08 +0100
commit2e846d734bf3965c4104a5baab35a8fa524d42a2 (patch)
treeac2411e81412804dbe51147280db12ddff3d8999
parent52388d29994a52f3dea83dbf214e81f9abfc11dc (diff)
use uuid template here instead of hand-rolled ones
-rw-r--r--sw/inc/unobaseclass.hxx3
-rw-r--r--sw/source/core/access/acccell.cxx20
-rw-r--r--sw/source/core/access/accdoc.cxx16
-rw-r--r--sw/source/core/access/accembedded.cxx16
-rw-r--r--sw/source/core/access/accfootnote.cxx17
-rw-r--r--sw/source/core/access/accgraphic.cxx17
-rw-r--r--sw/source/core/access/accheaderfooter.cxx17
-rw-r--r--sw/source/core/access/accpage.cxx17
-rw-r--r--sw/source/core/access/accpara.cxx16
-rw-r--r--sw/source/core/access/accpreview.cxx17
-rw-r--r--sw/source/core/access/acctable.cxx17
-rw-r--r--sw/source/core/access/acctextframe.cxx17
-rw-r--r--sw/source/core/unocore/TextCursorHelper.cxx10
-rw-r--r--sw/source/core/unocore/unobkm.cxx9
-rw-r--r--sw/source/core/unocore/unochart.cxx10
-rw-r--r--sw/source/core/unocore/unodraw.cxx9
-rw-r--r--sw/source/core/unocore/unofield.cxx17
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx24
-rwxr-xr-xsw/source/core/unocore/unoframe.cxx57
-rw-r--r--sw/source/core/unocore/unoftn.cxx26
-rw-r--r--sw/source/core/unocore/unoidx.cxx17
-rw-r--r--sw/source/core/unocore/unoobj.cxx21
-rw-r--r--sw/source/core/unocore/unoobj2.cxx17
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx9
-rw-r--r--sw/source/core/unocore/unoport.cxx9
-rw-r--r--sw/source/core/unocore/unoportenum.cxx13
-rw-r--r--sw/source/core/unocore/unoredline.cxx46
-rw-r--r--sw/source/core/unocore/unorefmk.cxx17
-rw-r--r--sw/source/core/unocore/unosect.cxx9
-rw-r--r--sw/source/core/unocore/unosett.cxx17
-rw-r--r--sw/source/core/unocore/unosrch.cxx9
-rw-r--r--sw/source/core/unocore/unostyle.cxx10
-rw-r--r--sw/source/core/unocore/unotbl.cxx40
-rw-r--r--sw/source/core/unocore/unotext.cxx41
-rw-r--r--sw/source/filter/xml/xmlexp.cxx9
-rw-r--r--sw/source/filter/xml/xmlimp.cxx9
-rwxr-xr-xsw/source/ui/dochdl/swdtflvr.cxx16
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx16
-rw-r--r--sw/source/ui/uno/unoatxt.cxx19
-rw-r--r--sw/source/ui/uno/unodispatch.cxx10
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx12
-rw-r--r--sw/source/ui/uno/unotxvw.cxx24
42 files changed, 401 insertions, 341 deletions
diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index f04bb1adb04d..94cbf571eeda 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -91,9 +91,6 @@ class UnoActionRemoveContext
~UnoActionRemoveContext();
};
-
-::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId();
-
/// helper function for implementing SwClient::Modify
void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew);
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index 18e8d4a0077b..83c61cf31801 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <cellfrm.hxx>
#include <tabfrm.hxx>
@@ -49,10 +49,7 @@
#include "accmap.hxx"
#include <acccell.hxx>
-#ifndef _STLP_CFLOAT
#include <cfloat>
-#endif
-
#include <limits.h>
using namespace ::com::sun::star;
@@ -306,18 +303,15 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleCell::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwAccessibleCellImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleCellImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleCellImplementationId::get().getSeq();
}
// ===== XAccessibleValue ===============================================
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 0ba86ff7abd5..65796b04f995 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -41,6 +41,7 @@
#include <sfx2/viewsh.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include <viewsh.hxx>
#include <doc.hxx>
#include <accmap.hxx>
@@ -444,18 +445,15 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwAccessibleDocumentImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleDocumentImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleDocument::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleDocumentImplementationId::get().getSeq();
}
//===== XAccessibleSelection ============================================
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index 5ccbc03f3339..fc673f1624d9 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -33,7 +33,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <flyfrm.hxx>
#include "accembedded.hxx"
@@ -82,19 +82,15 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServi
return aRet;
}
+namespace
+{
+ class theSwAccessibleEmbeddedObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleEmbeddedObjectImplementationId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleEmbeddedObjectImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index 2efd6cf6d78f..e01d65c1bbd8 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <ftnfrm.hxx>
#include <fmtftn.hxx>
@@ -135,18 +135,15 @@ Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()
return aRet;
}
+namespace
+{
+ class theSwAccessibleFootnoteImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleFootnoteImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessibleFootnote::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleFootnoteImplementationId::get().getSeq();
}
sal_Bool SwAccessibleFootnote::IsEndnote( const SwFtnFrm *pFtnFrm )
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index 4c389e2f85c1..b1243d93af8d 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -33,7 +33,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <flyfrm.hxx>
#include "accgraphic.hxx"
@@ -83,18 +83,15 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
return aRet;
}
+namespace
+{
+ class theSwAccessibleGraphicImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleGraphicImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleGraphicImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index 6472f75e9fe5..a0d151250f9d 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <hffrm.hxx>
#include "accheaderfooter.hxx"
@@ -129,18 +129,15 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames
return aRet;
}
+namespace
+{
+ class theSwAccessibleHeaderFooterImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleHeaderFooterImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleHeaderFooterImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index b88844942001..e16b646382a4 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -30,12 +30,12 @@
#include "precompiled_sw.hxx"
-#include <rtl/uuid.h>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <comphelper/servicehelper.hxx>
#include "accpage.hxx"
#include "access.hrc"
@@ -175,18 +175,15 @@ Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )
return aRet;
}
+namespace
+{
+ class theSwAccessiblePageImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessiblePageImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessiblePage::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessiblePageImplementationId::get().getSeq();
}
OUString SwAccessiblePage::getAccessibleDescription( )
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index a9db42e27c25..e8ec678fe861 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -82,6 +82,7 @@
#include <parachangetrackinginfo.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
#include <comphelper/stlunosequence.hxx> // #i92233#
+#include <comphelper/servicehelper.hxx>
#include <algorithm>
@@ -1085,18 +1086,15 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleParagraph::getTypes() throw(uno:
return aTypes;
}
+namespace
+{
+ class theSwAccessibleParagraphImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleParagraphImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleParagraph::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleParagraphImplementationId::get().getSeq();
}
diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx
index c656b4000d05..7a5e663f1faa 100644
--- a/sw/source/core/access/accpreview.cxx
+++ b/sw/source/core/access/accpreview.cxx
@@ -30,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <vcl/svapp.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include "access.hrc"
#include <accpreview.hxx>
@@ -80,18 +80,15 @@ Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
return aSeq;
}
+namespace
+{
+ class theSwAccessiblePreviewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessiblePreviewImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessiblePreviewImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 5d84ee2a4fde..f235de1a04c9 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <osl/mutex.hxx>
-#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
#include <list>
@@ -56,6 +55,7 @@
#include <acctable.hxx>
#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -827,18 +827,15 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleTable::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwAccessibleTableImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleTableImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleTableImplementationId::get().getSeq();
}
// #i77106#
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index d8190615ee7a..896faa8ea41c 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -30,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -205,18 +205,15 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNam
return aRet;
}
+namespace
+{
+ class theSwAccessibleTextFrameImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleTextFrameImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTextFrame::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleTextFrameImplementationId::get().getSeq();
}
diff --git a/sw/source/core/unocore/TextCursorHelper.cxx b/sw/source/core/unocore/TextCursorHelper.cxx
index e72abba9c992..64de82a63903 100644
--- a/sw/source/core/unocore/TextCursorHelper.cxx
+++ b/sw/source/core/unocore/TextCursorHelper.cxx
@@ -31,14 +31,18 @@
#include "TextCursorHelper.hxx"
#include "unobaseclass.hxx"
-
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
+namespace
+{
+ class theOTextCursorHelperUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOTextCursorHelperUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & OTextCursorHelper::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theOTextCursorHelperUnoTunnelId::get().getSeq();
}
//XUnoTunnel
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index fa3f3d9aaf68..aa92efdcf232 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -48,6 +48,7 @@
#include <SwRewriter.hxx>
#include <docsh.hxx>
#include <xmloff/odffields.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::sw::mark;
using namespace ::com::sun::star;
@@ -196,10 +197,14 @@ SwXBookmark::CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark & rBookmark)
return 0;
}
+namespace
+{
+ class theSwXBookmarkUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXBookmarkUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXBookmarkUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 89b980164ed2..253d412d4fd9 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -56,8 +56,8 @@
#include <ndole.hxx>
#include <swtypes.hxx>
#include <unocore.hrc>
-
#include <docary.hxx>
+#include <comphelper/servicehelper.hxx>
#define SN_DATA_PROVIDER "com.sun.star.chart2.data.DataProvider"
#define SN_DATA_SOURCE "com.sun.star.chart2.data.DataSource"
@@ -2035,10 +2035,14 @@ SwChartDataSequence::~SwChartDataSequence()
delete pTblCrsr;
}
+namespace
+{
+ class theSwChartDataSequenceUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwChartDataSequenceUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwChartDataSequence::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwChartDataSequenceUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_Int8 > &rId )
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 03ecacaadbb4..eab043ad200f 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -72,6 +72,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/stl_types.hxx>
#include <comphelper/makesequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <svx/scene3d.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -882,10 +883,14 @@ void SwXDrawPage::InvalidateSwDoc()
TYPEINIT1(SwXShape, SwClient);
+namespace
+{
+ class theSwXShapeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXShapeUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXShapeUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index f635fbd697d7..5ffd6f34854d 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -48,6 +48,7 @@
#include <viewsh.hxx>
#include <comphelper/types.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTimeRange.hpp>
#include <com/sun/star/util/DateTime.hpp>
@@ -396,10 +397,14 @@ sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
******************************************************************/
TYPEINIT1(SwXFieldMaster, SwClient);
+namespace
+{
+ class theSwXFieldMasterUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFieldMasterUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXFieldMasterUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -1066,10 +1071,14 @@ struct SwFieldProperties_Impl
TYPEINIT1(SwXTextField, SwClient);
+namespace
+{
+ class theSwXTextFieldUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextFieldUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextFieldUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 17538a119b35..55faa3d11c17 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -53,6 +53,7 @@
#include <pagedesc.hxx>
#include <IGrammarContact.hxx>
#include <viewopt.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -78,17 +79,14 @@ uno::Sequence< uno::Type > SwXFlatParagraph::getTypes( ) throw(uno::RuntimeExce
return aTypes;
}
+namespace
+{
+ class theSwXFlatParagraphImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXFlatParagraphImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SwXFlatParagraph::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXFlatParagraphImplementationId::get().getSeq();
}
uno::Any SAL_CALL SwXFlatParagraph::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
@@ -266,15 +264,17 @@ css::uno::Sequence< ::sal_Int32 > SAL_CALL SwXFlatParagraph::getLanguagePortions
return css::uno::Sequence< ::sal_Int32>();
}
+namespace
+{
+ class theSwXFlatParagraphUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFlatParagraphUnoTunnelId > {};
+}
const uno::Sequence< sal_Int8 >&
SwXFlatParagraph::getUnoTunnelId()
{
- static uno::Sequence<sal_Int8> aSeq(CreateUnoTunnelId());
- return aSeq;
+ return theSwXFlatParagraphUnoTunnelId::get().getSeq();
}
-
sal_Int64 SAL_CALL
SwXFlatParagraph::getSomething(
const uno::Sequence< sal_Int8 >& rId)
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 1b37a4933879..1225af12d2e6 100755
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -118,6 +118,7 @@
#include <fmtwrapinfluenceonobjpos.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <switerator.hxx>
+#include <comphelper/servicehelper.hxx>
// from fefly1.cxx
extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -701,13 +702,14 @@ bool SwOLEProperties_Impl::AnyToItemSet(
return sal_True;
}
-/******************************************************************
- * SwXFrame
- ******************************************************************/
+namespace
+{
+ class theSwXFrameUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFrameUnoTunnelId > {};
+}
+
const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXFrameUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId )
@@ -2442,17 +2444,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::Runtim
return aTextFrameTypes;
}
+namespace
+{
+ class theSwXTextFrameImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextFrameImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static bool bInit = false;
- if(!bInit)
- {
- rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
- bInit = true;
- }
- return aId;
+ return theSwXTextFrameImplementationId::get().getSeq();
}
uno::Reference< text::XText > SwXTextFrame::getText(void) throw( uno::RuntimeException )
@@ -2737,17 +2736,14 @@ uno::Sequence< uno::Type > SAL_CALL
return aGraphicTypes;
}
+namespace
+{
+ class theSwXTextGraphicObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextGraphicObjectImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static bool bInit = false;
- if(!bInit)
- {
- rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
- bInit = true;
- }
- return aId;
+ return theSwXTextGraphicObjectImplementationId::get().getSeq();
}
void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
@@ -2871,17 +2867,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(un
return aTextEmbeddedTypes;
}
+namespace
+{
+ class theSwXTextEmbeddedObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextEmbeddedObjectImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static bool bInit = false;
- if(!bInit)
- {
- rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
- bInit = true;
- }
- return aId;
+ return theSwXTextEmbeddedObjectImplementationId::get().getSeq();
}
void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 0b03ed177730..60f1f611597d 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -29,11 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <rtl/uuid.h>
-
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <unomid.h>
#include <unofootnote.hxx>
@@ -177,10 +176,14 @@ SwXFootnote::CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt)
: new SwXFootnote(rDoc, rFootnoteFmt);
}
+namespace
+{
+ class theSwXFootnoteUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFootnoteUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXFootnoteUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -236,18 +239,15 @@ SwXFootnote::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
+namespace
+{
+ class theSwXFootnoteImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXFootnoteImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL
SwXFootnote::getImplementationId() throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXFootnoteImplementationId::get().getSeq();
}
uno::Any SAL_CALL
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index e34d02e8a431..b4b6c4596852 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -65,6 +65,7 @@
#include <chpfld.hxx>
#include <SwStyleNameMapper.hxx>
#include <unoevtlstnr.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -434,10 +435,14 @@ SwXDocumentIndex::CreateXDocumentIndex(
return xIndex;
}
+namespace
+{
+ class theSwXDocumentIndexUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentIndexUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDocumentIndex::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDocumentIndexUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -1635,10 +1640,14 @@ SwXDocumentIndexMark::CreateXDocumentIndexMark(
return xTOXMark;
}
+namespace
+{
+ class theSwXDocumentIndexMarkUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentIndexMarkUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDocumentIndexMark::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDocumentIndexMarkUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 370707fb1ebc..cb904ab60a3f 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -124,6 +124,7 @@
#include <memory>
#include <unoparaframeenum.hxx>
#include <unoparagraph.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -131,18 +132,6 @@ using ::rtl::OUString;
using ::rtl::OUStringBuffer;
/****************************************************************************
- static methods
-****************************************************************************/
-uno::Sequence< sal_Int8 > CreateUnoTunnelId()
-{
- static osl::Mutex aCreateMutex;
- osl::Guard<osl::Mutex> aGuard( aCreateMutex );
- uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- return aSeq;
-}
-
-/****************************************************************************
Hilfsklassen
****************************************************************************/
SwUnoInternalPaM::SwUnoInternalPaM(SwDoc& rDoc) :
@@ -1009,10 +998,14 @@ SwXTextCursor::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextCursor, g_ServicesTextCursor);
}
+namespace
+{
+ class theSwXTextCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextCursorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextCursor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextCursorUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 45e09dd9961d..7e50a5067ce5 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -125,6 +125,7 @@
#include <iterator>
#include <boost/bind.hpp>
#include <switerator.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -898,10 +899,14 @@ throw (uno::RuntimeException)
}
}
+namespace
+{
+ class theSwXTextRangeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextRangeUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextRange::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextRangeUnoTunnelId::get().getSeq();
}
// XUnoTunnel
@@ -1621,10 +1626,14 @@ SwXTextRanges::~SwXTextRanges()
{
}
+namespace
+{
+ class theSwXTextRangesUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextRangesUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextRangesUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 5e24a7f6dad9..2143b1c57df4 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -272,10 +273,14 @@ bool SwXParagraph::SelectPaM(SwPaM & rPaM)
return true;
}
+namespace
+{
+ class theSwXParagraphUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXParagraphUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXParagraphUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index e95722ae26b3..1af9a9e9593f 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp>
#include <com/sun/star/beans/GetPropertyTolerantResult.hpp>
#include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -891,10 +892,14 @@ uno::Reference< container::XEnumeration > SwXTextPortion::createContentEnumerat
}
+namespace
+{
+ class theSwXTextPortionUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextPortionUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextPortion::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextPortionUnoTunnelId::get().getSeq();
}
sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 961c84a64a7b..73c54a902029 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -59,8 +59,8 @@
#include <crsskip.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include <set>
-
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#include <algorithm>
@@ -198,13 +198,14 @@ namespace
}
}
-/******************************************************************
- * SwXTextPortionEnumeration
- ******************************************************************/
+namespace
+{
+ class theSwXTextPortionEnumerationUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextPortionEnumerationUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextPortionEnumerationUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextPortionEnumeration::getSomething(
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index b78d59d25ca6..74f96b3d1101 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -35,6 +35,7 @@
#include <rtl/ustrbuf.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include <pagedesc.hxx>
#include "poolfmt.hxx"
@@ -105,18 +106,15 @@ uno::Sequence<uno::Type> SwXRedlineText::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwXRedlineTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXRedlineTextImplementationId> {};
+}
+
uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXRedlineTextImplementationId::get().getSeq();
}
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
@@ -302,17 +300,14 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
throw uno::RuntimeException();
}
+namespace
+{
+ class theSwXRedlinePortionImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXRedlinePortionImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXRedlinePortionImplementationId::get().getSeq();
}
uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw()
@@ -670,18 +665,15 @@ uno::Sequence<uno::Type> SwXRedline::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwXRedlineImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXRedlineImplementationId > {};
+}
+
uno::Sequence<sal_Int8> SwXRedline::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXRedlineImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 3e0b77e0f2ce..88321b587dc3 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -45,6 +45,7 @@
#include <fmtrfmrk.hxx>
#include <txtrfmrk.hxx>
#include <hints.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -153,10 +154,14 @@ SwXReferenceMark::CreateXReferenceMark(
: new SwXReferenceMark(&rDoc, &rMarkFmt);
}
+namespace
+{
+ class theSwXReferenceMarkUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXReferenceMarkUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXReferenceMarkUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -882,10 +887,14 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb)
return bForceExpandHints;
}
+namespace
+{
+ class theSwXMetaUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMetaUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXMeta::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq( ::CreateUnoTunnelId() );
- return aSeq;
+ return theSwXMetaUnoTunnelId::get().getSeq();
}
// XUnoTunnel
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 11b539ea5aff..9290344c4022 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -65,6 +65,7 @@
#include <editeng/frmdiritem.hxx>
#include <fmtcntnt.hxx>
#include <editeng/lrspitem.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -212,10 +213,14 @@ SwXTextSection::~SwXTextSection()
{
}
+namespace
+{
+ class theSwXTextSectionUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextSectionUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextSection::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextSectionUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 1f0f336b4c94..289810e2fa78 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -75,6 +75,7 @@
#include <com/sun/star/text/PositionAndSpaceMode.hpp>
#include <com/sun/star/text/LabelFollow.hpp>
#include <numrule.hxx>
+#include <comphelper/servicehelper.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -1132,10 +1133,14 @@ const String& SwXNumberingRules::GetInvalidStyle()
return sInvalidStyle;
}
+namespace
+{
+ class theSwXNumberingRulesUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXNumberingRulesUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXNumberingRules::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXNumberingRulesUnoTunnelId::get().getSeq();
}
// return implementation specific data
@@ -2614,10 +2619,14 @@ void SwXTextColumns::removeVetoableChangeListener(
{
}
+namespace
+{
+ class theSwXTextColumnsUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextColumnsUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextColumns::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextColumnsUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextColumns::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 79454750a9b1..ff9a574041d5 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -498,10 +499,14 @@ SwXTextSearch::~SwXTextSearch()
delete pReplaceProperties;
}
+namespace
+{
+ class theSwXTextSearchUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextSearchUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextSearchUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index fec315d1041b..843eb4975814 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -79,6 +79,8 @@
#include <fmtfsize.hxx>
#include <numrule.hxx>
+#include <comphelper/servicehelper.hxx>
+
#include <boost/shared_ptr.hpp>
#include "ccoll.hxx"
@@ -1170,10 +1172,14 @@ void SwStyleProperties_Impl::GetProperty( const OUString &rPropertyName, const u
rAny = rxPropertySet->getPropertyValue( rPropertyName );
}
+namespace
+{
+ class theSwXStyleUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXStyleUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXStyle::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXStyleUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXStyle::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index e394f89c4582..8077125ed3bd 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -105,6 +105,7 @@
#include <rtl/math.hxx>
#include <editeng/frmdiritem.hxx>
#include <switerator.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -787,13 +788,16 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
SwXCell::~SwXCell()
{
+}
+namespace
+{
+ class theSwXCellUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXCellUnoTunnelId > {};
}
const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXCellUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -831,17 +835,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeExce
return aRetTypes;
}
+namespace
+{
+ class theSwXCellImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXCellImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXCellImplementationId::get().getSeq();
}
void SAL_CALL SwXCell::acquire( ) throw()
@@ -2114,10 +2115,15 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() );
}
}
+
+namespace
+{
+ class theSwXTextTableUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextTableUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextTableUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -3591,10 +3597,14 @@ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( un
return aRet;
}
+namespace
+{
+ class theSwXCellRangeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXCellRangeUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXCellRangeUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 53b42556a58b..38c276378c78 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -38,11 +38,10 @@
#include <com/sun/star/text/ControlCharacter.hpp>
#include <com/sun/star/text/TableColumnSeparator.hpp>
-#include <rtl/uuid.h>
-
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cmdid.h>
#include <unotextbodyhf.hxx>
@@ -1230,10 +1229,14 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_FAIL("SwXText::removeVetoableChangeListener(): not implemented");
}
+namespace
+{
+ class theSwXTextUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXText::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -2384,18 +2387,15 @@ SwXBodyText::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
+namespace
+{
+ class theSwXBodyTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXBodyTextImplementationId> {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL
SwXBodyText::getImplementationId() throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXBodyTextImplementationId::get().getSeq();
}
uno::Any SAL_CALL
@@ -2670,18 +2670,15 @@ SwXHeadFootText::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
+namespace
+{
+ class theSwXHeadFootTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXHeadFootTextImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL
SwXHeadFootText::getImplementationId() throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXHeadFootTextImplementationId::get().getSeq();
}
uno::Any SAL_CALL
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 4820b9f11a3d..5f8fd913e638 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -64,6 +64,7 @@
#include <editeng/unolingu.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <ForbiddenCharactersEnum.hxx>
+#include <comphelper/servicehelper.hxx>
// for locking SolarMutex: svapp + mutex
#include <vcl/svapp.hxx>
@@ -879,10 +880,14 @@ Reference< XInterface > SAL_CALL SwXMLExportSettings_createInstance(
return (cppu::OWeakObject*)new SwXMLExport(rSMgr, EXPORT_SETTINGS|EXPORT_OASIS);
}
+namespace
+{
+ class theSwXMLExportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMLExportUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() throw()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXMLExportUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e20db7f54b61..31b3ba2e9f5d 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -74,6 +74,7 @@
#include <xmloff/xmlmetai.hxx>
#include <xmloff/xformsimport.hxx>
+#include <comphelper/servicehelper.hxx>
using ::rtl::OUString;
@@ -528,10 +529,14 @@ void SwXMLImport::setOrganizerMode( )
bOrganizerMode = sal_True;
}
+namespace
+{
+ class theSwXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMLImportUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() throw()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXMLImportUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXMLImport::getSomething( const Sequence< sal_Int8 >& rId )
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index d2446e76932d..c7591f96cc28 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -44,6 +44,7 @@
#include <unotools/tempfile.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <sot/filelist.hxx>
#include <svx/svxdlg.hxx>
@@ -3387,17 +3388,14 @@ void SwTransferable::ClearSelection( SwWrtShell& rSh,
}
}
+namespace
+{
+ class theSwTransferableUnoTunnelId : public rtl::Static< UnoTunnelIdInit, SwTransferable > {};
+}
+
const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId()
{
- static Sequence< sal_Int8 > aSeq;
- if( !aSeq.getLength() )
- {
- static osl::Mutex aCreateMutex;
- osl::Guard< osl::Mutex > aGuard( aCreateMutex );
- aSeq.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
- }
- return aSeq;
+ return theSwTransferableUnoTunnelId::get().getSeq();
}
sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) throw( RuntimeException )
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 32c109963519..b3dbea127dfe 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -49,6 +49,7 @@
#include <svx/zoomitem.hxx>
#include <unomod.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include "swmodule.hxx"
#include "cfgitems.hxx"
@@ -273,18 +274,15 @@ uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( )
return aBaseTypes;
}
+namespace
+{
+ class theSwXDocumentSettingsImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentSettingsImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXDocumentSettings::getImplementationId( )
throw (RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXDocumentSettingsImplementationId::get().getSeq();
}
void SwXDocumentSettings::_preSetValues ()
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index 22944dd40713..b6d75ec18d08 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -61,9 +61,8 @@
#include <swmodule.hxx>
#include <svl/smplhint.hxx>
#include <svl/macitem.hxx>
-
#include <editeng/acorrcfg.hxx>
-
+#include <comphelper/servicehelper.hxx>
#include <memory>
@@ -256,10 +255,14 @@ uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) t
return SwXAutoTextContainer_getSupportedServiceNames();
}
+namespace
+{
+ class theSwXAutoTextGroupUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXAutoTextGroupUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXAutoTextGroup::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXAutoTextGroupUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -747,10 +750,14 @@ uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw
return aRet;
}
+namespace
+{
+ class theSwXAutoTextEntryUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXAutoTextEntryUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXAutoTextEntry::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXAutoTextEntryUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx
index e054073f4632..32618ed9115f 100644
--- a/sw/source/ui/uno/unodispatch.cxx
+++ b/sw/source/ui/uno/unodispatch.cxx
@@ -33,7 +33,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/dataaccessdescriptor.hxx>
-
+#include <comphelper/servicehelper.hxx>
#include <unodispatch.hxx>
#include <unobaseclass.hxx>
#include <view.hxx>
@@ -160,10 +160,14 @@ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& )
m_xIntercepted = NULL;
}
+namespace
+{
+ class theSwXDispatchProviderInterceptorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDispatchProviderInterceptorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDispatchProviderInterceptor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDispatchProviderInterceptorUnoTunnelId::get().getSeq();
}
sal_Int64 SwXDispatchProviderInterceptor::getSomething(
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 034bbb791e1c..e1ac6b691b75 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -142,6 +142,8 @@
#include <svx/svdoutl.hxx>
#include <svl/languageoptions.hxx>
#include <svx/svdview.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -163,8 +165,6 @@ using ::osl::FileBase;
#define SW_CREATE_MARKER_TABLE 0x06
#define SW_CREATE_DRAW_DEFAULTS 0x07
-#include <comphelper/processfactory.hxx>
-
/******************************************************************************
*
******************************************************************************/
@@ -220,10 +220,14 @@ void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell )
}
}
+namespace
+{
+ class theSwXTextDocumentUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextDocumentUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXTextDocument::getUnoTunnelId()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextDocumentUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rId )
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index c80ff0e15fdd..c9a6b25ca868 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -85,6 +85,7 @@
#include <switerator.hxx>
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -186,17 +187,14 @@ Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( ) throw(uno::RuntimeExcep
return aBaseTypes;
}
+namespace
+{
+ class theSwXTextViewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwXTextView::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXTextViewImplementationId::get().getSeq();
}
void SAL_CALL SwXTextView::acquire( )throw()
@@ -1924,10 +1922,14 @@ Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( Ru
return aRet;
}
+namespace
+{
+ class theSwXTextViewCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewCursorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextViewCursor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextViewCursorUnoTunnelId::get().getSeq();
}
//XUnoTunnel