summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-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
6 files changed, 16 insertions, 16 deletions
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() );
}