diff options
Diffstat (limited to 'sc/source/ui/app/scdll.cxx')
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 9a14c78ee23f..2e3ba3a9474a 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -102,6 +102,7 @@ #include "dwfunctr.hxx" #include "acredlin.hxx" +#include <o3tl/make_unique.hxx> ScResId::ScResId( sal_uInt16 nId ) : ResId( nId, *SC_MOD()->GetResMgr() ) @@ -110,14 +111,14 @@ ScResId::ScResId( sal_uInt16 nId ) : void ScDLL::Init() { - ScModule **ppShlPtr = reinterpret_cast<ScModule**>(GetAppData(SHL_CALC)); - if ( *ppShlPtr ) + if ( SfxApplication::GetModule(SfxToolsModule::Calc) ) // Module already active return; ScDocumentPool::InitVersionMaps(); // Is needed in the ScModule ctor - ScModule* pMod = new ScModule( &ScDocShell::Factory() ); - (*ppShlPtr) = pMod; + auto pUniqueModule = o3tl::make_unique<ScModule>(&ScDocShell::Factory()); + ScModule* pMod = pUniqueModule.get(); + SfxApplication::SetModule(SfxToolsModule::Calc, std::move(pUniqueModule)); ScDocShell::Factory().SetDocumentServiceName( "com.sun.star.sheet.SpreadsheetDocument" ); |