summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-11-04 21:55:31 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-11-05 08:01:12 +0100
commit2e32f4ed5af16a68c97a50806a42ffa2d10f1d7a (patch)
tree32239716e74e39f9c0214dccf7a89d646b759557 /sw/source
parent0d93ed1ea5593d62e835c958ea50c7c9df2d2f33 (diff)
get rid of long deprecated SwModify::BroadcastModify
Change-Id: I9c65de16bf1f1a604c0045444203a16f30f2833e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105318 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/attr/calbck.cxx2
-rw-r--r--sw/source/core/docnode/section.cxx33
2 files changed, 14 insertions, 21 deletions
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index b799f21bbb11..999085404da1 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -181,7 +181,7 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p
return;
LockModify();
- ModifyBroadcast( pOldValue, pNewValue );
+ CallSwClientNotify( sw::LegacyModifyHint{ pOldValue, pNewValue } );
UnlockModify();
}
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 430e696c8ab1..e3c20c5230ef 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -743,7 +743,6 @@ void SwSectionFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
if(!pLegacy)
return;
- bool bClients = false;
sal_uInt16 nWhich = pLegacy->GetWhich();
auto pOld = pLegacy->m_pOld;
auto pNew = pLegacy->m_pNew;
@@ -758,7 +757,7 @@ void SwSectionFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
if( SfxItemState::SET == pNewSet->GetItemState(
RES_PROTECT, false, &pItem ))
{
- ModifyBroadcast( pItem, pItem );
+ GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
pNewSet->ClearItem( RES_PROTECT );
pOldSet->ClearItem( RES_PROTECT );
}
@@ -767,7 +766,7 @@ void SwSectionFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
if( SfxItemState::SET == pNewSet->GetItemState(
RES_EDIT_IN_READONLY, false, &pItem ) )
{
- ModifyBroadcast( pItem, pItem );
+ GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
pNewSet->ClearItem( RES_EDIT_IN_READONLY );
pOldSet->ClearItem( RES_EDIT_IN_READONLY );
}
@@ -775,14 +774,14 @@ void SwSectionFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
if( SfxItemState::SET == pNewSet->GetItemState(
RES_FTN_AT_TXTEND, false, &pItem ))
{
- ModifyBroadcast( &pOldSet->Get( RES_FTN_AT_TXTEND ), pItem );
+ GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
pNewSet->ClearItem( RES_FTN_AT_TXTEND );
pOldSet->ClearItem( RES_FTN_AT_TXTEND );
}
if( SfxItemState::SET == pNewSet->GetItemState(
RES_END_AT_TXTEND, false, &pItem ))
{
- ModifyBroadcast( &pOldSet->Get( RES_END_AT_TXTEND ), pItem );
+ GetNotifier().Broadcast(sw::LegacyModifyHint(pItem, pItem));
pNewSet->ClearItem( RES_END_AT_TXTEND );
pOldSet->ClearItem( RES_END_AT_TXTEND );
}
@@ -791,28 +790,22 @@ void SwSectionFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
}
break;
- case RES_FTN_AT_TXTEND:
- case RES_END_AT_TXTEND : bClients = true;
- [[fallthrough]];
case RES_SECTION_HIDDEN:
case RES_SECTION_NOT_HIDDEN:
{
- SwSection* pSect = GetSection();
- if( pSect && ( bClients || ( RES_SECTION_HIDDEN == nWhich ?
- !pSect->IsHiddenFlag() : pSect->IsHiddenFlag() ) ) )
- {
- ModifyBroadcast( pOld, pNew );
- }
+ auto pSect = GetSection();
+ if(!pSect || (RES_SECTION_HIDDEN == nWhich) == pSect->IsHiddenFlag()) // already at target state, skipping.
+ return;
}
- return ;
-
+ [[fallthrough]];
+ case RES_FTN_AT_TXTEND:
+ case RES_END_AT_TXTEND:
+ GetNotifier().Broadcast(sw::LegacyModifyHint(pOld, pNew));
+ return;
case RES_PROTECT:
case RES_EDIT_IN_READONLY: // edit in readonly sections
// Pass through these Messages until the End of the tree!
- if( HasWriterListeners() )
- {
- ModifyBroadcast( pOld, pNew );
- }
+ GetNotifier().Broadcast(sw::LegacyModifyHint(pOld, pNew));
return; // That's it!
case RES_OBJECTDYING: