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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 3 21:47:42 UTC 2021


 sw/inc/anchoredobject.hxx                |    2 +
 sw/inc/calbck.hxx                        |    6 -----
 sw/source/core/attr/calbck.cxx           |   33 +++++++++++--------------------
 sw/source/core/attr/format.cxx           |    2 -
 sw/source/core/doc/CntntIdxStore.cxx     |    6 ++---
 sw/source/core/docnode/node.cxx          |    4 +--
 sw/source/core/edit/editsh.cxx           |    4 +--
 sw/source/core/fields/reffld.cxx         |    4 +--
 sw/source/core/layout/anchoredobject.cxx |   11 ++++++----
 sw/source/core/layout/pagechg.cxx        |    4 +--
 sw/source/core/layout/pagedesc.cxx       |    2 -
 sw/source/core/tox/tox.cxx               |    2 -
 sw/source/core/txtnode/atrfld.cxx        |    2 -
 sw/source/core/txtnode/atrftn.cxx        |    2 -
 sw/source/core/txtnode/atrref.cxx        |    2 -
 sw/source/core/txtnode/ndtxt.cxx         |   18 ++++++++--------
 sw/source/core/txtnode/thints.cxx        |    6 ++---
 sw/source/core/txtnode/txtedt.cxx        |    8 +++----
 sw/source/core/unocore/unoobj.cxx        |    2 -
 19 files changed, 56 insertions(+), 64 deletions(-)

New commits:
commit 96bafa464ebdbce3ef04bec9beae5e745bb37794
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sat Jan 2 16:11:30 2021 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Sun Jan 3 22:47:00 2021 +0100

    NotifyClients no more
    
    ... and prevent recursive invalidation in SwAnchoredObject.
    
    Change-Id: I6f386f3ffded29663fcc74c2679b76c1b839f367
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108604
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index 5309602f9ef0..50391e966bae 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -107,6 +107,8 @@ class SW_DLLPUBLIC SwAnchoredObject
         // The boolean is reset to <false>, when the layout process for a
         // page frame starts.
         bool mbTmpConsiderWrapInfluence;
+        // tdf#128198: prevent recursive invalidation
+        bool mbInvalidatingObjects;
 
         mutable SwRect maObjRectWithSpaces;
         mutable bool mbObjRectWithSpacesValid;
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index e469c3dd4134..b10058322813 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -187,11 +187,7 @@ public:
         : SwClient(), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bInCache(false), m_bInSwFntCache(false)
     {}
 
-    // broadcasting: send notifications to all clients
-    // DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
-    void NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue );
-
-    // a more universal broadcasting mechanism
+    // broadcasting mechanism
     virtual void CallSwClientNotify( const SfxHint& rHint ) const;
 
     virtual ~SwModify() override;
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index c14baebc7f22..25c19a6d2015 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -145,9 +145,8 @@ SwModify::~SwModify()
     if ( IsInSwFntCache() )
         pSwFontCache->Delete( this );
 
-    // notify all clients that they shall remove themselves
     SwPtrMsgPoolItem aDyObject( RES_OBJECTDYING, this );
-    NotifyClients( &aDyObject, &aDyObject );
+    SwModify::SwClientNotify(*this, sw::LegacyModifyHint(&aDyObject, &aDyObject));
 
     // remove all clients that have not done themselves
     // mba: possibly a hotfix for forgotten base class calls?!
@@ -155,24 +154,6 @@ SwModify::~SwModify()
         static_cast<SwClient*>(m_pWriterListeners)->CheckRegistration( &aDyObject );
 }
 
