[Libreoffice-commits] .: 15 commits - configmgr/source connectivity/source desktop/source fileaccess/source framework/inc framework/source sfx2/source svx/inc svx/source xmloff/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Jun 1 07:41:59 PDT 2011


 configmgr/source/childaccess.cxx                                   |   19 
 configmgr/source/components.cxx                                    |   26 -
 configmgr/source/components.hxx                                    |    3 
 configmgr/source/rootaccess.cxx                                    |    3 
 connectivity/source/commontools/TPrivilegesResultSet.cxx           |   14 
 connectivity/source/drivers/odbcbase/OStatement.cxx                |    1 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx                   |    2 
 desktop/source/deployment/gui/dp_gui_shared.hxx                    |    2 
 desktop/source/deployment/inc/dp_dependencies.hxx                  |    2 
 desktop/source/deployment/inc/dp_resource.h                        |    2 
 desktop/source/deployment/inc/dp_ucb.h                             |    2 
 desktop/source/deployment/misc/dp_misc.cxx                         |    4 
 desktop/source/deployment/misc/dp_platform.cxx                     |    6 
 desktop/source/deployment/misc/dp_resource.cxx                     |    2 
 desktop/source/migration/services/basicmigration.cxx               |   32 -
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx                     |    2 
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx                       |    4 
 desktop/source/pkgchk/unopkg/unopkg_shared.h                       |    2 
 fileaccess/source/FileAccess.cxx                                   |   15 
 framework/inc/services/layoutmanager.hxx                           |    6 
 framework/source/fwe/classes/actiontriggerpropertyset.cxx          |    6 
 framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx |    6 
 framework/source/fwi/uielement/constitemcontainer.cxx              |   36 -
 framework/source/fwi/uielement/itemcontainer.cxx                   |   19 
 framework/source/fwi/uielement/rootitemcontainer.cxx               |   35 -
 framework/source/helper/uiconfigelementwrapperbase.cxx             |    8 
 framework/source/helper/uielementwrapperbase.cxx                   |    8 
 framework/source/layoutmanager/layoutmanager.cxx                   |   40 +
 framework/source/services/autorecovery.cxx                         |    4 
 framework/source/services/desktop.cxx                              |    8 
 framework/source/tabwin/tabwindow.cxx                              |    8 
 sfx2/source/doc/DocumentMetadataAccess.cxx                         |    1 
 sfx2/source/doc/SfxDocumentMetaData.cxx                            |    8 
 sfx2/source/doc/objserv.cxx                                        |   19 
 sfx2/source/toolbox/imgmgr.cxx                                     |   47 +-
 svx/inc/svx/SvxShapeTypes.hxx                                      |    5 
 svx/source/accessibility/SvxShapeTypes.cxx                         |  201 ++++------
 xmloff/source/core/attrlist.cxx                                    |   20 
 xmloff/source/core/unoatrcn.cxx                                    |   20 
 xmloff/source/core/xmlexp.cxx                                      |   20 
 xmloff/source/core/xmlimp.cxx                                      |   20 
 xmloff/source/style/StyleMap.cxx                                   |   20 
 xmloff/source/text/txtimppr.cxx                                    |    4 
 xmloff/source/text/txtparae.cxx                                    |    8 
 xmloff/source/transform/MutableAttrList.cxx                        |   19 
 xmloff/source/transform/OOo2Oasis.cxx                              |   14 
 xmloff/source/transform/Oasis2OOo.cxx                              |   13 
 47 files changed, 336 insertions(+), 430 deletions(-)

