diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/attr/swatrset.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/swmodule.cxx | 4 |
3 files changed, 6 insertions, 14 deletions
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index f3b57d21a73c..1ec1d93323e1 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -51,7 +51,7 @@ SwAttrPool::SwAttrPool( SwDoc* pD ) // create SfxItemPool and EditEngine pool and add these in a chain. These // belong us and will be removed/destroyed in removeAndDeleteSecondaryPools() used from // the destructor - SfxItemPool *pSdrPool = new SdrItemPool(this); + rtl::Reference<SfxItemPool> pSdrPool = new SdrItemPool(this); // #75371# change DefaultItems for the SdrEdgeObj distance items // to TWIPS. @@ -69,9 +69,9 @@ SwAttrPool::SwAttrPool( SwDoc* pD ) pSdrPool->SetPoolDefaultItem(makeSdrShadowXDistItem(nDefShadowDist)); pSdrPool->SetPoolDefaultItem(makeSdrShadowYDistItem(nDefShadowDist)); - SfxItemPool *pEEgPool = EditEngine::CreatePool(); + rtl::Reference<SfxItemPool> pEEgPool = EditEngine::CreatePool(); - pSdrPool->SetSecondaryPool(pEEgPool); + pSdrPool->SetSecondaryPool(pEEgPool.get()); if(!GetFrozenIdRanges()) { @@ -87,17 +87,9 @@ SwAttrPool::~SwAttrPool() { // cleanup secondary pools SfxItemPool *pSdrPool = GetSecondaryPool(); - SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool(); - // first delete the items, then break the linking pSdrPool->Delete(); - SetSecondaryPool(nullptr); - pSdrPool->SetSecondaryPool(nullptr); - - // final cleanup of secondary pool(s) - SfxItemPool::Free(pSdrPool); - SfxItemPool::Free(pEEgPool); } SwAttrSet::SwAttrSet( SwAttrPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2 ) diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 35a59e111406..a674beb9fde6 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -597,7 +597,7 @@ SwDoc::~SwDoc() mpDfltCharFormat.reset(); mpDfltFrameFormat.reset(); mpLayoutCache.reset(); - mpAttrPool.reset(); + mpAttrPool.clear(); } void SwDoc::SetDocShell( SwDocShell* pDSh ) diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 6d15fcf2ff06..485bb7a52d41 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -331,14 +331,14 @@ void SwDLL::RegisterControls() void SwModule::InitAttrPool() { OSL_ENSURE(!m_pAttrPool, "Pool already exists!"); - m_pAttrPool.reset(new SwAttrPool(nullptr)); + m_pAttrPool = new SwAttrPool(nullptr); SetPool(m_pAttrPool.get()); } void SwModule::RemoveAttrPool() { SetPool(nullptr); - m_pAttrPool.reset(); + m_pAttrPool.clear(); } std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies() |