-void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
-{
-    DBG_TESTSOLARMUTEX();
-    if ( IsInCache() || IsInSwFntCache() )
-    {
-        const sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
-                                        pNewValue ? pNewValue->Which() : 0;
-        CheckCaching( nWhich );
-    }
-
-    if ( !m_pWriterListeners || IsModifyLocked() )
-        return;
-
-    LockModify();
-    CallSwClientNotify( sw::LegacyModifyHint{ pOldValue, pNewValue } );
-    UnlockModify();
-}
-
 bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
 {
     if(!m_pWriterListeners)
@@ -350,7 +331,17 @@ sw::ClientIteratorBase* sw::ClientIteratorBase::s_pClientIters = nullptr;
 void SwModify::SwClientNotify(const SwModify&, const SfxHint& rHint)
 {
     if(auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
-        NotifyClients(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
+    {
+        if(IsInCache() || IsInSwFntCache())
+            CheckCaching(pLegacyHint->GetWhich());
+
+        if(IsModifyLocked())
+            return;
+
+        LockModify();
+        CallSwClientNotify(rHint);
+        UnlockModify();
+    }
 }
 
 void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index ddcf20638356..13e3f7c48d9a 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -330,7 +330,7 @@ void SwFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
             }
     }
     if(bPassToDepends)
-        NotifyClients(aDependArgs.first, aDependArgs.second);
+        CallSwClientNotify(sw::LegacyModifyHint(aDependArgs.first, aDependArgs.second));
 }
 
 bool SwFormat::SetDerivedFrom(SwFormat *pDerFrom)
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index c37221e189e8..989fae5b4abe 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -393,9 +393,9 @@ void ContentIdxStoreImpl::RestoreFlys(SwDoc& rDoc, updater_t const & rUpdater, b
         }
         else if( bAuto )
         {
-            SwFrameFormat *pFrameFormat = (*pSpz)[ aEntry.m_nIdx ];
-            SfxPoolItem const *pAnchor = &pFrameFormat->GetAnchor();
-            pFrameFormat->NotifyClients( pAnchor, pAnchor );
+            SwFrameFormat* pFrameFormat = (*pSpz)[ aEntry.m_nIdx ];
+            const SfxPoolItem* pAnchor = &pFrameFormat->GetAnchor();
+            pFrameFormat->CallSwClientNotify(sw::LegacyModifyHint(pAnchor, pAnchor));
         }
     }
 }
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 2ed5ff85a3c4..2fb5e255148e 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1178,7 +1178,7 @@ void SwContentNode::SwClientNotify( const SwModify&, const SfxHint& rHint)
             AttrSetHandleHelper::SetParent(mpAttrSet, *this, pFormatColl, pFormatColl);
         if(bCalcHidden)
             static_cast<SwTextNode*>(this)->SetCalcHiddenCharFlags();
-        NotifyClients(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
+        CallSwClientNotify(rHint);
     }
     else if (auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
     {
@@ -1904,7 +1904,7 @@ void SwContentNode::SetCondFormatColl(SwFormatColl* pColl)
     {
         SwFormatChg aTmp1(pOldColl ? pOldColl : GetFormatColl());
         SwFormatChg aTmp2(pColl ? pColl : GetFormatColl());
-        NotifyClients(&aTmp1, &aTmp2);
+        CallSwClientNotify(sw::LegacyModifyHint(&aTmp1, &aTmp2));
     }
     if(IsInCache())
     {
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index c956c2544c44..60a0b7eea389 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -329,7 +329,7 @@ void SwEditShell::SetGraphicPolygon( const tools::PolyPolygon *pPoly )
     pNd->SetContour( pPoly );
     SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pNd->getLayoutFrame(GetLayout())->GetUpper());
     const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround();
-    pFly->GetFormat()->NotifyClients( &rSur, &rSur );
+    pFly->GetFormat()->CallSwClientNotify(sw::LegacyModifyHint(&rSur, &rSur));
     GetDoc()->getIDocumentState().SetModified();
     EndAllAction();
 }
@@ -344,7 +344,7 @@ void SwEditShell::ClearAutomaticContour()
         pNd->SetContour( nullptr );
         SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pNd->getLayoutFrame(GetLayout())->GetUpper());
         const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround();
