diff options
Diffstat (limited to 'basctl/source')
-rw-r--r-- | basctl/source/basicide/basicmod.hxx | 3 | ||||
-rw-r--r-- | basctl/source/basicide/iderdll.cxx | 12 |
2 files changed, 5 insertions, 10 deletions
diff --git a/basctl/source/basicide/basicmod.hxx b/basctl/source/basicide/basicmod.hxx index 3bed4f242452..ffc960cea598 100644 --- a/basctl/source/basicide/basicmod.hxx +++ b/basctl/source/basicide/basicmod.hxx @@ -28,13 +28,10 @@ namespace basctl class Module : public SfxModule { - static Module* mpModule; public: Module ( ResMgr *pMgr, SfxObjectFactory *pObjFact) : SfxModule( pMgr, {pObjFact} ) { } -public: - static Module*& Get () { return mpModule; } }; } // namespace basctl diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx index 19d5961eb93b..2ea8a295d113 100644 --- a/basctl/source/basicide/iderdll.cxx +++ b/basctl/source/basicide/iderdll.cxx @@ -32,7 +32,7 @@ #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/script/XLibraryContainerPassword.hpp> #include <vcl/settings.hxx> - +#include <o3tl/make_unique.hxx> namespace basctl { @@ -40,8 +40,6 @@ namespace basctl using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -Module* Module::mpModule = nullptr; - namespace { @@ -106,7 +104,7 @@ ExtraData* GetExtraData() IDEResId::IDEResId( sal_uInt16 nId ): - ResId(nId, *Module::Get()->GetResMgr()) + ResId(nId, *SfxApplication::GetModule(SfxToolsModule::Basic)->GetResMgr()) { } namespace @@ -121,12 +119,12 @@ Dll::Dll () : ResMgr* pMgr = ResMgr::CreateResMgr( "basctl", Application::GetSettings().GetUILanguageTag()); - Module::Get() = new Module( pMgr, &DocShell::Factory() ); + auto pModule = o3tl::make_unique<Module>( pMgr, &DocShell::Factory() ); + SfxModule* pMod = pModule.get(); + SfxApplication::SetModule(SfxToolsModule::Basic, std::move(pModule)); GetExtraData(); // to cause GlobalErrorHdl to be set - SfxModule* pMod = Module::Get(); - SfxObjectFactory& rFactory = DocShell::Factory(); rFactory.SetDocumentServiceName( "com.sun.star.script.BasicIDE" ); |