summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorMark Page <aptitude@btconnect.com>2016-07-04 17:30:42 +0100
committerNoel Grandin <noelgrandin@gmail.com>2016-07-13 06:32:46 +0000
commitf7b1cd66167050afecf487e3d89ea12de74200b5 (patch)
tree75381b63bb5dca7ed1fa2ff5602064750f46f042 /basctl
parent633413a37ee7442cd899db1269fd3ef404efe58a (diff)
Moved SfxModule owner to SfxApplication
::GetAppData replaced with SfxApplication::GetModule that now returns SfxModule* SfxModule no longer registers self for ownership instead it is now registered using SfxApplication::SetModule Change-Id: Ifbbe1b2b4c5122da8e643b7926d47878d116c6c8 Reviewed-on: https://gerrit.libreoffice.org/26914 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/basicmod.hxx3
-rw-r--r--basctl/source/basicide/iderdll.cxx12
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" );