summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-05-07 20:19:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-07 21:27:21 +0200
commitea67083cf5b8bceeab7d521663c768b59dd49d1d (patch)
treec96e0aa734bf48fde53b8fb6b11a74f96c819ffc /sw/source
parent1ef26ffe39618a745d3367310565e7eeb184a4c2 (diff)
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>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/attr/swatrset.cxx36
1 files changed, 2 insertions, 34 deletions
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 24138b51f6bb..f3b57d21a73c 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -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();