summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-07 22:06:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-08 17:36:54 +0200
commit1545949690c750d7b512000723b564e69cf3c3a6 (patch)
tree1463c8b2912a9e269fe8b7ef3f7326dc85173830 /sc
parentc10ce2698a3b001d22db3d33f2f43513cc49ebda (diff)
ref-count SfxItemPool
so we can remove SfxItemPoolUser, which is a right performance hog when we have large calc spreadsheets Change-Id: I344002f536f6eead5cf98c6647dd1667fd9c8874 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115247 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/docpool.hxx2
-rw-r--r--sc/inc/editutil.hxx2
-rw-r--r--sc/inc/scmod.hxx2
-rw-r--r--sc/source/core/data/attrib.cxx2
-rw-r--r--sc/source/core/data/docpool.cxx2
-rw-r--r--sc/source/core/data/poolhelp.cxx16
-rw-r--r--sc/source/core/data/stlpool.cxx2
-rw-r--r--sc/source/core/inc/poolhelp.hxx6
-rw-r--r--sc/source/core/tool/editutil.cxx4
-rw-r--r--sc/source/filter/excel/xlroot.cxx2
-rw-r--r--sc/source/filter/inc/eeparser.hxx4
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx4
-rw-r--r--sc/source/filter/xml/xmlfonte.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx16
-rw-r--r--sc/source/ui/app/inputhdl.cxx2
-rw-r--r--sc/source/ui/app/inputwin.cxx4
-rw-r--r--sc/source/ui/app/scmod.cxx4
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx2
-rw-r--r--sc/source/ui/inc/msgpool.hxx2
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx2
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx4
-rw-r--r--sc/source/ui/unoobj/textuno.cxx16
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/preview.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx2
25 files changed, 55 insertions, 55 deletions
diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx
index 3622aa38a68e..9280fb3602b0 100644
--- a/sc/inc/docpool.hxx
+++ b/sc/inc/docpool.hxx
@@ -37,7 +37,7 @@ private:
virtual ~ScDocumentPool() override;
public:
- virtual SfxItemPool* Clone() const override;
+ virtual rtl::Reference<SfxItemPool> Clone() const override;
virtual MapUnit GetMetric( sal_uInt16 nWhich ) const override;
void StyleDeleted( const ScStyleSheet* pStyle ); // delete templates(?) in organizer
diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index 53664009b428..efec08dfdbc5 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -108,7 +108,7 @@ public:
class ScEnginePoolHelper
{
protected:
- SfxItemPool* pEnginePool;
+ rtl::Reference<SfxItemPool> pEnginePool;
SfxItemSet* pDefaults;
bool bDeleteEnginePool;
bool bDeleteDefaults;
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 6847142a09a9..8f2a1b34ea8f 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -82,7 +82,7 @@ class SAL_DLLPUBLIC_RTTI ScModule final : public SfxModule, public SfxListener,
Timer m_aIdleTimer;
std::unique_ptr<ScDragData> m_pDragData;
ScSelectionTransferObj* m_pSelTransfer;
- std::unique_ptr<ScMessagePool, SfxItemPoolDeleter> m_pMessagePool;
+ rtl::Reference<ScMessagePool> m_pMessagePool;
// there is no global InputHandler anymore, each View has its own
ScInputHandler* m_pRefInputHandler;
std::unique_ptr<ScViewCfg, o3tl::default_delete<ScViewCfg>> m_pViewCfg;
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 0466ac44f7d9..fc83491845bb 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -431,7 +431,7 @@ bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ )
if ( !pLeftArea || !pCenterArea || !pRightArea )
{
// no Text with Null are left
- ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), true );
+ ScEditEngineDefaulter aEngine( EditEngine::CreatePool().get(), true );
if (!pLeftArea)
pLeftArea = aEngine.CreateTextObject();
if (!pCenterArea)
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 0a96c3b4ee5d..628c3686e2d0 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -376,7 +376,7 @@ void ScDocumentPool::CellStyleCreated( std::u16string_view rName, const ScDocume
}
}
-SfxItemPool* ScDocumentPool::Clone() const
+rtl::Reference<SfxItemPool> ScDocumentPool::Clone() const
{
return new SfxItemPool (*this, true);
}
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index 2091bf167d9c..bd27a96c46cb 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -37,27 +37,29 @@ ScPoolHelper::ScPoolHelper( ScDocument& rSourceDoc )
ScPoolHelper::~ScPoolHelper()
{
- pEnginePool.reset();
- pEditPool.reset();
+ pEnginePool.clear();
+ pEditPool.clear();
pFormTable.reset();
mxStylePool.clear();
- pDocPool.reset();
+ pDocPool.clear();
}
-SfxItemPool* ScPoolHelper::GetEditPool() const
+
+SfxItemPool* ScPoolHelper::GetEditPool() const
{
if ( !pEditPool )
{
- pEditPool.reset(EditEngine::CreatePool());
+ pEditPool = EditEngine::CreatePool();
pEditPool->SetDefaultMetric( MapUnit::Map100thMM );
pEditPool->FreezeIdRanges();
}
return pEditPool.get();
}
-SfxItemPool* ScPoolHelper::GetEnginePool() const
+
+SfxItemPool* ScPoolHelper::GetEnginePool() const
{
if ( !pEnginePool )
{
- pEnginePool.reset(EditEngine::CreatePool());
+ pEnginePool = EditEngine::CreatePool();
pEnginePool->SetDefaultMetric( MapUnit::Map100thMM );
pEnginePool->FreezeIdRanges();
} // ifg ( pEnginePool )
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index b4074c1773b5..8248218b14c3 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -218,7 +218,7 @@ void ScStyleSheetPool::CreateStandardStyles()
SfxItemSet* pSet = nullptr;
SfxItemSet* pHFSet = nullptr;
SvxSetItem* pHFSetItem = nullptr;
- std::unique_ptr<ScEditEngineDefaulter> pEdEngine(new ScEditEngineDefaulter( EditEngine::CreatePool(), true ));
+ std::unique_ptr<ScEditEngineDefaulter> pEdEngine(new ScEditEngineDefaulter( EditEngine::CreatePool().get(), true ));
pEdEngine->SetUpdateMode( false );
std::unique_ptr<EditTextObject> pEmptyTxtObj = pEdEngine->CreateTextObject();
std::unique_ptr<EditTextObject> pTxtObj;
diff --git a/sc/source/core/inc/poolhelp.hxx b/sc/source/core/inc/poolhelp.hxx
index 267d60ea8eeb..ad725fcf82d8 100644
--- a/sc/source/core/inc/poolhelp.hxx
+++ b/sc/source/core/inc/poolhelp.hxx
@@ -36,11 +36,11 @@ class ScPoolHelper final : public salhelper::SimpleReferenceObject
private:
mutable osl::Mutex maMtxCreateNumFormatter;
ScDocOptions aOpt;
- std::unique_ptr<ScDocumentPool, SfxItemPoolDeleter> pDocPool;
+ rtl::Reference<ScDocumentPool> pDocPool;
rtl::Reference< ScStyleSheetPool > mxStylePool;
mutable std::unique_ptr<SvNumberFormatter> pFormTable;
- mutable std::unique_ptr<SfxItemPool, SfxItemPoolDeleter> pEditPool; // EditTextObjectPool
- mutable std::unique_ptr<SfxItemPool, SfxItemPoolDeleter> pEnginePool; // EditEnginePool
+ mutable rtl::Reference<SfxItemPool> pEditPool; // EditTextObjectPool
+ mutable rtl::Reference<SfxItemPool> pEnginePool; // EditEnginePool
ScDocument& m_rSourceDoc;
public:
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index c567e36b7b55..b47c2bd7ee39 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -510,8 +510,6 @@ ScEnginePoolHelper::~ScEnginePoolHelper()
{
if ( bDeleteDefaults )
delete pDefaults;
- if ( bDeleteEnginePool )
- SfxItemPool::Free(pEnginePool);
}
ScEditEngineDefaulter::ScEditEngineDefaulter( SfxItemPool* pEnginePoolP,
@@ -529,7 +527,7 @@ ScEditEngineDefaulter::ScEditEngineDefaulter( SfxItemPool* pEnginePoolP,
ScEditEngineDefaulter::ScEditEngineDefaulter( const ScEditEngineDefaulter& rOrg )
:
ScEnginePoolHelper( rOrg ),
- EditEngine( pEnginePool )
+ EditEngine( pEnginePool.get() )
{
SetDefaultLanguage( ScGlobal::GetEditDefaultLanguage() );
}
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 7bc880988549..c232b6082b2f 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -372,7 +372,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
{
if( !mrData.mxHFEditEngine )
{
- mrData.mxHFEditEngine = std::make_shared<ScHeaderEditEngine>( EditEngine::CreatePool() );
+ mrData.mxHFEditEngine = std::make_shared<ScHeaderEditEngine>( EditEngine::CreatePool().get() );
ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine;
rEE.SetRefMapMode(MapMode(MapUnit::MapTwip)); // headers/footers use twips as default metric
rEE.SetUpdateMode( false );
diff --git a/sc/source/filter/inc/eeparser.hxx b/sc/source/filter/inc/eeparser.hxx
index c691ca3abb9d..190caa4ec14e 100644
--- a/sc/source/filter/inc/eeparser.hxx
+++ b/sc/source/filter/inc/eeparser.hxx
@@ -100,8 +100,8 @@ class ScEEParser
{
protected:
EditEngine* pEdit;
- std::unique_ptr<SfxItemPool, SfxItemPoolDeleter> pPool;
- std::unique_ptr<SfxItemPool, SfxItemPoolDeleter> pDocPool;
+ rtl::Reference<SfxItemPool> pPool;
+ rtl::Reference<SfxItemPool> pDocPool;
std::vector<std::shared_ptr<ScEEParseEntry>> maList;
std::shared_ptr<ScEEParseEntry> mxActEntry;
ColWidthsMap maColWidths;
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 6511a806e295..b4aee6644918 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -637,8 +637,8 @@ ScEEParser::~ScEEParser()
// Don't delete Pool until the lists have been deleted
pPool->SetSecondaryPool( nullptr );
- pDocPool.reset();
- pPool.reset();
+ pDocPool.clear();
+ pPool.clear();
}
void ScEEParser::NewActEntry( const ScEEParseEntry* pE )
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx
index 9b2ee6286b01..76782d1f6dae 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -36,7 +36,7 @@ class ScXMLFontAutoStylePool_Impl: public XMLFontAutoStylePool
{
private:
// #i120077# remember owned pool
- std::unique_ptr<SfxItemPool, SfxItemPoolDeleter> mpEditEnginePool;
+ rtl::Reference<SfxItemPool> mpEditEnginePool;
void AddFontItems(const sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const bool bExportDefaults);
@@ -101,7 +101,7 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP,
// #i120077# remember the SfxItemPool in member variable before usage. The
// local EditEngine will not take over ownership of the pool.
- mpEditEnginePool.reset(EditEngine::CreatePool());
+ mpEditEnginePool = EditEngine::CreatePool();
EditEngine aEditEngine(mpEditEnginePool.get());
while (pStyle)
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 31f8586e1054..54f8f15f49fc 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -816,9 +816,9 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder()
ResetEditMode();
if (!mpEditEngine)
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true);
+ mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true);
mbEditEngineCreated = true;
mpEditEngine->EnableUndo( false );
mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
@@ -1020,9 +1020,9 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
}
else
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) );
+ pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) );
}
pEditEngine->EnableUndo( false );
if (pDocShell)
@@ -1122,9 +1122,9 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
{
if (!mpEditEngine)
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool ));
+ std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool.get() ));
pHdrEngine->EnableUndo( false );
pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
@@ -1237,9 +1237,9 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
}
else
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- mpEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) );
+ mpEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) );
}
mpEditEngine->EnableUndo( false );
if (mpDocSh)
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 69b6142d702f..ff6459f2ee7c 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -872,7 +872,7 @@ void ScInputHandler::ImplCreateEditEngine()
mpEditEngine = std::make_unique<ScFieldEditEngine>(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool());
}
else
- mpEditEngine = std::make_unique<ScFieldEditEngine>(nullptr, EditEngine::CreatePool(), nullptr, true);
+ mpEditEngine = std::make_unique<ScFieldEditEngine>(nullptr, EditEngine::CreatePool().get(), nullptr, true);
mpEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( mpEditEngine->GetWordDelimiters() ) );
UpdateRefDevice(); // also sets MapMode
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 670ccf6e9e06..a571d32fe0d7 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1485,7 +1485,7 @@ void ScTextWnd::InitEditEngine()
pNew = std::make_unique<ScFieldEditEngine>(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool());
}
else
- pNew = std::make_unique<ScFieldEditEngine>(nullptr, EditEngine::CreatePool(), nullptr, true);
+ pNew = std::make_unique<ScFieldEditEngine>(nullptr, EditEngine::CreatePool().get(), nullptr, true);
pNew->SetExecuteURL( false );
m_xEditEngine = std::move(pNew);
@@ -1988,7 +1988,7 @@ void ScTextWnd::MakeDialogEditView()
pNew = std::make_unique<ScFieldEditEngine>(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool());
}
else
- pNew = std::make_unique<ScFieldEditEngine>(nullptr, EditEngine::CreatePool(), nullptr, true);
+ pNew = std::make_unique<ScFieldEditEngine>(nullptr, EditEngine::CreatePool().get(), nullptr, true);
pNew->SetExecuteURL( false );
m_xEditEngine = std::move(pNew);
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 59ac6be2b17d..d8a25bd3a152 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -145,7 +145,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
m_aIdleTimer.SetInvokeHandler( LINK( this, ScModule, IdleHandler ) );
m_aIdleTimer.Start();
- m_pMessagePool.reset(new ScMessagePool);
+ m_pMessagePool = new ScMessagePool;
m_pMessagePool->FreezeIdRanges();
SetPool( m_pMessagePool.get() );
ScGlobal::InitTextHeight( m_pMessagePool.get() );
@@ -159,7 +159,7 @@ ScModule::~ScModule()
// InputHandler does not need to be deleted (there's none in the App anymore)
- m_pMessagePool.reset();
+ m_pMessagePool.clear();
m_pDragData.reset();
m_pErrorHdl.reset();
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index a732039c788f..1d05d38f1d3f 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -77,7 +77,7 @@ ScCsvGrid::ScCsvGrid(const ScCsvLayoutData& rData, std::unique_ptr<weld::Menu> x
, mpGridDev( VclPtr<VirtualDevice>::Create() )
, mxPopup(std::move(xPopup))
, mpColorConfig( nullptr )
- , mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), true ) )
+ , mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool().get(), true ) )
, maColStates( 1 )
, maTypeNames( 1 )
, mnFirstImpLine( 0 )
diff --git a/sc/source/ui/inc/msgpool.hxx b/sc/source/ui/inc/msgpool.hxx
index b9a430d6ae4f..926fb38bf158 100644
--- a/sc/source/ui/inc/msgpool.hxx
+++ b/sc/source/ui/inc/msgpool.hxx
@@ -43,7 +43,7 @@ class ScMessagePool final : public SfxItemPool
ScCondFormatDlgItem aCondFormatDlgItem;
std::vector<SfxPoolItem*> mvPoolDefaults;
- std::unique_ptr<ScDocumentPool, SfxItemPoolDeleter> pDocPool;
+ rtl::Reference<ScDocumentPool> pDocPool;
public:
ScMessagePool();
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 932b635fe37a..403d6148454a 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -64,7 +64,7 @@ ScEditWindow::ScEditWindow(ScEditWindowLocation eLoc, weld::Window* pDialog)
void ScEditWindow::makeEditEngine()
{
- m_xEditEngine.reset(new ScHeaderEditEngine(EditEngine::CreatePool()));
+ m_xEditEngine.reset(new ScHeaderEditEngine(EditEngine::CreatePool().get()));
}
ScHeaderEditEngine* ScEditWindow::GetEditEngine() const
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index 6b3fa37447e6..231f080fa9da 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -141,9 +141,9 @@ SvxTextForwarder* ScAnnotationEditSource::GetTextForwarder()
}
else
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- pEditEngine.reset( new ScEditEngineDefaulter( pEnginePool, true ) );
+ pEditEngine.reset( new ScEditEngineDefaulter( pEnginePool.get(), true ) );
}
pForwarder.reset( new SvxEditEngineForwarder(*pEditEngine) );
}
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index d04a2647db76..27c46f7513c2 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -185,9 +185,9 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder()
{
if (!pEditEngine)
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool ));
+ std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool.get() ));
pHdrEngine->EnableUndo( false );
pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
@@ -330,7 +330,7 @@ OUString SAL_CALL ScHeaderFooterTextObj::getString()
if (pData)
{
// for pure text, no font info is needed in pool defaults
- ScHeaderEditEngine aEditEngine( EditEngine::CreatePool() );
+ ScHeaderEditEngine aEditEngine( EditEngine::CreatePool().get() );
ScHeaderFieldData aData;
FillDummyFieldData( aData );
@@ -347,7 +347,7 @@ void SAL_CALL ScHeaderFooterTextObj::setString( const OUString& aText )
SolarMutexGuard aGuard;
// for pure text, no font info is needed in pool defaults
- ScHeaderEditEngine aEditEngine(EditEngine::CreatePool());
+ ScHeaderEditEngine aEditEngine(EditEngine::CreatePool().get());
aEditEngine.SetTextCurrentDefaults( aText );
aTextData.UpdateData(aEditEngine);
}
@@ -700,11 +700,11 @@ UNO3_GETIMPLEMENTATION2_IMPL(ScDrawTextCursor, SvxUnoTextCursor);
ScSimpleEditSourceHelper::ScSimpleEditSourceHelper()
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->SetDefaultMetric( MapUnit::Map100thMM );
pEnginePool->FreezeIdRanges();
- pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) ); // TRUE: become owner of pool
+ pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) ); // TRUE: become owner of pool
pForwarder.reset( new SvxEditEngineForwarder( *pEditEngine ) );
pOriginalSource.reset( new ScSimpleEditSource( pForwarder.get() ) );
}
@@ -788,9 +788,9 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
}
else
{
- SfxItemPool* pEnginePool = EditEngine::CreatePool();
+ rtl::Reference<SfxItemPool> pEnginePool = EditEngine::CreatePool();
pEnginePool->FreezeIdRanges();
- pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) );
+ pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) );
}
// currently, GetPortions doesn't work if UpdateMode is sal_False,
// this will be fixed (in EditEngine) by src600
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index d12ccee4f779..bfee8d45eb15 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1662,7 +1662,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
else
{
// use EditEngine to draw mixed-script string
- pEditEng.reset(new ScEditEngineDefaulter( EditEngine::CreatePool(), true ));
+ pEditEng.reset(new ScEditEngineDefaulter( EditEngine::CreatePool().get(), true ));
pEditEng->SetRefMapMode(rRenderContext.GetMapMode());
auto pEditDefaults = std::make_unique<SfxItemSet>( pEditEng->GetEmptyItemSet() );
rDefPattern.FillEditItemSet( pEditDefaults.get() );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index e07511ccd907..b4b5e4d3ea80 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -505,7 +505,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
rDoc.GetPool()->GetDefaultItem(ATTR_PATTERN);
std::unique_ptr<ScEditEngineDefaulter> pEditEng(
- new ScEditEngineDefaulter(EditEngine::CreatePool(), true));
+ new ScEditEngineDefaulter(EditEngine::CreatePool().get(), true));
pEditEng->SetRefMapMode(aMMMode);
auto pEditDefaults = std::make_unique<SfxItemSet>( pEditEng->GetEmptyItemSet() );
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 3828c031cc3c..128f726d1c76 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1701,7 +1701,7 @@ void ScPrintFunc::MakeEditEngine()
{
// can't use document's edit engine pool here,
// because pool must have twips as default metric
- pEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool() ) );
+ pEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool().get() ) );
pEditEngine->EnableUndo(false);
//fdo#45869 we want text to be positioned as it would be for the