summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-06 11:22:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-06 18:38:22 +0200
commita7ff945ca031324f060b0d989f7a89594fcfe9fe (patch)
treeee502330c3e52c59aa2a4c5d97b6307c5a6babe5 /sw/source
parent6668b112b341edd24ca77ba88b834108d67b0602 (diff)
add SfxItemPoolDeleter utility
add use so we can hold the pool with std::unique_ptr Change-Id: I685fbc37c0ae145a5b48a66a88eab9fb29a0fc0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115174 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/docnew.cxx3
-rw-r--r--sw/source/uibase/app/swmodule.cxx7
2 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 35306e3c292e..35a59e111406 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -597,8 +597,7 @@ SwDoc::~SwDoc()
mpDfltCharFormat.reset();
mpDfltFrameFormat.reset();
mpLayoutCache.reset();
-
- SfxItemPool::Free(mpAttrPool);
+ mpAttrPool.reset();
}
void SwDoc::SetDocShell( SwDocShell* pDSh )
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index f8e5c016db90..6d15fcf2ff06 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -129,7 +129,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
SfxObjectFactory* pFact,
SfxObjectFactory* pGlobalFact )
: SfxModule("sw", {pWebFact, pFact, pGlobalFact}),
- m_pAttrPool(nullptr),
m_pView(nullptr),
m_bAuthorInitialised(false),
m_bEmbeddedLoadSave( false ),
@@ -332,14 +331,14 @@ void SwDLL::RegisterControls()
void SwModule::InitAttrPool()
{
OSL_ENSURE(!m_pAttrPool, "Pool already exists!");
- m_pAttrPool = new SwAttrPool(nullptr);
- SetPool(m_pAttrPool);
+ m_pAttrPool.reset(new SwAttrPool(nullptr));
+ SetPool(m_pAttrPool.get());
}
void SwModule::RemoveAttrPool()
{
SetPool(nullptr);
- SfxItemPool::Free(m_pAttrPool);
+ m_pAttrPool.reset();
}
std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies()