summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-28 16:19:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-03-28 16:45:16 +0100
commit83d3e6e371cde7e455bf74890c55d747fac6992c (patch)
tree8fc714b887690a7189ca447b896d34b46c62ac69
parent8ae666c4fccb0cfe9d2a36234d0131ba7312f19e (diff)
don't use a global LockListener to avoid startup hit on ctoring
-rw-r--r--svx/source/gallery2/galexpl.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index 45b7b5ae796e..a2c4f02962a2 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -28,6 +28,7 @@
#include <unotools/pathoptions.hxx>
+#include <rtl/instance.hxx>
#include <sfx2/viewfrm.hxx>
#include "svx/gallery1.hxx"
#include "svx/galtheme.hxx"
@@ -35,11 +36,10 @@
#include "svx/gallery.hxx"
#include "galobj.hxx"
-// -----------
-// - Statics -
-// -----------
-
-static SfxListener aLockListener;
+namespace
+{
+ class theLockListener : public rtl::Static< SfxListener, theLockListener > {};
+}
// -------------------
// - GalleryExplorer -
@@ -371,7 +371,7 @@ sal_Bool GalleryExplorer::BeginLocking( const String& rThemeName )
if( pGal )
{
- GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, aLockListener );
+ GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, theLockListener::get() );
if( pTheme )
{
@@ -413,7 +413,7 @@ sal_Bool GalleryExplorer::EndLocking( const String& rThemeName )
if( bReleaseLockedTheme )
{
// release locked theme
- pGal->ReleaseTheme( pTheme, aLockListener );
+ pGal->ReleaseTheme( pTheme, theLockListener::get() );
bRet = sal_True;
}
}