summaryrefslogtreecommitdiff
path: root/sw
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
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')
-rw-r--r--sw/inc/swatrset.hxx7
-rw-r--r--sw/source/core/attr/swatrset.cxx36
2 files changed, 2 insertions, 41 deletions
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 8208ad150e8c..02e82d5fa085 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -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();
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();