diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-06 11:22:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-06 18:38:22 +0200 |
commit | a7ff945ca031324f060b0d989f7a89594fcfe9fe (patch) | |
tree | ee502330c3e52c59aa2a4c5d97b6307c5a6babe5 /starmath | |
parent | 6668b112b341edd24ca77ba88b834108d67b0602 (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 'starmath')
-rw-r--r-- | starmath/inc/document.hxx | 3 | ||||
-rw-r--r-- | starmath/source/document.cxx | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index c7885c027019..cf52f4497e5b 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -23,6 +23,7 @@ #include <sfx2/docfac.hxx> #include <sfx2/objsh.hxx> #include <svl/lstner.hxx> +#include <svl/itempool.hxx> #include <sax/fshelper.hxx> #include <unotools/lingucfg.hxx> #include <oox/core/filterbase.hxx> @@ -80,7 +81,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener OUString maAccText; SvtLinguOptions maLinguOptions; std::unique_ptr<SmTableNode> mpTree; - SfxItemPool *mpEditEngineItemPool; + std::unique_ptr<SfxItemPool, SfxItemPoolDeleter> mpEditEngineItemPool; std::unique_ptr<EditEngine> mpEditEngine; VclPtr<SfxPrinter> mpPrinter; //q.v. comment to SmPrinter Access! VclPtr<Printer> mpTmpPrinter; //ditto diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 10fee0c6f39c..5dd69cf62944 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -353,12 +353,12 @@ EditEngine& SmDocShell::GetEditEngine() //! see also SmEditWindow::DataChanged ! //! - mpEditEngineItemPool = EditEngine::CreatePool(); + mpEditEngineItemPool.reset( EditEngine::CreatePool() ); const StyleSettings& rStyleSettings = Application::GetDefaultDevice()->GetSettings().GetStyleSettings(); UpdateEditEngineDefaultFonts(rStyleSettings.GetFieldTextColor()); - mpEditEngine.reset( new EditEngine( mpEditEngineItemPool ) ); + mpEditEngine.reset( new EditEngine( mpEditEngineItemPool.get() ) ); mpEditEngine->SetAddExtLeading(true); @@ -630,7 +630,6 @@ void SmDocShell::Repaint() SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) : SfxObjectShell(i_nSfxCreationFlags) - , mpEditEngineItemPool(nullptr) , mpPrinter(nullptr) , mpTmpPrinter(nullptr) , mnModifyCount(0) @@ -660,7 +659,7 @@ SmDocShell::~SmDocShell() mpCursor.reset(); mpEditEngine.reset(); - SfxItemPool::Free(mpEditEngineItemPool); + mpEditEngineItemPool.reset(); mpPrinter.disposeAndClear(); } |