summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-07-02 19:25:30 -0400
committerMiklos Vajna <vmiklos@collabora.com>2024-07-17 15:33:22 +0200
commitc9a96f272430a8ba5a29207d3365354c82d08e60 (patch)
treeae4a19b33f3f970ca356891f4b0e412063eff682 /sw
parent69e7000ed420faf513002076089aca82bddfbc28 (diff)
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 <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/fmtcol.cxx14
1 files changed, 9 insertions, 5 deletions
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())
{