New commits:
commit 11611f3cef10a58d90c22d17c11a79a1820fb7bc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 12:16:28 2011 +0100

    tweak these a bit to allow better template

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 7aa8dec..020ef14 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -100,7 +100,7 @@ namespace dp_gui {
 #define PROGRESS_HEIGHT     14
 
 //------------------------------------------------------------------------------
-struct StrAllFiles : public rtl::StaticWithInit< const OUString, StrAllFiles >
+struct StrAllFiles : public rtl::StaticWithInit< OUString, StrAllFiles >
 {
     const OUString operator () () {
         const SolarMutexGuard guard;
diff --git a/desktop/source/deployment/gui/dp_gui_shared.hxx b/desktop/source/deployment/gui/dp_gui_shared.hxx
index dcee286..a70686a 100644
--- a/desktop/source/deployment/gui/dp_gui_shared.hxx
+++ b/desktop/source/deployment/gui/dp_gui_shared.hxx
@@ -45,7 +45,7 @@ struct DeploymentGuiResMgr :
     }
 };
 
-struct BrandName : public ::rtl::StaticWithInit<const ::rtl::OUString, BrandName> {
+struct BrandName : public ::rtl::StaticWithInit< ::rtl::OUString, BrandName > {
     const ::rtl::OUString operator () () {
         return ::utl::ConfigManager::GetDirectConfigProperty(
             ::utl::ConfigManager::PRODUCTNAME ).get< ::rtl::OUString >();
diff --git a/desktop/source/deployment/inc/dp_dependencies.hxx b/desktop/source/deployment/inc/dp_dependencies.hxx
index f31d5f3..b0df05f 100644
--- a/desktop/source/deployment/inc/dp_dependencies.hxx
+++ b/desktop/source/deployment/inc/dp_dependencies.hxx
@@ -45,7 +45,7 @@ namespace rtl { class OUString; }
 
 namespace dp_misc {
 
-struct BrandName : public ::rtl::StaticWithInit<const ::rtl::OUString, BrandName> {
+struct BrandName : public ::rtl::StaticWithInit< ::rtl::OUString, BrandName > {
     const ::rtl::OUString operator () () {
         return ::utl::ConfigManager::GetDirectConfigProperty(
             ::utl::ConfigManager::PRODUCTNAME ).get< ::rtl::OUString >();
diff --git a/desktop/source/deployment/inc/dp_resource.h b/desktop/source/deployment/inc/dp_resource.h
index bd3a4fa..212ed5a 100755
--- a/desktop/source/deployment/inc/dp_resource.h
+++ b/desktop/source/deployment/inc/dp_resource.h
@@ -47,7 +47,7 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC String getResourceString( sal_uInt16 id );
 
 template <typename Unique, sal_uInt16 id>
 struct StaticResourceString :
-        public ::rtl::StaticWithInit<const ::rtl::OUString, Unique> {
+        public ::rtl::StaticWithInit< ::rtl::OUString, Unique > {
     const ::rtl::OUString operator () () { return getResourceString(id); }
 };
 
diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h
index c2fcdcd..2835f15 100755
--- a/desktop/source/deployment/inc/dp_ucb.h
+++ b/desktop/source/deployment/inc/dp_ucb.h
@@ -45,7 +45,7 @@ namespace css = ::com::sun::star;
 namespace dp_misc {
 
 struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle :
-    public rtl::StaticWithInit<const rtl::OUString, StrTitle>
+    public rtl::StaticWithInit<rtl::OUString, StrTitle>
 {
     const rtl::OUString operator () ();
 };
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 78696a4..b626141 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -79,7 +79,7 @@ namespace dp_misc {
 namespace {
 
 struct UnoRc : public rtl::StaticWithInit<
-    const boost::shared_ptr<rtl::Bootstrap>, UnoRc> {
+    boost::shared_ptr<rtl::Bootstrap>, UnoRc> {
     const boost::shared_ptr<rtl::Bootstrap> operator () () {
         OUString unorc( RTL_CONSTASCII_USTRINGPARAM(
                             "$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")) );
@@ -91,7 +91,7 @@ struct UnoRc : public rtl::StaticWithInit<
     }
 };
 
-struct OfficePipeId : public rtl::StaticWithInit<const OUString, OfficePipeId> {
+struct OfficePipeId : public rtl::StaticWithInit<OUString, OfficePipeId> {
     const OUString operator () ();
 };
 
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index 6217be2..515b848 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.cxx
@@ -91,7 +91,7 @@ namespace dp_misc
 namespace 
 {
     struct StrOperatingSystem :
-        public rtl::StaticWithInit<const OUString, StrOperatingSystem> {
+        public rtl::StaticWithInit<OUString, StrOperatingSystem> {
             const OUString operator () () {
                 OUString os( RTL_CONSTASCII_USTRINGPARAM("$_OS") );
                 ::rtl::Bootstrap::expandMacros( os );
@@ -100,7 +100,7 @@ namespace
     };
 
     struct StrCPU :
-        public rtl::StaticWithInit<const OUString, StrCPU> {
+        public rtl::StaticWithInit<OUString, StrCPU> {
             const OUString operator () () {
                 OUString arch( RTL_CONSTASCII_USTRINGPARAM("$_ARCH") );
                 ::rtl::Bootstrap::expandMacros( arch );
@@ -110,7 +110,7 @@ namespace
 
 
     struct StrPlatform : public rtl::StaticWithInit<
-        const OUString, StrPlatform> {
+        OUString, StrPlatform> {
             const OUString operator () () {
                 ::rtl::OUStringBuffer buf;
                 buf.append( StrOperatingSystem::get() );
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index c8c57ac..ad7a9e0 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.cxx
@@ -46,7 +46,7 @@ namespace dp_misc {
 namespace {
 
 struct OfficeLocale :
-        public rtl::StaticWithInit<const OUString, OfficeLocale> {
+        public rtl::StaticWithInit<OUString, OfficeLocale> {
     const OUString operator () () {
         OUString slang;
         if (! (::utl::ConfigManager::GetDirectConfigProperty(
diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx
index d58aa58..dfadba4 100644
--- a/desktop/source/migration/services/basicmigration.cxx
+++ b/desktop/source/migration/services/basicmigration.cxx
@@ -43,9 +43,8 @@ namespace migration
 //.........................................................................
 
 
-    static ::rtl::OUString sSourceUserBasic = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/basic" ) );
-    static ::rtl::OUString sTargetUserBasic = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/__basic_80" ) );
-
+    #define sSourceUserBasic ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/user/basic"))
+    #define sTargetUserBasic ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/user/__basic_80"))
 
     // =============================================================================
     // component operations
@@ -53,35 +52,16 @@ namespace migration
 
     ::rtl::OUString BasicMigration_getImplementationName()
     {
-        static ::rtl::OUString* pImplName = 0;
-        if ( !pImplName )
-        {
-            ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-            if ( !pImplName )
-            {
-                static ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.desktop.migration.Basic" ) );
-                pImplName = &aImplName;
-            }
-        }
-        return *pImplName;
+        return ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.desktop.migration.Basic"));
     }
 
     // -----------------------------------------------------------------------------
 
     Sequence< ::rtl::OUString > BasicMigration_getSupportedServiceNames()
     {
-        static Sequence< ::rtl::OUString >* pNames = 0;
-        if ( !pNames )
-        {
-            ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-            if ( !pNames )
-            {
-                static Sequence< ::rtl::OUString > aNames(1);
-                aNames.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.migration.Basic" ) );
-                pNames = &aNames;
-            }
-        }
-        return *pNames;
+        Sequence< ::rtl::OUString > aNames(1);
+        aNames.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.migration.Basic" ) );
+        return aNames;
     }
 
     // =============================================================================
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index f3d68a0..c8007cf 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -67,7 +67,7 @@ namespace {
 
 //==============================================================================
 struct OfficeLocale :
-        public rtl::StaticWithInit<const lang::Locale, OfficeLocale> {
+        public rtl::StaticWithInit<lang::Locale, OfficeLocale> {
     const lang::Locale operator () () {
         OUString slang;
         if (! (::utl::ConfigManager::GetDirectConfigProperty(
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 1a87c92..7db2372 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -180,7 +180,7 @@ bool readArgument(
 
 namespace {
 struct ExecutableDir : public rtl::StaticWithInit<
-    const OUString, ExecutableDir> {
+    OUString, ExecutableDir> {
     const OUString operator () () {
         OUString path;
         if (osl_getExecutableFile( &path.pData ) != osl_Process_E_None) {
@@ -191,7 +191,7 @@ struct ExecutableDir : public rtl::StaticWithInit<
     }
 };
 struct ProcessWorkingDir : public rtl::StaticWithInit<
-    const OUString, ProcessWorkingDir> {
+    OUString, ProcessWorkingDir> {
     const OUString operator () () {
         OUString workingDir;
         tools::getProcessWorkingDir(workingDir);
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index cc25e93..ddad731 100755
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -56,7 +56,7 @@ namespace unopkg {
 
 
     struct OfficeLocale :
-        public rtl::StaticWithInit<const css::lang::Locale, OfficeLocale> {
+        public rtl::StaticWithInit<css::lang::Locale, OfficeLocale> {
             const css::lang::Locale operator () () {
                 ::rtl::OUString slang;
         if (! (::utl::ConfigManager::GetDirectConfigProperty(
commit da4a1dc5a2a29b8b3bd30042c5d806575d7f7668
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 12:13:10 2011 +0100

    overly static

diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index b2af198..66e1b04 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -2399,12 +2399,8 @@ namespace comp_CompatWriterDocProps {
 
    css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
    {
-        static css::uno::Sequence< rtl::OUString > aServiceNames;
-        if ( aServiceNames.getLength() == 0 )
-        {
-            aServiceNames.realloc( 1 );
-            aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties" ) );
-        }
+        css::uno::Sequence< rtl::OUString > aServiceNames(1);
+        aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties" ) );
         return aServiceNames;
    }
     css::uno::Reference< css::uno::XInterface > SAL_CALL _create(
commit 9cc4797be23e5218dc7622b0d583c8542857b879
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 11:46:40 2011 +0100

    use tunnel pattern here

diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx
index b90b664..f2e79b5 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -28,23 +28,15 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_framework.hxx"
-//_________________________________________________________________________________________________________________
-//	my own includes
-//_________________________________________________________________________________________________________________
 #include <uielement/constitemcontainer.hxx>
 #include <uielement/rootitemcontainer.hxx>
 #include <uielement/itemcontainer.hxx>
 #include <threadhelp/resetableguard.hxx>
 
-//_________________________________________________________________________________________________________________
-//	interface includes
-//_________________________________________________________________________________________________________________
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 
-//_________________________________________________________________________________________________________________
-//	other includes
-//_________________________________________________________________________________________________________________
 #include <cppuhelper/implbase1.hxx>
+#include <comphelper/servicehelper.hxx>
 
 using namespace cppu;
 using namespace com::sun::star::uno;
@@ -299,20 +291,14 @@ sal_Int64 ConstItemContainer::getSomething( const ::com::sun::star::uno::Sequenc
     return 0;
 }
 
+namespace
+{
+    class theConstItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theConstItemContainerUnoTunnelId > {};
+}
+
 const Sequence< sal_Int8 >& ConstItemContainer::GetUnoTunnelId() throw()
 {
-    static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = NULL;
-    if( !pSeq )
-    {
-        ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theConstItemContainerUnoTunnelId::get().getSeq();
 }
 
 ConstItemContainer* ConstItemContainer::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw()
diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx
index 9b6c20c..5223dff 100644
--- a/framework/source/fwi/uielement/itemcontainer.cxx
+++ b/framework/source/fwi/uielement/itemcontainer.cxx
@@ -34,6 +34,7 @@
 #include <uielement/itemcontainer.hxx>
 #include <uielement/constitemcontainer.hxx>
 #include <threadhelp/resetableguard.hxx>
+#include <comphelper/servicehelper.hxx>
 
 //_________________________________________________________________________________________________________________
 //	other includes
@@ -159,20 +160,14 @@ sal_Int64 ItemContainer::getSomething( const ::com::sun::star::uno::Sequence< sa
     return 0;
 }
 
+namespace
+{
+    class theItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theItemContainerUnoTunnelId > {};
+}
+
 const Sequence< sal_Int8 >& ItemContainer::GetUnoTunnelId() throw()
 {
-    static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = NULL;
-    if( !pSeq )
-    {
-        ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theItemContainerUnoTunnelId::get().getSeq();
 }
 
 ItemContainer* ItemContainer::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw()
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index fbc4e35..e1cda01 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -28,21 +28,14 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_framework.hxx"
-//_________________________________________________________________________________________________________________
-//	my own includes
-//_________________________________________________________________________________________________________________
+#include <comphelper/servicehelper.hxx>
 #include <uielement/rootitemcontainer.hxx>
-
 #include <uielement/itemcontainer.hxx>
-
 #include <uielement/constitemcontainer.hxx>
 #include <threadhelp/resetableguard.hxx>
 #include <general.h>
 #include <properties.h>
 
-//_________________________________________________________________________________________________________________
-//	interface includes
-//_________________________________________________________________________________________________________________
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 
 //_________________________________________________________________________________________________________________
@@ -222,20 +215,14 @@ sal_Int64 RootItemContainer::getSomething( const ::com::sun::star::uno::Sequence
     return 0;
 }
 
+namespace
+{
+    class theRootItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theRootItemContainerUnoTunnelId > {};
+}
+
 const Sequence< sal_Int8 >& RootItemContainer::GetUnoTunnelId() throw()
 {
-    static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = NULL;
-    if( !pSeq )
-    {
-        ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theRootItemContainerUnoTunnelId::get().getSeq();
 }
 
 RootItemContainer* RootItemContainer::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw()
commit 118e0bd90213af3d1b707577d44d0c026eeec9c3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 11:39:41 2011 +0100

    overly static

diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index e5fccea..3de228c 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -97,6 +97,10 @@ namespace framework
     class ToolbarLayoutManager;
     class PanelManager;
     class GlobalSettings;
+    namespace detail
+    {
+        class InfoHelperBuilder;
+    }
     typedef ::cppu::WeakImplHelper8 <   ::com::sun::star::lang::XServiceInfo
                                     ,   ::com::sun::star::frame::XLayoutManager
                                     ,   ::com::sun::star::awt::XWindowListener
@@ -370,6 +374,8 @@ namespace framework
             PanelManager*                                                               m_pPanelManager;
             ToolbarLayoutManager*                                                       m_pToolbarManager;
             css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >       m_xToolbarManager;
+
+        friend class detail::InfoHelperBuilder;
     };
     
 } // namespace framework
diff --git a/framework/source/fwe/classes/actiontriggerpropertyset.cxx b/framework/source/fwe/classes/actiontriggerpropertyset.cxx
index 8d5589f..c7cc9d4 100644
--- a/framework/source/fwe/classes/actiontriggerpropertyset.cxx
+++ b/framework/source/fwe/classes/actiontriggerpropertyset.cxx
@@ -351,7 +351,7 @@ throw ( RuntimeException )
 
 const Sequence< Property > ActionTriggerPropertySet::impl_getStaticPropertyDescriptor()
 {
-    static const Property pActionTriggerPropertys[] =
+    const Property pActionTriggerPropertys[] =
     {
         Property( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL"	)), HANDLE_COMMANDURL	, ::getCppuType((::rtl::OUString*)0)				, PropertyAttribute::TRANSIENT	),
         Property( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpURL"		)), HANDLE_HELPURL		, ::getCppuType((::rtl::OUString*)0)				, PropertyAttribute::TRANSIENT	),
@@ -361,9 +361,9 @@ const Sequence< Property > ActionTriggerPropertySet::impl_getStaticPropertyDescr
     };
 
     // Use it to initialize sequence!
-    static const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
+    const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
 
-    // Return static "PropertyDescriptor"
+    // Return "PropertyDescriptor"
     return seqActionTriggerPropertyDescriptor ;
 }
 
diff --git a/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx b/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
index b60697d..e26b76b 100644
--- a/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
+++ b/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
@@ -295,15 +295,15 @@ throw ( RuntimeException )
 
 const Sequence< Property > ActionTriggerSeparatorPropertySet::impl_getStaticPropertyDescriptor()
 {
-    static const Property pActionTriggerPropertys[] =
+    const Property pActionTriggerPropertys[] =
     {
         Property( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SeparatorType" )), HANDLE_TYPE, ::getCppuType((sal_Int16*)0), PropertyAttribute::TRANSIENT )
     };
 
     // Use it to initialize sequence!
-    static const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
+    const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
 
-    // Return static "PropertyDescriptor"
+    // Return "PropertyDescriptor"
     return seqActionTriggerPropertyDescriptor ;
 }
 
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx
index 0b99dbd..b90b664 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -451,22 +451,22 @@ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang
 
 const com::sun::star::uno::Sequence< com::sun::star::beans::Property > ConstItemContainer::impl_getStaticPropertyDescriptor()
 {
-    // Create a new static property array to initialize sequence!
+    // Create a property array to initialize sequence!
     // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
     // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
     // It's necessary for methods of OPropertySetHelper.
     // ATTENTION:
     //      YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
 
-    static const com::sun::star::beans::Property pProperties[] =
+    const com::sun::star::beans::Property pProperties[] =
     {
         com::sun::star::beans::Property( PROPNAME_UINAME, PROPHANDLE_UINAME ,
                                          ::getCppuType((const rtl::OUString*)NULL),
                                          com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY  )
     };
     // Use it to initialize sequence!
-    static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
-    // Return static "PropertyDescriptor"
+    const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
+    // Return "PropertyDescriptor"
     return lPropertyDescriptor;
 }
 
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index 2cca964..fbc4e35 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -440,22 +440,22 @@ throw (::com::sun::star::uno::RuntimeException)
 
 const com::sun::star::uno::Sequence< com::sun::star::beans::Property > RootItemContainer::impl_getStaticPropertyDescriptor()
 {
-    // Create a new static property array to initialize sequence!
+    // Create a property array to initialize sequence!
     // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
     // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
     // It's necessary for methods of OPropertySetHelper.
     // ATTENTION:
     //      YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
 
-    static const com::sun::star::beans::Property pProperties[] =
+    const com::sun::star::beans::Property pProperties[] =
     {
         com::sun::star::beans::Property( PROPNAME_UINAME, PROPHANDLE_UINAME ,
                                          ::getCppuType((const rtl::OUString*)NULL),
                                          com::sun::star::beans::PropertyAttribute::TRANSIENT )
     };
     // Use it to initialize sequence!
-    static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
-    // Return static "PropertyDescriptor"
+    const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
+    // Return "PropertyDescriptor"
     return lPropertyDescriptor;
 }
 
diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx
index 9b8c031..df353f8 100644
--- a/framework/source/helper/uiconfigelementwrapperbase.cxx
+++ b/framework/source/helper/uiconfigelementwrapperbase.cxx
@@ -472,14 +472,14 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA
 
 const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigElementWrapperBase::impl_getStaticPropertyDescriptor()
 {
-    // Create a new static property array to initialize sequence!
+    // Create property array to initialize sequence!
     // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
     // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
     // It's necessary for methods of OPropertySetHelper.
     // ATTENTION:
     //      YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
 
-    static const com::sun::star::beans::Property pProperties[] =
+    const com::sun::star::beans::Property pProperties[] =
     {
         com::sun::star::beans::Property( UIELEMENT_PROPNAME_CONFIGLISTENER, UIELEMENT_PROPHANDLE_CONFIGLISTENER , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT  ),
         com::sun::star::beans::Property( UIELEMENT_PROPNAME_CONFIGSOURCE  , UIELEMENT_PROPHANDLE_CONFIGSOURCE   , ::getCppuType((const Reference< ::com::sun::star::ui::XUIConfigurationManager >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT  ),
@@ -491,8 +491,8 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigE
         com::sun::star::beans::Property( UIELEMENT_PROPNAME_XMENUBAR      , UIELEMENT_PROPHANDLE_XMENUBAR       , ::getCppuType((const Reference< com::sun::star::awt::XMenuBar >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY )
     };
     // Use it to initialize sequence!
-    static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
-    // Return static "PropertyDescriptor"
+    const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
+    // Return "PropertyDescriptor"
     return lPropertyDescriptor;
 }
 void SAL_CALL UIConfigElementWrapperBase::setSettings( const Reference< XIndexAccess >& xSettings ) throw ( RuntimeException )
diff --git a/framework/source/helper/uielementwrapperbase.cxx b/framework/source/helper/uielementwrapperbase.cxx
index 6923932..0e25793 100644
--- a/framework/source/helper/uielementwrapperbase.cxx
+++ b/framework/source/helper/uielementwrapperbase.cxx
@@ -261,22 +261,22 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA
 
 const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIElementWrapperBase::impl_getStaticPropertyDescriptor()
 {
-    // Create a new static property array to initialize sequence!
+    // Create a property array to initialize sequence!
     // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
     // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
     // It's necessary for methods of OPropertySetHelper.
     // ATTENTION:
     //      YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
 
-    static const com::sun::star::beans::Property pProperties[] =
+    const com::sun::star::beans::Property pProperties[] =
     {
         com::sun::star::beans::Property( UIELEMENT_PROPNAME_FRAME         , UIELEMENT_PROPHANDLE_FRAME          , ::getCppuType((Reference< XFrame >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ),
         com::sun::star::beans::Property( UIELEMENT_PROPNAME_RESOURCEURL   , UIELEMENT_PROPHANDLE_RESOURCEURL    , ::getCppuType((sal_Int16*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ),
         com::sun::star::beans::Property( UIELEMENT_PROPNAME_TYPE          , UIELEMENT_PROPHANDLE_TYPE           , ::getCppuType((const ::rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY )
     };
     // Use it to initialize sequence!
-    static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
-    // Return static "PropertyDescriptor"
+    const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
+    // Return "PropertyDescriptor"
     return lPropertyDescriptor;
 }
 
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 603dd2c..1ba2f98 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -90,6 +90,7 @@
 #include <comphelper/mediadescriptor.hxx>
 #include <comphelper/uno3.hxx>
 #include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
 #include <unotools/cmdoptions.hxx>
 
 #include <algorithm>
@@ -3212,24 +3213,39 @@ void SAL_CALL LayoutManager::getFastPropertyValue( uno::Any& aValue, sal_Int32 n
     LayoutManager_PBase::getFastPropertyValue( aValue, nHandle );
 }
 
-::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper()
+namespace detail
 {
-    static ::cppu::OPropertyArrayHelper* pInfoHelper = NULL;
-
-    if( pInfoHelper == NULL )
+    class InfoHelperBuilder : private ::boost::noncopyable
     {
-        osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
-
-        if( pInfoHelper == NULL )
+    private:
+        ::cppu::OPropertyArrayHelper *m_pInfoHelper;
+    public:
+        InfoHelperBuilder(const LayoutManager &rManager)
         {
             uno::Sequence< beans::Property > aProperties;
-            describeProperties( aProperties );
-            static ::cppu::OPropertyArrayHelper aInfoHelper( aProperties, sal_True );
-            pInfoHelper = &aInfoHelper;
+            rManager.describeProperties(aProperties);
+            m_pInfoHelper = new ::cppu::OPropertyArrayHelper(aProperties, sal_True);
+        }
+        ~InfoHelperBuilder()
+        {
+            delete m_pInfoHelper;
         }
-    }
 
-    return(*pInfoHelper);
+        ::cppu::OPropertyArrayHelper& getHelper() { return *m_pInfoHelper; }
+    };
+}
+namespace
+{
+    struct theInfoHelper :
+        public rtl::StaticWithArg< detail::InfoHelperBuilder, LayoutManager,
+        theInfoHelper >
+    {
+    };
+}
+
+::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper()
+{
+    return theInfoHelper::get(*this).getHelper();
 }
 
 uno::Reference< beans::XPropertySetInfo > SAL_CALL LayoutManager::getPropertySetInfo() throw (uno::RuntimeException)
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 80fdf7f..efe2f17 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3307,13 +3307,13 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
 //-----------------------------------------------
 const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor()
 {
-    static const css::beans::Property pPropertys[] =
+    const css::beans::Property pPropertys[] =
     {
         css::beans::Property( AUTORECOVERY_PROPNAME_CRASHED            , AUTORECOVERY_PROPHANDLE_CRASHED            , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
         css::beans::Property( AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA, AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA, ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
         css::beans::Property( AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA , AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
     };
-    static const css::uno::Sequence< css::beans::Property > lPropertyDescriptor(pPropertys, AUTORECOVERY_PROPCOUNT);
+    const css::uno::Sequence< css::beans::Property > lPropertyDescriptor(pPropertys, AUTORECOVERY_PROPCOUNT);
     return lPropertyDescriptor;
 }
 
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 0f43a7b..43fde5a 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1781,14 +1781,14 @@ css::uno::Reference< css::lang::XComponent > Desktop::impl_getFrameComponent( co
 *//*-*************************************************************************************************************/
 const css::uno::Sequence< css::beans::Property > Desktop::impl_getStaticPropertyDescriptor()
 {
-    // Create a new static property array to initialize sequence!
+    // Create a property array to initialize sequence!
     // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
     // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
     // It's necessary for methods of OPropertySetHelper.
     // ATTENTION:
     //      YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
 
-    static const css::beans::Property pProperties[] =
+    const css::beans::Property pProperties[] =
     {
         css::beans::Property( DESKTOP_PROPNAME_ACTIVEFRAME              , DESKTOP_PROPHANDLE_ACTIVEFRAME             , ::getCppuType((const css::uno::Reference< css::lang::XComponent >*)NULL)                , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
         css::beans::Property( DESKTOP_PROPNAME_DISPATCHRECORDERSUPPLIER , DESKTOP_PROPHANDLE_DISPATCHRECORDERSUPPLIER, ::getCppuType((const css::uno::Reference< css::frame::XDispatchRecorderSupplier >*)NULL), css::beans::PropertyAttribute::TRANSIENT ),
@@ -1797,8 +1797,8 @@ const css::uno::Sequence< css::beans::Property > Desktop::impl_getStaticProperty
         css::beans::Property( DESKTOP_PROPNAME_TITLE                    , DESKTOP_PROPHANDLE_TITLE                   , ::getCppuType((const ::rtl::OUString*)NULL)                                             , css::beans::PropertyAttribute::TRANSIENT ),
     };
     // Use it to initialize sequence!
-    static const css::uno::Sequence< css::beans::Property > lPropertyDescriptor( pProperties, DESKTOP_PROPCOUNT );
-    // Return static "PropertyDescriptor"
+    const css::uno::Sequence< css::beans::Property > lPropertyDescriptor( pProperties, DESKTOP_PROPCOUNT );
+    // Return "PropertyDescriptor"
     return lPropertyDescriptor;
 }
 
diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx
index a898a44..46680e4 100644
--- a/framework/source/tabwin/tabwindow.cxx
+++ b/framework/source/tabwin/tabwindow.cxx
@@ -947,14 +947,14 @@ throw ( css::uno::RuntimeException )
 
 const css::uno::Sequence< css::beans::Property > TabWindow::impl_getStaticPropertyDescriptor()
 {
-    // Create a new static property array to initialize sequence!
+    // Create property array to initialize sequence!
     // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
     // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
     // It's necessary for methods of OPropertySetHelper.
     // ATTENTION:
     //      YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
 
-    static const com::sun::star::beans::Property pProperties[] =
+    const com::sun::star::beans::Property pProperties[] =
     {
         com::sun::star::beans::Property( TABWINDOW_PROPNAME_PARENTWINDOW,
                                          TABWINDOW_PROPHANDLE_PARENTWINDOW,
@@ -965,9 +965,9 @@ const css::uno::Sequence< css::beans::Property > TabWindow::impl_getStaticProper
                                          ::getCppuType((const css::uno::Reference< css::awt::XWindow >*)NULL),
                                          com::sun::star::beans::PropertyAttribute::READONLY  )
     }; 	// Use it to initialize sequence!
-    static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, TABWINDOW_PROPCOUNT );
+    const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, TABWINDOW_PROPCOUNT );
 
-    // Return static "PropertyDescriptor"
+    // Return "PropertyDescriptor"
     return lPropertyDescriptor;
 }
 
commit 83024c48c65b751fd192e8eeb74f35c239c746a8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 11:35:21 2011 +0100

    use tunnel pattern here

diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index fc8e1ca..08f22d9 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -43,6 +43,7 @@
 #include "cppu/unotype.hxx"
 #include "cppuhelper/queryinterface.hxx"
 #include "cppuhelper/weak.hxx"
+#include "comphelper/servicehelper.hxx"
 #include "osl/diagnose.h"
 #include "osl/mutex.hxx"
 #include "rtl/ref.hxx"
@@ -50,7 +51,6 @@
 #include "rtl/ustrbuf.hxx"
 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
-#include "rtl/uuid.h"
 #include "sal/types.h"
 
 #include "access.hxx"
@@ -77,15 +77,14 @@ namespace css = com::sun::star;
 
 }
 
-css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId() {
-    static css::uno::Sequence< sal_Int8 > id;
-    if (id.getLength() == 0) {
-        css::uno::Sequence< sal_Int8 > uuid(16);
-        rtl_createUuid(
-            reinterpret_cast< sal_uInt8 * >(uuid.getArray()), 0, false);
-        id = uuid;
-    }
-    return id;
+namespace
+{
+    class theChildAccessUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theChildAccessUnoTunnelId > {};
+}
+
+css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId()
+{
+    return theChildAccessUnoTunnelId::get().getSeq();
 }
 
 ChildAccess::ChildAccess(
commit 51e09a246e881352ae8819d1ffc1913e39618247
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 09:20:01 2011 +0100

    use this tunnel pattern

diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 6469183..0bca6d9 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -44,7 +44,6 @@
 #include <com/sun/star/rdf/URI.hpp>
 #include <com/sun/star/rdf/Repository.hpp>
 
-#include <rtl/uuid.h>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/uri.hxx>
 #include <rtl/bootstrap.hxx>
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 506fc32..5f3624d 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -47,6 +47,7 @@
 #include <com/sun/star/frame/XDocumentTemplates.hpp>
 #include <com/sun/star/frame/XStorable.hpp>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
 #include <com/sun/star/security/CertificateValidity.hpp>
 
 #include <com/sun/star/security/DocumentSignatureInformation.hpp>
@@ -1466,20 +1467,14 @@ void SfxObjectShell::SignScriptingContent()
     ImplSign( sal_True );
 }
 
+namespace
+{
+    class theSfxObjectShellUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSfxObjectShellUnoTunnelId > {};
+}
+
 const uno::Sequence<sal_Int8>& SfxObjectShell::getUnoTunnelId()
 {
-    static uno::Sequence<sal_Int8> * pSeq = 0;
-    if( !pSeq )
-    {
-        osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theSfxObjectShellUnoTunnelId::get().getSeq();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 86918c206e3cb552cc0c4517c9645fa20159c634
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 1 09:18:51 2011 +0100

    make these well-behaved singletons

diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx
index cb4eefe..b3af92d 100644
--- a/sfx2/source/toolbox/imgmgr.cxx
+++ b/sfx2/source/toolbox/imgmgr.cxx
@@ -47,6 +47,7 @@
 #include <tools/link.hxx>
 #include <svtools/miscopt.hxx>
 #include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
 
 #include <comphelper/processfactory.hxx>
 
@@ -80,27 +81,38 @@ public:
     ~SfxImageManager_Impl();
 };
 
+namespace
+{
+    typedef boost::unordered_map< SfxModule*, boost::shared_ptr<SfxImageManager_Impl> > SfxImageManagerImplMap;
+
+    class theImageManagerImplMap :
+        public rtl::Static<SfxImageManagerImplMap, theImageManagerImplMap> {};
+
+    class theGlobalImageManager :
+        public rtl::StaticWithArg<SfxImageManager_Impl, SfxModule*,
+            theGlobalImageManager> {};
+}
+
 static SfxImageManager_Impl* GetImageManager( SfxModule* pModule )
 {
     SolarMutexGuard aGuard;
 
     if ( pModule == 0 )
     {
-        static SfxImageManager_Impl aGlobalImageManager(0);
-        return &aGlobalImageManager;
+        return &theGlobalImageManager::get(NULL);
     }
     else
     {
-        typedef boost::unordered_map< SfxModule*, boost::shared_ptr<SfxImageManager_Impl> > SfxImageManagerImplMap;
-        static SfxImageManagerImplMap  m_ImageManager_ImplMap;
+        SfxImageManagerImplMap &rImageManager_ImplMap =
+            theImageManagerImplMap::get();
         SfxImageManager_Impl* pImpl( 0 );
-        SfxImageManagerImplMap::const_iterator pIter = m_ImageManager_ImplMap.find(pModule);
-        if ( pIter != m_ImageManager_ImplMap.end() )
+        SfxImageManagerImplMap::const_iterator pIter = rImageManager_ImplMap.find(pModule);
+        if ( pIter != rImageManager_ImplMap.end() )
             pImpl = pIter->second.get();
         else
         {
-            m_ImageManager_ImplMap[pModule].reset(new SfxImageManager_Impl(pModule));
-            pImpl = m_ImageManager_ImplMap[pModule].get();
+            rImageManager_ImplMap[pModule].reset(new SfxImageManager_Impl(pModule));
+            pImpl = rImageManager_ImplMap[pModule].get();
         }
         return pImpl;
     }
@@ -290,21 +302,28 @@ SfxImageManager::~SfxImageManager()
 
 //-------------------------------------------------------------------------
 
+namespace
+{
+    typedef boost::unordered_map< SfxModule*, boost::shared_ptr<SfxImageManager> > SfxImageManagerMap;
+
+    class theImageManagerMap :
+        public rtl::Static<SfxImageManagerMap, theImageManagerMap> {};
+}
+
 SfxImageManager* SfxImageManager::GetImageManager( SfxModule* pModule )
 {
     SolarMutexGuard aGuard;
     SfxImageManager* pSfxImageManager(0);
 
-    typedef boost::unordered_map< SfxModule*, boost::shared_ptr<SfxImageManager> > SfxImageManagerMap;
-    static SfxImageManagerMap m_ImageManagerMap;
+    SfxImageManagerMap &rImageManagerMap = theImageManagerMap::get();
 
-    SfxImageManagerMap::const_iterator pIter = m_ImageManagerMap.find(pModule);
-    if ( pIter != m_ImageManagerMap.end() )
+    SfxImageManagerMap::const_iterator pIter = rImageManagerMap.find(pModule);
+    if ( pIter != rImageManagerMap.end() )
         pSfxImageManager = pIter->second.get();
     else
     {
-        m_ImageManagerMap[pModule].reset(new SfxImageManager(pModule));
-        pSfxImageManager = m_ImageManagerMap[pModule].get();
+        rImageManagerMap[pModule].reset(new SfxImageManager(pModule));
+        pSfxImageManager = rImageManagerMap[pModule].get();
     }
     return pSfxImageManager;
 }
commit 7ab1597bf5631290a58c9aaf9736612a7abd4963
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 22:55:31 2011 +0100

    use this pattern throughout

diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx
index b70de47..3329463 100644
--- a/xmloff/source/core/attrlist.cxx
+++ b/xmloff/source/core/attrlist.cxx
@@ -32,8 +32,8 @@
 #include <vector>
 #include <osl/mutex.hxx>
 #include <xmloff/xmltoken.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
+#include <comphelper/servicehelper.hxx>
 
 #include <xmloff/attrlist.hxx>
 
@@ -256,21 +256,15 @@ sal_Int16 SvXMLAttributeList::GetIndexByName( const OUString& rName ) const
     return -1;
 }
 
+namespace
+{
+    class theSvXMLAttributeListUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLAttributeListUnoTunnelId> {};
+}
+
 // XUnoTunnel & co
 const uno::Sequence< sal_Int8 > & SvXMLAttributeList::getUnoTunnelId() throw()
 {
-    static uno::Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theSvXMLAttributeListUnoTunnelId::get().getSeq();
 }
 
 SvXMLAttributeList* SvXMLAttributeList::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index 9fa6dbe..16c0c3d 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -31,8 +31,8 @@
 #include <tools/debug.hxx>
 #include <com/sun/star/xml/AttributeData.hpp>
 #include <rtl/ustrbuf.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
+#include <comphelper/servicehelper.hxx>
 
 #include <xmloff/xmlcnimp.hxx>
 
@@ -109,20 +109,14 @@ sal_uInt16 SvUnoAttributeContainer::getIndexByName(const OUString& aName ) const
     return USHRT_MAX;
 }
 
+namespace
+{
+    class theSvUnoAttributeContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvUnoAttributeContainerUnoTunnelId> {};
+}
+
 const ::com::sun::star::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::getUnoTunnelId() throw()
 {
-    static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theSvUnoAttributeContainerUnoTunnelId::get().getSeq();
 }
 
 SvUnoAttributeContainer* SvUnoAttributeContainer::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index b428e7c..4a167c0 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -34,7 +34,6 @@
 #endif
 #include "unointerfacetouniqueidentifiermapper.hxx"
 #include <osl/mutex.hxx>
-#include <rtl/uuid.h>
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
 #include <comphelper/genericpropertyset.hxx>
@@ -83,6 +82,7 @@
 #include <rtl/logfile.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <comphelper/extract.hxx>
+#include <comphelper/servicehelper.hxx>
 #include "PropertySetMerger.hxx"
 
 #include "svl/urihelper.hxx"
@@ -2089,21 +2089,15 @@ XMLImageMapExport& SvXMLExport::GetImageMapExport()
     return *mpImageMapExport;
 }
 
+namespace
+{
+    class theSvXMLExportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLExportUnoTunnelId> {};
+}
+
 // XUnoTunnel & co
 const uno::Sequence< sal_Int8 > & SvXMLExport::getUnoTunnelId() throw()
 {
-    static uno::Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theSvXMLExportUnoTunnelId::get().getSeq();
 }
 
 SvXMLExport* SvXMLExport::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 5c20e9e..e728270 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -32,7 +32,6 @@
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
 #include <osl/mutex.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
 #include <svl/svarray.hxx>
 #include "unointerfacetouniqueidentifiermapper.hxx"
@@ -59,6 +58,7 @@
 #include <com/sun/star/xml/sax/XLocator.hpp>
 #include <com/sun/star/packages/zip/ZipIOException.hpp>
 #include <comphelper/namecontainer.hxx>
+#include <comphelper/servicehelper.hxx>
 #include <rtl/logfile.hxx>
 #include <tools/string.hxx> // used in StartElement for logging
 #include <cppuhelper/implbase1.hxx>
@@ -464,21 +464,15 @@ SvXMLImport::~SvXMLImport() throw ()
         mxModel->removeEventListener(mxEventListener);
 }
 
+namespace
+{
+    class theSvXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLImportUnoTunnelId> {};
+}
+
 // XUnoTunnel & co
 const uno::Sequence< sal_Int8 > & SvXMLImport::getUnoTunnelId() throw()
 {
-    static uno::Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static uno::Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theSvXMLImportUnoTunnelId::get().getSeq();
 }
 
 SvXMLImport* SvXMLImport::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
diff --git a/xmloff/source/style/StyleMap.cxx b/xmloff/source/style/StyleMap.cxx
index 71cf079..441d204 100644
--- a/xmloff/source/style/StyleMap.cxx
+++ b/xmloff/source/style/StyleMap.cxx
@@ -29,8 +29,8 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_xmloff.hxx"
 #include <osl/mutex.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
+#include <comphelper/servicehelper.hxx>
 
 #include "StyleMap.hxx"
 
@@ -49,23 +49,15 @@ StyleMap::~StyleMap()
 {
 }
 
+namespace
+{
+    class theStyleMapUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theStyleMapUnoTunnelId> {};
+}
 
 // XUnoTunnel & co
 const Sequence< sal_Int8 > & StyleMap::getUnoTunnelId() throw()
 {
-    static Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( reinterpret_cast<sal_uInt8*>( aSeq.getArray() ),
-                            0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theStyleMapUnoTunnelId::get().getSeq();
 }
 
 StyleMap* StyleMap::getImplementation( Reference< XInterface > xInt ) throw()
diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx
index 28d75ff..3a71cd8 100644
--- a/xmloff/source/transform/MutableAttrList.cxx
+++ b/xmloff/source/transform/MutableAttrList.cxx
@@ -30,9 +30,9 @@
 #include "precompiled_xmloff.hxx"
 #include <osl/mutex.hxx>
 #include <xmloff/xmltoken.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
 #include <xmloff/attrlist.hxx>
+#include <comphelper/servicehelper.hxx>
 #include "MutableAttrList.hxx"
 
 using ::rtl::OUString;
@@ -74,22 +74,15 @@ XMLMutableAttributeList::~XMLMutableAttributeList()
     m_xAttrList = 0;
 }
 
+namespace
+{
+    class theXMLMutableAttributeListUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theXMLMutableAttributeListUnoTunnelId> {};
+}
 
 // XUnoTunnel & co
 const Sequence< sal_Int8 > & XMLMutableAttributeList::getUnoTunnelId() throw()
 {
-    static Sequence< sal_Int8 > * pSeq = 0;
-    if( !pSeq )
-    {
-        Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
-        if( !pSeq )
-        {
-            static Sequence< sal_Int8 > aSeq( 16 );
-            rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-            pSeq = &aSeq;
-        }
-    }
-    return *pSeq;
+    return theXMLMutableAttributeListUnoTunnelId::get().getSeq();
 }
 
 // XUnoTunnel
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 4492d7f..958797b 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -28,9 +28,9 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_xmloff.hxx"
-#include <rtl/uuid.h>
 #include <rtl/ustrbuf.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
 #include <xmloff/nmspmap.hxx>
 #include "xmloff/xmlnmspe.hxx"
 #include <xmloff/xmltoken.hxx>
@@ -1996,20 +1996,14 @@ void SAL_CALL OOo2OasisTransformer::Initialize(
     }
 }
 
-
-Sequence< sal_Int8 >  static CreateUnoTunnelId()
+namespace
 {
-    static osl::Mutex aCreateMutex;
-    ::osl::Guard<osl::Mutex> aGuard( aCreateMutex );
-    Sequence< sal_Int8 > aSeq( 16 );
-    rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0,	sal_True );
-    return aSeq;
+    class theOOo2OasisTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOOo2OasisTransformerUnoTunnelId> {};
 }
 
 const Sequence< sal_Int8 > & OOo2OasisTransformer::getUnoTunnelId() throw()
 {
-    static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
-    return aSeq;
+    return theOOo2OasisTransformerUnoTunnelId::get().getSeq();
 }
 
 // XUnoTunnel
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index f481369..ef7cd4c 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -29,7 +29,6 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_xmloff.hxx"
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <rtl/uuid.h>
 #include <rtl/ustrbuf.hxx>
 #include <xmloff/nmspmap.hxx>
 #include "xmloff/xmlnmspe.hxx"
@@ -52,6 +51,7 @@
 #include "TransformerActions.hxx"
 #include "FamilyType.hxx"
 #include <xmloff/xmluconv.hxx>
+#include <comphelper/servicehelper.hxx>
 #include "Oasis2OOo.hxx"
 
 using ::rtl::OUString;
@@ -2005,19 +2005,14 @@ Oasis2OOoTransformer::~Oasis2OOoTransformer() throw()
     XMLEventOASISTransformerContext::FlushEventMap( m_pFormEventMap );
 }
 
-::com::sun::star::uno::Sequence< sal_Int8 >  static CreateUnoTunnelId()
+namespace
 {
-    static osl::Mutex aCreateMutex;
-    Guard<osl::Mutex> aGuard( aCreateMutex );
-    Sequence< sal_Int8 > aSeq( 16 );
-    rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0,	sal_True );
-    return aSeq;
+    class theOasis2OOoTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOasis2OOoTransformerUnoTunnelId> {};
 }
 
 const Sequence< sal_Int8 > & Oasis2OOoTransformer::getUnoTunnelId() throw()
 {
-    static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
-    return aSeq;
+    return theOasis2OOoTransformerUnoTunnelId::get().getSeq();
 }
 
 // XUnoTunnel
commit d9f962e13b7f739d21f0b53c1d55d4a085042365
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 20:38:42 2011 +0100

    don't see why this has to be global

diff --git a/svx/inc/svx/SvxShapeTypes.hxx b/svx/inc/svx/SvxShapeTypes.hxx
index 1f7f08f..3323da1 100644
--- a/svx/inc/svx/SvxShapeTypes.hxx
+++ b/svx/inc/svx/SvxShapeTypes.hxx
@@ -77,11 +77,6 @@ enum SvxShapeTypes
     DRAWING_END = DRAWING_MEDIA
 };
 
-/** List of shape type descriptors corresponding to the
-    <type>SvxShapeTypes</type> enum.
-*/
-extern ShapeTypeDescriptor aSvxShapeTypeList[];
-
 } // end of namespace accessibility
 
 #endif
diff --git a/svx/source/accessibility/SvxShapeTypes.cxx b/svx/source/accessibility/SvxShapeTypes.cxx
index cacfde9..498948a 100644
--- a/svx/source/accessibility/SvxShapeTypes.cxx
+++ b/svx/source/accessibility/SvxShapeTypes.cxx
@@ -95,113 +95,112 @@ AccessibleShape* CreateSvxAccessibleShape (
     }
 }
 
-
-
-ShapeTypeDescriptor aSvxShapeTypeList[] = {
-    ShapeTypeDescriptor (DRAWING_TEXT,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape")),
-        CreateSvxAccessibleShape),
-    ShapeTypeDescriptor (DRAWING_RECTANGLE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")),
-        CreateSvxAccessibleShape),
-    ShapeTypeDescriptor (   DRAWING_ELLIPSE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.EllipseShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_CONTROL,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_CONNECTOR,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_MEASURE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MeasureShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_LINE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_POLY_POLYGON,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyPolygonShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_POLY_LINE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyLineShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_OPEN_BEZIER,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OpenBezierShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_CLOSED_BEZIER,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ClosedBezierShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_OPEN_FREEHAND,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OpenFreeHandShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_CLOSED_FREEHAND,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_POLY_POLYGON_PATH,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_POLY_LINE_PATH,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyLinePathShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_GRAPHIC_OBJECT,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_GROUP,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_OLE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_PAGE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PageShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_CAPTION,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_FRAME,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.FrameShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_PLUGIN,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PluginShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_APPLET,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.AppletShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_3D_SCENE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DSceneObject")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_3D_CUBE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DCubeObject")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_3D_SPHERE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DSphereObject")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_3D_LATHE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DLatheObject")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_3D_EXTRUDE,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_CUSTOM,
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (	DRAWING_TABLE,
-        rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TableShape" ) ),
-        CreateSvxAccessibleShape ),
-    ShapeTypeDescriptor (   DRAWING_MEDIA,
-        rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MediaShape" ) ),
-        CreateSvxAccessibleShape ),
-
-};
-
-
 void RegisterDrawShapeTypes (void)
 {
+    /** List of shape type descriptors corresponding to the
+        <type>SvxShapeTypes</type> enum.
+    */
+    ShapeTypeDescriptor aSvxShapeTypeList[] = {
+        ShapeTypeDescriptor (DRAWING_TEXT,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape")),
+            CreateSvxAccessibleShape),
+        ShapeTypeDescriptor (DRAWING_RECTANGLE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")),
+            CreateSvxAccessibleShape),
+        ShapeTypeDescriptor (   DRAWING_ELLIPSE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.EllipseShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_CONTROL,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_CONNECTOR,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_MEASURE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MeasureShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_LINE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_POLY_POLYGON,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyPolygonShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_POLY_LINE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyLineShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_OPEN_BEZIER,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OpenBezierShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_CLOSED_BEZIER,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ClosedBezierShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_OPEN_FREEHAND,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OpenFreeHandShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_CLOSED_FREEHAND,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_POLY_POLYGON_PATH,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_POLY_LINE_PATH,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyLinePathShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_GRAPHIC_OBJECT,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_GROUP,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_OLE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_PAGE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PageShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_CAPTION,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_FRAME,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.FrameShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_PLUGIN,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PluginShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_APPLET,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.AppletShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_3D_SCENE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DSceneObject")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_3D_CUBE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DCubeObject")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_3D_SPHERE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DSphereObject")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_3D_LATHE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DLatheObject")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_3D_EXTRUDE,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_CUSTOM,
+            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (	DRAWING_TABLE,
+            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TableShape" ) ),
+            CreateSvxAccessibleShape ),
+        ShapeTypeDescriptor (   DRAWING_MEDIA,
+            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MediaShape" ) ),
+            CreateSvxAccessibleShape ),
+
+    };
+
     // Crash while inserting callout with activated accesibility (#i37790#)
     ShapeTypeHandler::Instance().AddShapeTypeList ( DRAWING_END, aSvxShapeTypeList);
 }
 
-
 } // end of namespace accessibility
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 530b3c515fb54544da00707529a46e248a8d06d7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 13:34:49 2011 +0100

    this is overly static for little gain

diff --git a/connectivity/source/commontools/TPrivilegesResultSet.cxx b/connectivity/source/commontools/TPrivilegesResultSet.cxx
index 4cbceb0..4814cda 100644
--- a/connectivity/source/commontools/TPrivilegesResultSet.cxx
+++ b/connectivity/source/commontools/TPrivilegesResultSet.cxx
@@ -49,15 +49,11 @@ OResultSetPrivileges::OResultSetPrivileges( const Reference< XDatabaseMetaData>&
     osl_incrementInterlockedCount( &m_refCount );
     {
         ::rtl::OUString sUserWorkingFor;
-        static Sequence< ::rtl::OUString > sTableTypes;
-        if ( sTableTypes.getLength() == 0 )
-        {
-            // we want all catalogues, all schemas, all tables
-            sTableTypes.realloc(3);
-            sTableTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
-            sTableTypes[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
-            sTableTypes[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));	// just to be sure to include anything else ....
-        }
+        Sequence< ::rtl::OUString > sTableTypes(3);
+        // we want all catalogues, all schemas, all tables
+        sTableTypes[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
+        sTableTypes[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
+        sTableTypes[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));	// just to be sure to include anything else ....
         try
         {
             m_xTables = _rxMeta->getTables(catalog,schemaPattern,tableNamePattern,sTableTypes);
commit a49c63bf2afd92f1de398ae2dc4e2d4b1a1e7c2c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 13:32:08 2011 +0100

    this is overly static for little gain

diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index d5962ec..88fd5a1 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -400,10 +400,10 @@ BoundFrameSets::BoundFrameSets(const Reference<XInterface> xModel)
 
 void FieldParamExporter::Export()
 {
-    static const Type aStringType = ::getCppuType((OUString*)0);
-    static const Type aBoolType = ::getCppuType((sal_Bool*)0);
-    static const Type aSeqType = ::getCppuType((Sequence<OUString>*)0);
-    static const Type aIntType = ::getCppuType((sal_Int32*)0);
+    const Type aStringType = ::getCppuType((OUString*)0);
+    const Type aBoolType = ::getCppuType((sal_Bool*)0);
+    const Type aSeqType = ::getCppuType((Sequence<OUString>*)0);
+    const Type aIntType = ::getCppuType((sal_Int32*)0);
     Sequence<OUString> vParameters(m_xFieldParams->getElementNames());
     for(const OUString* pCurrent=::comphelper::stl_begin(vParameters); pCurrent!=::comphelper::stl_end(vParameters); ++pCurrent)
     {
commit ea121ea4191157fe2fd5114b8d947daa80e35175
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 31 13:31:29 2011 +0100

    this is overly static + double check lock for little gain

diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx
index 775c929..1644c27 100644
--- a/fileaccess/source/FileAccess.cxx
+++ b/fileaccess/source/FileAccess.cxx
@@ -852,18 +852,9 @@ Reference< XInterface > SAL_CALL FileAccess_CreateInstance( const Reference< XMu
 
 Sequence< rtl::OUString > FileAccess_getSupportedServiceNames()
 {
-    static Sequence < rtl::OUString > *pNames = 0;
-    if( ! pNames )
-    {
-        osl::MutexGuard guard( osl::Mutex::getGlobalMutex() );
-        if( !pNames )
-        {
-            static Sequence< rtl::OUString > seqNames(1);
-            seqNames.getArray()[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ));
-            pNames = &seqNames;
-        }
-    }
-    return *pNames;
+    Sequence< rtl::OUString > seqNames(1);
+    seqNames.getArray()[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ));
+    return seqNames;
 }
 
 
commit 40df9af72f9c5c46f113b4cbfbf443b9da65b3b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 30 15:30:27 2011 +0100

    use StaticWithArg

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 8760946..d4b3130 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -57,6 +57,7 @@
 #include "rtl/textenc.h"
 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
+#include "rtl/instance.hxx"
 #include "sal/types.h"
 #include "salhelper/simplereferenceobject.hxx"
 
@@ -150,9 +151,6 @@ bool canRemoveFromLayer(int layer, rtl::Reference< Node > const & node) {
     }
 }
 
-static bool singletonCreated = false;
-static Components * singleton = 0;
-
 }
 
 class Components::WriteThread:
@@ -217,23 +215,19 @@ void Components::WriteThread::run() {
     reference_->clear();
 }
 
+class theComponentsSingleton :
+    public rtl::StaticWithArg<
+        Components,
+        css::uno::Reference< css::uno::XComponentContext >,
+        theComponentsSingleton>
+{
+};
+
 Components & Components::getSingleton(
     css::uno::Reference< css::uno::XComponentContext > const & context)
 {
     OSL_ASSERT(context.is());
-    if (!singletonCreated) {
-        static Components theSingleton(context);
-        singleton = &theSingleton;
-        singletonCreated = true;
-    }
-    if (singleton == 0) {
-        throw css::uno::RuntimeException(
-            rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM(
-                    "configmgr no Components singleton")),
-            css::uno::Reference< css::uno::XInterface >());
-    }
-    return *singleton;
+    return theComponentsSingleton::get(context);
 }
 
 bool Components::allLocales(rtl::OUString const & locale) {
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 9d216e1..26af3fb 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -123,12 +123,13 @@ private:
     typedef void FileParser(
         rtl::OUString const &, int, Data &, Partial const *, Modifications *,
         Additions *);
-
+public:
     Components(
         com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
             const & context);
 
     ~Components();
+private:
 
     void parseFileLeniently(
         FileParser * parseFile, rtl::OUString const & url, int layer,
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 90e5675..f320b99 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -130,7 +130,8 @@ bool RootAccess::isUpdate() const {
     return update_;
 }
 
-RootAccess::~RootAccess() {
+RootAccess::~RootAccess()
+{
     osl::MutexGuard g(*lock_);
     getComponents().removeRootAccess(this);
 }
commit a907fda4679a02f97f90fcc7c29edd168c299566
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 30 11:58:05 2011 +0100

    WaE: unused return value

diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx
index c80355c..9367609 100644
--- a/connectivity/source/drivers/odbcbase/OStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OStatement.cxx
@@ -885,6 +885,7 @@ void OStatement_Base::setFetchSize(sal_Int32 _par0)
         delete m_pRowStatusArray;
         m_pRowStatusArray = new SQLUSMALLINT[_par0];
         nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
+        OSL_UNUSED( nRetCode );
     }
 }
 //------------------------------------------------------------------------------
commit b74ff3634a3f24beff2b54ed15d1b6645f3129e9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 30 09:29:57 2011 +0100

    WaE: inside appropiate ifdefs

diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index 180ac0f..0882370 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -434,7 +434,7 @@ void XMLTextImportPropertyMapper::finished(
     {
         if (pAllParaMargin && !pParaMargins[i])
         {
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 0
             sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
                                         pAllParaMargin->mnIndex + (2*i) + 2 );
             OSL_ENSURE( nTmp >= CTF_PARALEFTMARGIN &&
@@ -446,7 +446,7 @@ void XMLTextImportPropertyMapper::finished(
         }
         if (pAllMargin && !pMargins[i])
         {
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 0
             sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
                                         pAllMargin->mnIndex + i + 1 );
             OSL_ENSURE( nTmp >= CTF_MARGINLEFT && nTmp <= CTF_MARGINBOTTOM,


More information about the Libreoffice-commits mailing list