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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Sun Dec 13 10:16:57 UTC 2020


 sw/source/core/inc/pagefrm.hxx    |    5 --
 sw/source/core/layout/pagechg.cxx |   92 ++++++++++++++++++--------------------
 2 files changed, 46 insertions(+), 51 deletions(-)

New commits:
commit 1d9f243a39169256ebb923afb32fffecf04ac427
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sun Dec 13 01:07:42 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Sun Dec 13 11:16:23 2020 +0100

    pagechg: Modify no more
    
    Change-Id: I571813d6e4fd3c465f77eb7acca9d656440a136a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107648
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 24c6ba554d45..c5ad094e46a8 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -38,7 +38,7 @@ class SwAnchoredObject;
 
 /// A page of the document layout. Upper frame is expected to be an SwRootFrame
 /// instance. At least an SwBodyFrame lower is expected.
-class SAL_DLLPUBLIC_RTTI SwPageFrame: public SwFootnoteBossFrame
+class SAL_DLLPUBLIC_RTTI SwPageFrame final: public SwFootnoteBossFrame
 {
     friend class SwFrame;
 
@@ -99,10 +99,7 @@ class SAL_DLLPUBLIC_RTTI SwPageFrame: public SwFootnoteBossFrame
 
     virtual void DestroyImpl() override;
     virtual ~SwPageFrame() override;
-
-protected:
     virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
-    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
     virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
 
     /// Calculate the content height of a page (without columns).
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index f1e2c35f52f1..611b63753bc1 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -495,52 +495,6 @@ void SwPageFrame::PreparePage( bool bFootnote )
     }
 }
 
-void SwPageFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
-{
-    SwViewShell *pSh = getRootFrame()->GetCurrShell();
-    if ( pSh )
-        pSh->SetFirstVisPageInvalid();
-    sal_uInt8 nInvFlags = 0;
-
-    if( pNew && RES_ATTRSET_CHG == pNew->Which() )
-    {
-        SfxItemIter aNIter( *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet() );
-        SfxItemIter aOIter( *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet() );
-        const SfxPoolItem* pNItem = aNIter.GetCurItem();
-        const SfxPoolItem* pOItem = aOIter.GetCurItem();
-        SwAttrSetChg aOldSet( *static_cast<const SwAttrSetChg*>(pOld) );
-        SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
-        do
-        {
-            UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet);
-            pNItem = aNIter.NextItem();
-            pOItem = aOIter.NextItem();
-        } while (pNItem);
-        if ( aOldSet.Count() || aNewSet.Count() )
-            SwLayoutFrame::Modify( &aOldSet, &aNewSet );
-    }
-    else
-        UpdateAttr_( pOld, pNew, nInvFlags );
-
-    if ( nInvFlags == 0 )
-        return;
-
-    InvalidatePage( this );
-    if ( nInvFlags & 0x01 )
-        InvalidatePrt_();
-    if ( nInvFlags & 0x02 )
-        SetCompletePaint();
-    if ( nInvFlags & 0x04 && GetNext() )
-        GetNext()->InvalidatePos();
-    if ( nInvFlags & 0x08 )
-        PrepareHeader();
-    if ( nInvFlags & 0x10 )
-        PrepareFooter();
-    if ( nInvFlags & 0x20 )
-        CheckGrid( nInvFlags & 0x40 );
-}
-
-
 void SwPageFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
 {
     if(typeid(sw::PageFootnoteHint) == typeid(rHint))
@@ -554,7 +508,51 @@ void SwPageFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
         // here, the page might be destroyed:
         static_cast<SwRootFrame*>(GetUpper())->RemoveFootnotes(nullptr, false, true);
     }
-    else
+    else if(auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
+    {
+        if(auto pSh = getRootFrame()->GetCurrShell())
+            pSh->SetFirstVisPageInvalid();
+
+        sal_uInt8 nInvFlags = 0;
+        if(pLegacy->m_pNew && RES_ATTRSET_CHG == pLegacy->m_pNew->Which())
+        {
+            auto& rOldSetChg = *static_cast<const SwAttrSetChg*>(pLegacy->m_pOld);
+            auto& rNewSetChg = *static_cast<const SwAttrSetChg*>(pLegacy->m_pNew);
+            SfxItemIter aOIter(*rOldSetChg.GetChgSet());
+            SfxItemIter aNIter(*rNewSetChg.GetChgSet());
+            const SfxPoolItem* pOItem = aOIter.GetCurItem();
+            const SfxPoolItem* pNItem = aNIter.GetCurItem();
+            SwAttrSetChg aOldSet(rOldSetChg);
+            SwAttrSetChg aNewSet(rNewSetChg);
+            do
+            {
+                UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet);
+                pOItem = aOIter.NextItem();
+                pNItem = aNIter.NextItem();
+            } while(pNItem);
+            if(aOldSet.Count() || aNewSet.Count())
+                SwLayoutFrame::Modify(&aOldSet, &aNewSet);
+        }
+        else
+            UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, nInvFlags);
+
+        if (nInvFlags == 0)
+            return;
+
+        InvalidatePage( this );
+        if(nInvFlags & 0x01)
+            InvalidatePrt_();
+        if(nInvFlags & 0x02)
+            SetCompletePaint();
+        if(nInvFlags & 0x04 && GetNext() )
+            GetNext()->InvalidatePos();
+        if(nInvFlags & 0x08)
+            PrepareHeader();
+        if(nInvFlags & 0x10)
+            PrepareFooter();
+        if(nInvFlags & 0x20)
+            CheckGrid(nInvFlags & 0x40);
+    } else
         SwFrame::SwClientNotify(rModify, rHint);
 }
 


More information about the Libreoffice-commits mailing list