simplify SwAttrPool code

Change-Id: I1bf94fb65f75e80641df7485b228bd1c80870482
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115245
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2021-05-07 21:27:21 +02:00
committed by Noel Grandin
parent 1ef26ffe39
commit ea67083cf5
2 changed files with 2 additions and 41 deletions
-7
View File
@@ -135,13 +135,6 @@ namespace vcl {
class SAL_DLLPUBLIC_RTTI SwAttrPool final : public SfxItemPool
{
private:
// helpers to add/remove DrawingLayer ItemPool, used in constructor
// and destructor; still isolated to evtl. allow other use later, but
// used bz default now to have it instantly as needed for DrawingLayer
// FillStyle support
void createAndAddSecondaryPools();
void removeAndDeleteSecondaryPools();
friend void InitCore(); // For creating/deleting of version maps.
friend void FinitCore();
+2 -34
View File
@@ -48,26 +48,6 @@ SwAttrPool::SwAttrPool( SwDoc* pD )
aSlotTab, &aAttrTab ),
m_pDoc( pD )
{
// create secondary pools immediately
createAndAddSecondaryPools();
}
SwAttrPool::~SwAttrPool()
{
// cleanup secondary pools first
removeAndDeleteSecondaryPools();
}
void SwAttrPool::createAndAddSecondaryPools()
{
const SfxItemPool* pCheckAlreadySet = GetSecondaryPool();
if(pCheckAlreadySet)
{
OSL_ENSURE(false, "SwAttrPool already has a secondary pool (!)");
return;
}
// 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
@@ -103,24 +83,12 @@ void SwAttrPool::createAndAddSecondaryPools()
}
}
void SwAttrPool::removeAndDeleteSecondaryPools()
SwAttrPool::~SwAttrPool()
{
// cleanup secondary pools
SfxItemPool *pSdrPool = GetSecondaryPool();
if(!pSdrPool)
{
OSL_ENSURE(false, "SwAttrPool has no secondary pool, it's missing (!)");
return;
}
SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
if(!pEEgPool)
{
OSL_ENSURE(false, "i don't accept additional pools");
return;
}
// first delete the items, then break the linking
pSdrPool->Delete();