[Libreoffice-commits] core.git: sw/inc sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri May 7 19:28:01 UTC 2021


 sw/inc/swatrset.hxx              |    7 -------
 sw/source/core/attr/swatrset.cxx |   36 ++----------------------------------
 2 files changed, 2 insertions(+), 41 deletions(-)

New commits:
commit ea67083cf5b8bceeab7d521663c768b59dd49d1d
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Fri May 7 20:19:08 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 7 21:27:21 2021 +0200

    simplify SwAttrPool code
    
    Change-Id: I1bf94fb65f75e80641df7485b228bd1c80870482
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115245
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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();
 


More information about the Libreoffice-commits mailing list