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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 1 17:54:03 UTC 2020


 sw/source/core/crsr/callnk.cxx |    3 ++-
 sw/source/core/crsr/pam.cxx    |   19 +++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit b24d809e0d89380850a0081c56353410d8616f9f
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sat Oct 31 16:18:35 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Sun Nov 1 18:53:26 2020 +0100

    sw/source/core/crsr: Stop abusing observer pattern for code obfuscation.
    
    Change-Id: I2423b70b2d6a9e90388bb7c83d886181cb268c0f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105136
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 8c585524470e..d793a906815b 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -86,7 +86,8 @@ static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell & rShell)
     }
 
     SwFormatFrameSize aSize = pLine->GetFrameFormat()->GetFrameSize();
-    pRow->ModifyNotification(nullptr, &aSize);
+    SwModify aMod;
+    pRow->SwClientNotify(aMod, sw::LegacyModifyHint(nullptr, &aSize));
 }
 
 SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 3d759416a387..5f9e3877f1e6 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1121,16 +1121,15 @@ OUString SwPaM::GetText() const
 
 void SwPaM::InvalidatePaM()
 {
-    const SwNode &_pNd = GetNode();
-    const SwTextNode *_pTextNd = _pNd.GetTextNode();
-    if (_pTextNd != nullptr)
-    {
-        // pretend that the PaM marks inserted text to recalc the portion...
-        SwInsText aHint( Start()->nContent.GetIndex(),
-                        End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 );
-        SwModify *_pModify=const_cast<SwModify*>(static_cast<SwModify const *>(_pTextNd));
-        _pModify->ModifyNotification( nullptr, &aHint);
-    }
+    const SwNode& pNd = GetNode();
+    SwTextNode* pTextNd = const_cast<SwTextNode*>(pNd.GetTextNode());
+    if(!pTextNd)
+        return;
+    // pretend that the PaM marks inserted text to recalc the portion...
+    SwInsText aHint(
+            Start()->nContent.GetIndex(),
+            End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1);
+    pTextNd->TriggerNodeUpdate(sw::LegacyModifyHint(nullptr, &aHint));
 }
 
 void SwPaM::dumpAsXml(xmlTextWriterPtr pWriter) const


More information about the Libreoffice-commits mailing list