summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app/swdll.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/app/swdll.cxx')
-rw-r--r--sw/source/uibase/app/swdll.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx
index 803c2b8cc376..e9fa7f196e31 100644
--- a/sw/source/uibase/app/swdll.cxx
+++ b/sw/source/uibase/app/swdll.cxx
@@ -48,7 +48,7 @@
#include <unomid.h>
#include "swdllimpl.hxx"
-
+#include <o3tl/make_unique.hxx>
using namespace com::sun::star;
namespace
@@ -81,9 +81,7 @@ namespace SwGlobals
SwDLL::SwDLL()
{
- // the SdModule must be created
- SwModule** ppShlPtr = reinterpret_cast<SwModule**>(GetAppData(SHL_WRITER));
- if ( *ppShlPtr )
+ if ( SfxApplication::GetModule(SfxToolsModule::Writer) ) // Module already active
return;
std::unique_ptr<SvtModuleOptions> xOpt;
@@ -99,8 +97,9 @@ SwDLL::SwDLL()
SfxObjectFactory* pWDocFact = &SwWebDocShell::Factory();
- SwModule* pModule = new SwModule( pWDocFact, pDocFact, pGlobDocFact );
- *ppShlPtr = pModule;
+ auto pUniqueModule = o3tl::make_unique<SwModule>(pWDocFact, pDocFact, pGlobDocFact);
+ SwModule* pModule = pUniqueModule.get();
+ SfxApplication::SetModule(SfxToolsModule::Writer, std::move(pUniqueModule));
pWDocFact->SetDocumentServiceName("com.sun.star.text.WebDocument");