-        pFly->GetFormat()->NotifyClients( &rSur, &rSur );
+        pFly->GetFormat()->CallSwClientNotify(sw::LegacyModifyHint(&rSur, &rSur));
         GetDoc()->getIDocumentState().SetModified();
         EndAllAction();
     }
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index a6c6185c28af..10008bdd73ac 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1090,7 +1090,7 @@ void SwGetRefFieldType::UpdateGetReferences()
         // #i81002#
         pGRef->UpdateField(pFormatField->GetTextField());
     }
-    NotifyClients(nullptr, nullptr);
+    CallSwClientNotify(sw::LegacyModifyHint(nullptr, nullptr));
 }
 
 void SwGetRefFieldType::SwClientNotify(const SwModify&, const SfxHint& rHint)
@@ -1105,7 +1105,7 @@ void SwGetRefFieldType::SwClientNotify(const SwModify&, const SfxHint& rHint)
         UpdateGetReferences();
     else
         // forward to text fields, they "expand" the text
-        NotifyClients(pLegacy->m_pOld, pLegacy->m_pNew);
+        CallSwClientNotify(rHint);
 }
 
 namespace sw {
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index eb2ef8016a22..5c7bec0b44b2 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -86,6 +86,7 @@ SwAnchoredObject::SwAnchoredObject() :
     mbClearedEnvironment( false ),
     // --> #i3317#
     mbTmpConsiderWrapInfluence( false ),
+    mbInvalidatingObjects( false ),
     // --> #i68520#
     maObjRectWithSpaces(),
     mbObjRectWithSpacesValid( false ),
@@ -615,10 +616,12 @@ void SwAnchoredObject::SetObjLeft( const SwTwips _nLeft)
     at the anchor frame and all following anchored objects on the page
     frame are invalidated.
 */
+
 void SwAnchoredObject::UpdateObjInSortedList()
 {
-    if ( !GetAnchorFrame() )
+    if ( !GetAnchorFrame() || mbInvalidatingObjects )
         return;
+    mbInvalidatingObjects = true;
 
     if ( GetFrameFormat().getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) )
     {
@@ -626,11 +629,10 @@ void SwAnchoredObject::UpdateObjInSortedList()
         if ( GetAnchorFrame()->GetDrawObjs() )
         {
             const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
-            // determine start index
-            for (auto it = pObjs->begin(); it != pObjs->end(); ++it)
+            for(auto it = pObjs->begin(); it != pObjs->end(); ++it)
             {
                 SwAnchoredObject* pAnchoredObj = *it;
-                if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
+                if(pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos())
                     pAnchoredObj->InvalidateObjPosForConsiderWrapInfluence();
                 else
                     pAnchoredObj->InvalidateObjPos();
@@ -659,6 +661,7 @@ void SwAnchoredObject::UpdateObjInSortedList()
     {
         GetPageFrame()->GetSortedObjs()->Update( *this );
     }
+    mbInvalidatingObjects = false;
 }
 
 /** method to determine, if invalidation of position is allowed
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 95321684de87..1bc8d05a8167 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1700,12 +1700,12 @@ void SwRootFrame::AssertPageFlys( SwPageFrame *pPage )
                         // It can move by itself. Just send a modify to its anchor attribute.
 #if OSL_DEBUG_LEVEL > 1
                         const size_t nCnt = pPage->GetSortedObjs()->size();
-                        rFormat.NotifyClients( nullptr, &rAnch );
+                        rFormat.CallSwClientNotify(sw::LegacyModifyHint(nullptr, &rAnch));
                         OSL_ENSURE( !pPage->GetSortedObjs() ||
                                 nCnt != pPage->GetSortedObjs()->size(),
                                 "Object couldn't be reattached!" );
 #else
-                        rFormat.NotifyClients( nullptr, &rAnch );
+                        rFormat.CallSwClientNotify(sw::LegacyModifyHint(nullptr, &rAnch));
 #endif
                         // Do not increment index, in this case
                         continue;
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 2f7c9e0047bd..3fd05a3d70ae 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -269,7 +269,7 @@ void SwPageDesc::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
                 : pLegacyHint->m_pNew
                 ? pLegacyHint->m_pNew->Which()
                 : 0;
-        NotifyClients(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
+        CallSwClientNotify(rHint);
         if((RES_ATTRSET_CHG == nWhich)
                 || (RES_FMT_CHG == nWhich)
                 || isCHRATR(nWhich)
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index f201578a84e0..466b7d6acdd9 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -156,7 +156,7 @@ void SwTOXMark::Notify(const SfxHint& rHint)
 {
     if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
     {
-        NotifyClients(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
+        CallSwClientNotify(rHint);
         if (pLegacyHint->m_pOld && (RES_REMOVE_UNO_OBJECT == pLegacyHint->m_pOld->Which()))
             SetXTOXMark(css::uno::Reference<css::text::XDocumentIndexMark>(nullptr));
     } else if (auto pCollectHint = dynamic_cast<const sw::CollectTextMarksHint*>(&rHint))
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index aa4dab94b8e5..f8f326fc8f8f 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -294,7 +294,7 @@ void SwFormatField::UpdateTextNode(const SfxPoolItem* pOld, const SfxPoolItem* p
     {   // invalidate cached UNO object
         m_wXTextField = nullptr;
         // ??? why does this Modify method not already do this?
-        NotifyClients(pOld, pNew);
+        CallSwClientNotify(sw::LegacyModifyHint(pOld, pNew));
         return;
     }
 
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 5ec1f6f93a01..02188cf011de 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -165,7 +165,7 @@ void SwFormatFootnote::InvalidateFootnote()
 {
     SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT,
             &static_cast<sw::BroadcastingModify&>(*this)); // cast to base class (void*)
-    NotifyClients(&item, &item);
+    CallSwClientNotify(sw::LegacyModifyHint(&item, &item));
 }
 
 void SwFormatFootnote::SetEndNote( bool b )
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index fdea6ce5dad7..8b11c4e525c7 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -68,7 +68,7 @@ void SwFormatRefMark::InvalidateRefMark()
 {
     SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT,
             &static_cast<sw::BroadcastingModify&>(*this)); // cast to base class (void*)
-    NotifyClients(&item, &item);
+    CallSwClientNotify(sw::LegacyModifyHint(&item, &item));
 }
 
 // attribute for content references in the text
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index e71ea4b76119..79b0f389d358 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -396,7 +396,7 @@ void MoveMergedFlysAndFootnotes(std::vector<SwTextFrame*> const& rFrames,
                 if (rFirstNode.GetIndex() < rAnchor.GetContentAnchor()->nNode.GetIndex())
                 {
                     // move it to the new frame of "this"
-                    rFormat.NotifyClients(&rAnchor, &rAnchor);
+                    rFormat.CallSwClientNotify(sw::LegacyModifyHint(&rAnchor, &rAnchor));
                     // note pObjs will be deleted if it becomes empty
                     assert(!pFrame->GetDrawObjs() || !pObjs->Contains(*pObj));
                 }
@@ -2278,7 +2278,7 @@ OUString SwTextNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
     if ( HasWriterListeners() )
     {   // send this before messing with hints, which will send RES_UPDATE_ATTR
         SwInsText aHint( aPos, nLen );
-        NotifyClients( nullptr, &aHint );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
     }
 
     if ( HasHints() )
@@ -2708,12 +2708,12 @@ void SwTextNode::EraseText(const SwIndex &rIdx, const sal_Int32 nCount,
     if( 1 == nCnt )
     {
         SwDelChr aHint( nStartIdx );
-        NotifyClients( nullptr, &aHint );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
     }
     else
     {
         SwDelText aHint( nStartIdx, nCnt );
-        NotifyClients( nullptr, &aHint );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
     }
 
     OSL_ENSURE(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
@@ -2765,9 +2765,9 @@ void SwTextNode::GCAttr()
             nMax,
             0);
 
-        NotifyClients( nullptr, &aHint );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
         SwFormatChg aNew( GetTextColl() );
-        NotifyClients( nullptr, &aNew );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aNew));
     }
 }
 
@@ -2839,7 +2839,7 @@ void SwTextNode::NumRuleChgd()
     // Important note:
     {
         SvxLRSpaceItem& rLR = const_cast<SvxLRSpaceItem&>(GetSwAttrSet().GetLRSpace());
-        NotifyClients( &rLR, &rLR );
+        CallSwClientNotify(sw::LegacyModifyHint(&rLR, &rLR));
     }
 
     SetWordCountDirty( true );
@@ -3708,12 +3708,12 @@ void SwTextNode::ReplaceText( const SwIndex& rStart, const sal_Int32 nDelLen,
 
     SetIgnoreDontExpand( bOldExpFlg );
     SwDelText aDelHint( nStartPos, nDelLen );
-    NotifyClients( nullptr, &aDelHint );
+    CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aDelHint));
 
     if (sInserted.getLength())
     {
         SwInsText aHint( nStartPos, sInserted.getLength() );
-        NotifyClients( nullptr, &aHint );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
     }
 }
 
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index a5626e71f053..6052754c8b46 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1709,7 +1709,7 @@ void SwTextNode::DeleteAttribute( SwTextAttr * const pAttr )
 
         m_pSwpHints->Delete( pAttr );
         SwTextAttr::Destroy( pAttr, GetDoc().GetAttrPool() );
-        NotifyClients( nullptr, &aHint );
+        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
 
         TryDeleteSwpHints();
     }
@@ -1785,7 +1785,7 @@ void SwTextNode::DeleteAttributes(
 
                 m_pSwpHints->DeleteAtPos( nPos );
                 SwTextAttr::Destroy( pTextHt, GetDoc().GetAttrPool() );
-                NotifyClients( nullptr, &aHint );
+                CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
             }
         }
     }
@@ -2586,7 +2586,7 @@ void SwTextNode::FormatToTextAttr( SwTextNode* pNd )
             if( aNdSet.Count() )
             {
                 SwFormatChg aTmp1( pNd->GetFormatColl() );
-                pNd->NotifyClients( &aTmp1, &aTmp1 );
+                pNd->CallSwClientNotify(sw::LegacyModifyHint(&aTmp1, &aTmp1));
             }
         }
     }
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index edc0ac296d00..ba25c5fccba1 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -634,9 +634,9 @@ void SwTextNode::RstTextAttr(
         nMax,
         0);
 
-    NotifyClients( nullptr, &aHint );
+    CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
     SwFormatChg aNew( GetFormatColl() );
-    NotifyClients( nullptr, &aNew );
+    CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aNew));
 }
 
 static sal_Int32 clipIndexBounds(const OUString &rStr, sal_Int32 nPos)
@@ -1983,10 +1983,10 @@ void SwTextNode::ReplaceTextOnly( sal_Int32 nPos, sal_Int32 nLen,
 
     // notify the layout!
     SwDelText aDelHint( nPos, nTLen );
-    NotifyClients( nullptr, &aDelHint );
+    CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aDelHint));
 
     SwInsText aHint( nPos, nTLen );
-    NotifyClients( nullptr, &aHint );
+    CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
 }
 
 // the return values allows us to see if we did the heavy-
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index bf0f89ac0bbe..964471ded48c 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2483,7 +2483,7 @@ void SAL_CALL SwXTextCursor::invalidateMarkings(::sal_Int32 nType)
     if (fmtColl == nullptr) return;
 
     SwFormatChg aNew( fmtColl );
-    txtNode->NotifyClients( nullptr, &aNew );
+    txtNode->CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aNew));
 }
 
 void SAL_CALL


More information about the Libreoffice-commits mailing list