don't use a global LockListener to avoid startup hit on ctoring

This commit is contained in:
Caolán McNamara
2012-03-28 16:19:53 +01:00
parent 8ae666c4fc
commit 83d3e6e371

View File

@@ -28,6 +28,7 @@
#include <unotools/pathoptions.hxx> #include <unotools/pathoptions.hxx>
#include <rtl/instance.hxx>
#include <sfx2/viewfrm.hxx> #include <sfx2/viewfrm.hxx>
#include "svx/gallery1.hxx" #include "svx/gallery1.hxx"
#include "svx/galtheme.hxx" #include "svx/galtheme.hxx"
@@ -35,11 +36,10 @@
#include "svx/gallery.hxx" #include "svx/gallery.hxx"
#include "galobj.hxx" #include "galobj.hxx"
// ----------- namespace
// - Statics - {
// ----------- class theLockListener : public rtl::Static< SfxListener, theLockListener > {};
}
static SfxListener aLockListener;
// ------------------- // -------------------
// - GalleryExplorer - // - GalleryExplorer -
@@ -371,7 +371,7 @@ sal_Bool GalleryExplorer::BeginLocking( const String& rThemeName )
if( pGal ) if( pGal )
{ {
GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, aLockListener ); GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, theLockListener::get() );
if( pTheme ) if( pTheme )
{ {
@@ -413,7 +413,7 @@ sal_Bool GalleryExplorer::EndLocking( const String& rThemeName )
if( bReleaseLockedTheme ) if( bReleaseLockedTheme )
{ {
// release locked theme // release locked theme
pGal->ReleaseTheme( pTheme, aLockListener ); pGal->ReleaseTheme( pTheme, theLockListener::get() );
bRet = sal_True; bRet = sal_True;
} }
} }