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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 23 08:00:18 UTC 2020


 sw/source/core/docnode/section.cxx |   44 ++++++++++++++-----------------------
 1 file changed, 17 insertions(+), 27 deletions(-)

New commits:
commit 5fc6a601d7a1978db291fd0f7dcec638a7c25651
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sun Nov 22 10:47:20 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Mon Nov 23 08:59:35 2020 +0100

    section.cxx: Remove remaining SwClientNotifyCalls
    
    Change-Id: I569c5952a7491c37c677ad6b6d5f803a50b2e701
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106341
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index a3dad1262b23..00adf5a40f47 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -66,13 +66,6 @@
 using namespace ::com::sun::star;
 
 namespace {
-
-    void lcl_SwClientNotify(sw::BroadcastingModify& rModify, const SfxPoolItem* pOldNew)
-    {
-        const sw::LegacyModifyHint aHint(pOldNew, pOldNew);
-        rModify.SwClientNotifyCall(rModify, aHint);
-    }
-
     class SwIntrnlSectRefLink : public SwBaseLink
     {
         SwSectionFormat& m_rSectFormat;
@@ -318,8 +311,8 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
             // This should be shown by the bHiddenFlag.
 
             // Tell all Children that they are hidden
-            SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN );
-            lcl_SwClientNotify(*pFormat, &aMsgItem);
+            const SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN );
+            pFormat->CallSwClientNotify(sw::LegacyModifyHint(&aMsgItem, &aMsgItem));
 
             // Delete all Frames
             pFormat->DelFrames();
@@ -333,8 +326,8 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
         if( !pParentSect || !pParentSect->IsHiddenFlag() )
         {
             // Tell all Children that the Parent is not hidden anymore
-            SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN );
-            lcl_SwClientNotify(*pFormat, &aMsgItem);
+            const SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN );
+            pFormat->CallSwClientNotify(sw::LegacyModifyHint(&aMsgItem, &aMsgItem));
 
             pFormat->MakeFrames();
         }
@@ -719,8 +712,8 @@ void SwSectionFormat::DelFrames()
     SwContentNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, true, false );
     if( pCNd )
     {
-        const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC );
-        lcl_SwClientNotify(*pCNd, &rItem);
+        const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get(RES_PAGEDESC);
+        pCNd->CallSwClientNotify(sw::LegacyModifyHint(&rItem, &rItem));
     }
 }
 
@@ -945,22 +938,19 @@ void SwSectionFormat::UpdateParent()
         bIsHidden = pPS->IsHiddenFlag();
     }
     SwIterator<SwSectionFormat,SwSectionFormat> aIter(*this);
-    for(SwSectionFormat* pLast = aIter.First(); pLast; pLast = aIter.Next())
-    {
-        if(!pProtect->IsContentProtected() != !pSection->IsProtectFlag())
-            lcl_SwClientNotify(*static_cast<sw::BroadcastingModify*>(pLast), static_cast<SfxPoolItem const *>(pProtect));
+    if(!pProtect->IsContentProtected() != !pSection->IsProtectFlag())
+        CallSwClientNotify(sw::LegacyModifyHint(pProtect, pProtect));
 
-        // edit in readonly sections
-        if(!pEditInReadonly->GetValue() != !pSection->IsEditInReadonlyFlag())
-            lcl_SwClientNotify(*static_cast<sw::BroadcastingModify*>(pLast), static_cast<SfxPoolItem const *>(pEditInReadonly));
+    // edit in readonly sections
+    if(!pEditInReadonly->GetValue() != !pSection->IsEditInReadonlyFlag())
+        CallSwClientNotify(sw::LegacyModifyHint(pEditInReadonly, pEditInReadonly));
 
-        if(bIsHidden == pSection->IsHiddenFlag())
-        {
-            SwMsgPoolItem aMsgItem( static_cast<sal_uInt16>(bIsHidden
-                        ? RES_SECTION_HIDDEN
-                        : RES_SECTION_NOT_HIDDEN ) );
-            lcl_SwClientNotify(*static_cast<sw::BroadcastingModify*>(pLast), &aMsgItem);
-        }
+    if(bIsHidden == pSection->IsHiddenFlag())
+    {
+        SwMsgPoolItem aMsgItem(static_cast<sal_uInt16>(bIsHidden
+                ? RES_SECTION_HIDDEN
+                : RES_SECTION_NOT_HIDDEN));
+        CallSwClientNotify(sw::LegacyModifyHint(&aMsgItem, &aMsgItem));
     }
 }
 


More information about the Libreoffice-commits mailing list