diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/app.cxx | 19 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 4 |
2 files changed, 14 insertions, 9 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index ee91a5c0c745..aaba69dcc98f 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -121,8 +121,8 @@ using namespace ::com::sun::star; -// Static member -SfxApplication* SfxApplication::pApp = nullptr; +static SfxApplication* g_pSfxApplication = nullptr; + #if HAVE_FEATURE_SCRIPTING static BasicDLL* pBasic = nullptr; #endif @@ -142,20 +142,25 @@ namespace #include <sfx2/imagemgr.hxx> #include "fwkhelper.hxx" +SfxApplication* SfxApplication::Get() +{ + return g_pSfxApplication; +} + SfxApplication* SfxApplication::GetOrCreate() { // SFX on demand ::osl::MutexGuard aGuard(theApplicationMutex::get()); - if (!pApp) + if (!g_pSfxApplication) { SAL_INFO( "sfx.appl", "SfxApplication::SetApp" ); - pApp = new SfxApplication; + g_pSfxApplication = new SfxApplication; // at the moment a bug may occur when Initialize_Impl returns FALSE, // but this is only temporary because all code that may cause such // a fault will be moved outside the SFX - pApp->Initialize_Impl(); + g_pSfxApplication->Initialize_Impl(); ::framework::SetImageProducer( GetImage ); ::framework::SetRefreshToolbars( RefreshToolbars ); @@ -176,7 +181,7 @@ SfxApplication* SfxApplication::GetOrCreate() Help::DisableBalloonHelp(); #endif } - return pApp; + return g_pSfxApplication; } SfxApplication::SfxApplication() @@ -243,7 +248,7 @@ SfxApplication::~SfxApplication() #endif delete pAppData_Impl; - pApp = nullptr; + g_pSfxApplication = nullptr; } diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 71ee4735bbc9..7fef3f9538f5 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -58,8 +58,8 @@ bool getBool(utl::OConfigurationNode const & aNode, const char* pNodeName) ResourceManager& ResourceManager::Instance() { - static ResourceManager maInstance; - return maInstance; + static ResourceManager s_SidebarResourceManagerInstance; + return s_SidebarResourceManagerInstance; } ResourceManager::ResourceManager() |