[Libreoffice-commits] .: 2 commits - sw/inc sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jun 2 03:43:38 PDT 2011


 sw/inc/unobaseclass.hxx                     |    3 -
 sw/source/core/access/acccell.cxx           |   20 +++------
 sw/source/core/access/accdoc.cxx            |   16 +++----
 sw/source/core/access/accembedded.cxx       |   16 ++-----
 sw/source/core/access/accfootnote.cxx       |   17 +++-----
 sw/source/core/access/accgraphic.cxx        |   17 +++-----
 sw/source/core/access/accheaderfooter.cxx   |   17 +++-----
 sw/source/core/access/accpage.cxx           |   17 +++-----
 sw/source/core/access/accpara.cxx           |   16 +++----
 sw/source/core/access/accpreview.cxx        |   17 +++-----
 sw/source/core/access/acctable.cxx          |   17 +++-----
 sw/source/core/access/acctextframe.cxx      |   17 +++-----
 sw/source/core/frmedt/feshview.cxx          |    3 -
 sw/source/core/unocore/TextCursorHelper.cxx |   10 +++-
 sw/source/core/unocore/unobkm.cxx           |    9 +++-
 sw/source/core/unocore/unochart.cxx         |   10 +++-
 sw/source/core/unocore/unodraw.cxx          |    9 +++-
 sw/source/core/unocore/unofield.cxx         |   17 ++++++--
 sw/source/core/unocore/unoflatpara.cxx      |   24 +++++------
 sw/source/core/unocore/unoframe.cxx         |   57 ++++++++++++----------------
 sw/source/core/unocore/unoftn.cxx           |   26 ++++++------
 sw/source/core/unocore/unoidx.cxx           |   17 ++++++--
 sw/source/core/unocore/unoobj.cxx           |   21 +++-------
 sw/source/core/unocore/unoobj2.cxx          |   17 ++++++--
 sw/source/core/unocore/unoparagraph.cxx     |    9 +++-
 sw/source/core/unocore/unoport.cxx          |    9 +++-
 sw/source/core/unocore/unoportenum.cxx      |   13 +++---
 sw/source/core/unocore/unoredline.cxx       |   46 +++++++++-------------
 sw/source/core/unocore/unorefmk.cxx         |   17 ++++++--
 sw/source/core/unocore/unosect.cxx          |    9 +++-
 sw/source/core/unocore/unosett.cxx          |   17 ++++++--
 sw/source/core/unocore/unosrch.cxx          |    9 +++-
 sw/source/core/unocore/unostyle.cxx         |   10 +++-
 sw/source/core/unocore/unotbl.cxx           |   40 ++++++++++++-------
 sw/source/core/unocore/unotext.cxx          |   41 +++++++++-----------
 sw/source/filter/xml/xmlexp.cxx             |    9 +++-
 sw/source/filter/xml/xmlimp.cxx             |    9 +++-
 sw/source/ui/dochdl/swdtflvr.cxx            |   16 +++----
 sw/source/ui/uno/SwXDocumentSettings.cxx    |   16 +++----
 sw/source/ui/uno/unoatxt.cxx                |   19 ++++++---
 sw/source/ui/uno/unodispatch.cxx            |   10 +++-
 sw/source/ui/uno/unotxdoc.cxx               |   12 +++--
 sw/source/ui/uno/unotxvw.cxx                |   24 ++++++-----
 43 files changed, 403 insertions(+), 342 deletions(-)

New commits:
commit d6839fa9aaac82892b5af2bc00c9ad196c9ff4bb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 2 11:39:43 2011 +0100

    Resolves: rhbz#710004 band-aid for immediate crash in IsAlignPossible

diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 6f5232f..e45d3c5 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2554,8 +2554,9 @@ sal_Bool SwFEShell::IsAlignPossible() const
         {
             SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
             SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO);
+            OSL_ENSURE( pC, "No SwDrawContact!");
             //only as character bound drawings can be aligned
-            bRet = (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR);
+            bRet = pC ? (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR) : sal_False;
         }
         if ( bRet )
             return Imp()->GetDrawView()->IsAlignPossible();
commit 922268a629cd6a65ab32fbe9b1f46b673f7f374d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 22:40:08 2011 +0100

    use uuid template here instead of hand-rolled ones

diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index 954a328..85a864e 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 18e8d4a..83c61cf 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 40bc84d..65dd898 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 18808e2..cb84ff0 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 6cfea84..af5c83a 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 d6ba4ee..eaf463c 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 c1e2697..245b274 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 76896e6..24b57e4 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 a9db42e..e8ec678 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 c102a36..ee98ca3 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 be54ecd..40e3fdd 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 c4800b3..ff11552 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 f4a234c..e9b9972 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 646c257..f75841f 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 fd9a2b6..f128bdc 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 b3c1dd6..203261f 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 f31acb9..f0ea833 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 4dab59b..134578d 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 7bacd45..63af5c2 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 93cbb5b..f2eef5f 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 dabc4ec..73cde70 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 b98dc4d..1577b10 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 fc16bdf..beda2f5 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 c8fea5c..01e9183 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 a637932..a1f3249 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 0e2bacc..5bab7c3 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 f2049cb..3867c9d 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 16749b2..23d7240 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 b09abb5..ab71036 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 a6d138a..3794d6e 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 76fb803..9432a03 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 ac86160..8539563 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 121c712..fff58ac 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 ca9b03f..b344676 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 8c1535c..2683175 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 03fb9fe..70b467b 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 a74ee5b..1c9017c 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 e2014b7..7c07927 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 8ddba45..2fc1ed9 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 966fb76..dcb3e91 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 9c07887..1011e78 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 1c1fca6..3d09fe4 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


More information about the Libreoffice-commits mailing list