sw/source/core/doc/fmtcol.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit c9a96f272430a8ba5a29207d3365354c82d08e60
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Tue Jul 2 19:25:30 2024 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jul 17 15:33:22 2024 +0200

    NFC tdf#134204: ensure style modify signaled if parent changed
    
    If the parent changed, we have no idea how many properties might
    be involved. Therefore, there is no way that anything could
    legitimately say that we haven't actually changed/don't need to notify.
    
    This is a No Functional Change.
    bContinue was never set to false when bNewParent.
    bNewParent and pNewChgSet are mutually exclusive,
    and the only other time bContinue was changed was if pNewChgSet.
    
    So this patch is just a simplification.
    It more clearly shows that the notify should always happen,
    and is helpful to demonstrate logic changes in the following patches.
    
    Change-Id: Iabef5ba305c80d68655a0c880301ab32ffc90792
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169896
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index a46f512f9aaa..bf8d8a3aaeea 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -268,7 +268,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
             if( bChg )
             {
                 SetFormatAttr( aNew );
-                bContinue = nullptr != pOldChgSet || bNewParent;
+                bContinue = pOldChgSet; // #3, #4
             }
             // We set it to absolute -> do not propagate it further
             else if( pNewChgSet )
@@ -294,7 +294,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
             if( bChg )
             {
                 SetFormatAttr( aNew );
-                bContinue = nullptr != pOldChgSet || bNewParent;
+                bContinue = pOldChgSet;
             }
             // We set it to absolute -> do not propagate it further
             else if( pNewChgSet )
@@ -318,7 +318,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
             if( bChg )
             {
                 SetFormatAttr( aNew );
-                bContinue = nullptr != pOldChgSet || bNewParent;
+                bContinue = pOldChgSet;
             }
             // We set it to absolute -> do not propagate it further
             else if( pNewChgSet )
@@ -348,7 +348,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
         if( bChg )
         {
             SetFormatAttr( aNew );
-            bContinue = nullptr != pOldChgSet || bNewParent;
+            bContinue = pOldChgSet;
         }
         // We set it to absolute -> do not propagate it further
         else if( pNewChgSet )
@@ -380,7 +380,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
                 if (nOld != aNew.GetHeight())
                 {
                     SetFormatAttr( aNew );
-                    bContinue = nullptr != pOldChgSet || bNewParent;
+                    bContinue = pOldChgSet;
                 }
                 // We set it to absolute -> do not propagate it further
                 else if( pNewChgSet )
@@ -389,6 +389,10 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
         }
     }
 
+    // if the parent changed, we can't know how many properties are involved: 
always notify a change
+    if (!bContinue && bNewParent) // #4
+        bContinue = true;
+
     // If there are any attributes in addition to the special ones already 
handled, then notify...
     if (!bContinue && pNewChgSet && pNewChgSet->GetChgSet())
     {

Reply via email to