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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 5 13:15:29 UTC 2020


 scripting/source/basprov/basmethnode.cxx           |    3 ++-
 scripting/source/stringresource/stringresource.cxx |    3 +--
 sw/inc/cellatr.hxx                                 |    8 ++++----
 sw/inc/doc.hxx                                     |    2 +-
 sw/inc/editsh.hxx                                  |    4 ++--
 sw/inc/fmtpdsc.hxx                                 |    6 +++---
 sw/inc/ndtxt.hxx                                   |    2 +-
 sw/inc/paratr.hxx                                  |    8 ++++----
 sw/inc/swatrset.hxx                                |    6 +++---
 sw/source/core/attr/cellatr.cxx                    |    4 ++--
 sw/source/core/attr/swatrset.cxx                   |    4 ++--
 sw/source/core/crsr/callnk.cxx                     |    2 +-
 sw/source/core/doc/DocumentFieldsManager.cxx       |    2 +-
 sw/source/core/doc/docfmt.cxx                      |    4 ++--
 sw/source/core/doc/docftn.cxx                      |    2 +-
 sw/source/core/doc/docredln.cxx                    |    4 ++--
 sw/source/core/doc/fmtcol.cxx                      |    2 +-
 sw/source/core/doc/poolfmt.cxx                     |    2 +-
 sw/source/core/docnode/node.cxx                    |    4 ++--
 sw/source/core/docnode/node2lay.cxx                |   10 +++++-----
 sw/source/core/docnode/section.cxx                 |   10 +++++-----
 sw/source/core/draw/dcontact.cxx                   |    4 ++--
 sw/source/core/edit/edfmt.cxx                      |    2 +-
 sw/source/core/graphic/ndgrf.cxx                   |    6 +++---
 sw/source/core/inc/frame.hxx                       |    8 +++++---
 sw/source/core/inc/frmtool.hxx                     |    6 +++---
 sw/source/core/inc/node2lay.hxx                    |    2 +-
 sw/source/core/inc/rolbck.hxx                      |    4 ++--
 sw/source/core/inc/unoparaframeenum.hxx            |    2 +-
 sw/source/core/layout/atrfrm.cxx                   |   12 ++++++------
 sw/source/core/layout/dbg_lay.cxx                  |    3 +--
 sw/source/core/layout/frmtool.cxx                  |   20 ++++++++++----------
 sw/source/core/layout/pagedesc.cxx                 |    2 +-
 sw/source/core/layout/tabfrm.cxx                   |    6 +++---
 sw/source/core/layout/trvlfrm.cxx                  |    2 +-
 sw/source/core/layout/wsfrm.cxx                    |    2 +-
 sw/source/core/para/paratr.cxx                     |    2 +-
 sw/source/core/table/swtable.cxx                   |    8 ++++----
 sw/source/core/text/txtfrm.cxx                     |    4 ++--
 sw/source/core/tox/tox.cxx                         |    4 ++--
 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                   |    2 +-
 sw/source/core/undo/rolbck.cxx                     |    4 ++--
 sw/source/core/unocore/unoportenum.cxx             |   10 ++++------
 sw/source/core/unocore/unorefmk.cxx                |    2 +-
 sw/source/filter/ww8/wrtw8esh.cxx                  |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx                  |    4 ++--
 sw/source/filter/ww8/wrtw8sty.cxx                  |    2 +-
 sw/source/filter/ww8/wrtww8.hxx                    |    4 ++--
 sw/source/filter/ww8/ww8atr.cxx                    |    2 +-
 sw/source/uibase/app/docstyle.cxx                  |    4 ++--
 53 files changed, 116 insertions(+), 117 deletions(-)

New commits:
commit c44fa10aa2a04945196622c73272c775374be486
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Thu Nov 5 00:55:00 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Thu Nov 5 14:10:32 2020 +0100

    retire most of SwModify
    
    only remaining uses are:
    - in calbck.{c,h}xx
    - in uwriter unittests
    - as a parameter of SwClientNotify
    
    all other uses have been replaced with sw::BroadcastingModify, which
    contains sw::BroadcastingMixin functionality. Existing code should then
    be moved to sw::BroadcastingMixin (only) as soon as possible.
    
    Change-Id: Ief7895597633c2fcb97e1cbc182905d75feb1567
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105320
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx
index ede8c654c9c9..e17226829cef 100644
--- a/sw/inc/cellatr.hxx
+++ b/sw/inc/cellatr.hxx
@@ -51,7 +51,7 @@ public:
 
 class SAL_DLLPUBLIC_RTTI SwTableBoxFormula : public SfxPoolItem, public SwTableFormula
 {
-    SwModify* m_pDefinedIn;   // Modify object where the formula is located
+    sw::BroadcastingModify* m_pDefinedIn;   // Modify object where the formula is located
                             // can only be TableBoxFormat
 
 public:
@@ -61,9 +61,9 @@ public:
     virtual bool            operator==( const SfxPoolItem& ) const override;
     virtual SwTableBoxFormula* Clone( SfxItemPool* pPool = nullptr ) const override;
 
-    const SwModify* GetDefinedIn() const { return m_pDefinedIn; }
-    void ChgDefinedIn( const SwModify* pNew )
-                                            { m_pDefinedIn = const_cast<SwModify*>(pNew); }
+    const sw::BroadcastingModify* GetDefinedIn() const { return m_pDefinedIn; }
+    void ChgDefinedIn( const sw::BroadcastingModify* pNew )
+                                            { m_pDefinedIn = const_cast<sw::BroadcastingModify*>(pNew); }
     //  BoxAttribut -> BoxStartNode
     virtual const SwNode* GetNodeOfFormula() const override;
 
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 0eef11b1530f..74d356324cc0 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -848,7 +848,7 @@ public:
     void ReplaceDocumentProperties(const SwDoc& rSource, bool mailMerge = false);
 
     // Query if style (paragraph- / character- / frame- / page-) is used.
-    bool IsUsed( const SwModify& ) const;
+    bool IsUsed( const sw::BroadcastingModify& ) const;
     /// Query if table style is used.
     bool IsUsed( const SwTableAutoFormat& ) const;
     static bool IsUsed( const SwNumRule& );
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 82e32c208347..ff7393292eb5 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -156,7 +156,7 @@ class SW_DLLPUBLIC SwEditShell : public SwCursorShell
     SAL_DLLPRIVATE void SetSectionAttr_( SwSectionFormat& rSectFormat, const SfxItemSet& rSet );
 
     using SwViewShell::UpdateFields;
-    using SwModify::GetInfo;
+    using sw::BroadcastingModify::GetInfo;
 
 public:
     /// Edit (all selected ranges).
@@ -349,7 +349,7 @@ public:
     SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
 
     /// Query if the paragraph-/character-/frame-/page-style is used.
-    bool IsUsed( const SwModify& ) const;
+    bool IsUsed( const sw::BroadcastingModify& ) const;
 
     /// @return required automatic format.
     SwFrameFormat* GetFrameFormatFromPool( sal_uInt16 nId )
diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx
index 887ddbcf49e1..de54dd585f1e 100644
--- a/sw/inc/fmtpdsc.hxx
+++ b/sw/inc/fmtpdsc.hxx
@@ -35,7 +35,7 @@ class IntlWrapper;
 class SW_DLLPUBLIC SwFormatPageDesc : public SfxPoolItem, public SwClient
 {
     ::std::optional<sal_uInt16> m_oNumOffset;          ///< Offset page number.
-    SwModify* m_pDefinedIn;       /**< Points to the object in which the
+    sw::BroadcastingModify* m_pDefinedIn;       /**< Points to the object in which the
                                  attribute was set (ContentNode/Format). */
 protected:
     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override;
@@ -66,8 +66,8 @@ public:
     void    SetNumOffset( const ::std::optional<sal_uInt16>& oNum ) { m_oNumOffset = oNum; }
 
     /// Query / set where attribute is anchored.
-    const SwModify* GetDefinedIn() const { return m_pDefinedIn; }
-    void ChgDefinedIn( const SwModify* pNew ) { m_pDefinedIn = const_cast<SwModify*>(pNew); }
+    const sw::BroadcastingModify* GetDefinedIn() const { return m_pDefinedIn; }
+    void ChgDefinedIn( const sw::BroadcastingModify* pNew ) { m_pDefinedIn = const_cast<sw::BroadcastingModify*>(pNew); }
     void RegisterToPageDesc( SwPageDesc& );
     bool KnowsPageDesc() const;
     void dumpAsXml(xmlTextWriterPtr pWriter) const override;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 7b37dc152687..7786c6ee8fe4 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -838,7 +838,7 @@ inline void SwTextNode::TryDeleteSwpHints()
 
 inline SwTextFormatColl* SwTextNode::GetTextColl() const
 {
-    return static_cast<SwTextFormatColl*>(const_cast<SwModify*>(GetRegisteredIn()));
+    return const_cast<SwTextFormatColl*>(static_cast<const SwTextFormatColl*>(GetRegisteredIn()));
 }
 
 /// Inline methods from Node.hxx
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index e9428a39cdff..1c6bcf4de0fc 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -49,7 +49,7 @@ class IntlWrapper;
    via the Modify of SwFormatDrop. */
 class SW_DLLPUBLIC SwFormatDrop: public SfxPoolItem, public SwClient
 {
-    SwModify* m_pDefinedIn;       /**< Modify-Object, that contains DropCaps.
+    sw::BroadcastingModify* m_pDefinedIn;       /**< Modify-Object, that contains DropCaps.
                                   Can only be TextFormatCollection/TextNode. */
     sal_uInt16 m_nDistance;       ///< Distance to beginning of text.
     sal_uInt8  m_nLines;          ///< Line count.
@@ -102,9 +102,9 @@ public:
     virtual bool GetInfo( SfxPoolItem& ) const override;
 
     /// Get and set Modify pointer.
-    const SwModify* GetDefinedIn() const { return m_pDefinedIn; }
-    void ChgDefinedIn( const SwModify* pNew )
-    { m_pDefinedIn = const_cast<SwModify*>(pNew); }
+    const sw::BroadcastingModify* GetDefinedIn() const { return m_pDefinedIn; }
+    void ChgDefinedIn( const sw::BroadcastingModify* pNew )
+    { m_pDefinedIn = const_cast<sw::BroadcastingModify*>(pNew); }
 };
 
 class SwRegisterItem : public SfxBoolItem
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 02b16c80b75d..8208ad150e8c 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -22,8 +22,8 @@
 #include <svl/itemset.hxx>
 #include <svl/itempool.hxx>
 #include "swdllapi.h"
+#include "calbck.hxx"
 
-class SwModify;
 class SwDoc;
 class OutputDevice;
 class IDocumentSettingAccess;
@@ -190,7 +190,7 @@ public:
     SwAttrPool* GetPool() const { return static_cast<SwAttrPool*>(SfxItemSet::GetPool()); }
 
     // Copy attributes, if necessary across documents.
-    void CopyToModify( SwModify& rMod ) const;
+    void CopyToModify( sw::BroadcastingModify& rMod ) const;
 
     // Special treatment for some attributes.
     // Set Modify-pointer (the old pDefinedIn) at the following attributes:
@@ -198,7 +198,7 @@ public:
     //  - SwFormatPageDesc
     // (Is called at insert in formats/nodes.)
     // Second version is for the SwAttrSet handles of SwContentNode.
-    bool SetModifyAtAttr( const SwModify* pModify );
+    bool SetModifyAtAttr( const sw::BroadcastingModify* pModify );
 
     // Document is set at SwAttrPool. Therefore it is always accessible.
     const SwDoc *GetDoc() const { return GetPool()->GetDoc(); }
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index 9fbd1f9e77db..8b97ff2095fa 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -88,7 +88,7 @@ const SwNode* SwTableBoxFormula::GetNodeOfFormula() const
     const SwNode* pRet = nullptr;
     if( m_pDefinedIn )
     {
-        SwTableBox* pBox = SwIterator<SwTableBox,SwModify>( *m_pDefinedIn ).First();
+        SwTableBox* pBox = SwIterator<SwTableBox,sw::BroadcastingModify>( *m_pDefinedIn ).First();
         if( pBox )
             pRet = pBox->GetSttNd();
     }
@@ -99,7 +99,7 @@ SwTableBox* SwTableBoxFormula::GetTableBox()
 {
     SwTableBox* pBox = nullptr;
     if( m_pDefinedIn )
-        pBox = SwIterator<SwTableBox,SwModify>( *m_pDefinedIn ).First();
+        pBox = SwIterator<SwTableBox,sw::BroadcastingModify>( *m_pDefinedIn ).First();
     return pBox;
 }
 
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 6ebd4120989c..0fe141ef5834 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -247,7 +247,7 @@ void  SwAttrSet::Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew )
 
     (Is called at inserts into formats/nodes)
 */
-bool SwAttrSet::SetModifyAtAttr( const SwModify* pModify )
+bool SwAttrSet::SetModifyAtAttr( const sw::BroadcastingModify* pModify )
 {
     bool bSet = false;
 
@@ -284,7 +284,7 @@ bool SwAttrSet::SetModifyAtAttr( const SwModify* pModify )
     return bSet;
 }
 
-void SwAttrSet::CopyToModify( SwModify& rMod ) const
+void SwAttrSet::CopyToModify( sw::BroadcastingModify& rMod ) const
 {
     // copy attributes across multiple documents if needed
     SwContentNode* pCNd = dynamic_cast<SwContentNode*>( &rMod  );
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index d793a906815b..de888d63ab47 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -86,7 +86,7 @@ static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell & rShell)
     }
 
     SwFormatFrameSize aSize = pLine->GetFrameFormat()->GetFrameSize();
-    SwModify aMod;
+    sw::BroadcastingModify aMod;
     pRow->SwClientNotify(aMod, sw::LegacyModifyHint(nullptr, &aSize));
 }
 
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index 84769b8ec16e..2f3da10fbf97 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -179,7 +179,7 @@ namespace
     #endif
         }
     }
-    void lcl_SwClientNotify(SwModify& rModify, const SfxPoolItem* pNew)
+    void lcl_SwClientNotify(sw::BroadcastingModify& rModify, const SfxPoolItem* pNew)
     {
         const sw::LegacyModifyHint aHint(nullptr, pNew);
         rModify.SwClientNotify(rModify, aHint);
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 3e1817d632fc..2bcf4f2b0ce7 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -535,7 +535,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
     if( !rSet.Count() )
         return;
 
-    SwModify aCallMod;
+    sw::BroadcastingModify aCallMod;
     SwAttrSet aOld( GetAttrPool(), rSet.GetRanges() ),
             aNew( GetAttrPool(), rSet.GetRanges() );
     SfxItemIter aIter( rSet );
@@ -642,7 +642,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
     }
 
     // remove the default formats from the object again
-    SwIterator<SwClient, SwModify> aClientIter(aCallMod);
+    SwIterator<SwClient, sw::BroadcastingModify> aClientIter(aCallMod);
     for(SwClient* pClient = aClientIter.First(); pClient; pClient = aClientIter.Next())
         aCallMod.Remove( pClient );
 
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 8f158ac1c780..44963f66b781 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -242,7 +242,7 @@ void SwEndNoteInfo::SwClientNotify( const SwModify& rModify, const SfxHint& rHin
     }
     else if (auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
     {
-        auto pNew = const_cast<SwModify*>(pModifyChangedHint->m_pNew);
+        auto pNew = const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(pModifyChangedHint->m_pNew));
         if(m_pAnchorFormat == &rModify)
             m_pAnchorFormat = static_cast<SwCharFormat*>(pNew);
         else if(m_pCharFormat == &rModify)
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 0c0870f52f62..a41348027471 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -296,10 +296,10 @@ bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox&
 namespace
 {
 
-void lcl_LOKInvalidateFrames(const SwModify& rMod, const SwRootFrame* pLayout,
+void lcl_LOKInvalidateFrames(const sw::BroadcastingModify& rMod, const SwRootFrame* pLayout,
         SwFrameType const nFrameType, const Point* pPoint)
 {
-    SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti> aIter(rMod);
+    SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti> aIter(rMod);
 
     for (SwFrame* pTmpFrame = aIter.First(); pTmpFrame; pTmpFrame = aIter.Next() )
     {
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 891a11795dce..e4753ba2767c 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -488,7 +488,7 @@ SwCollCondition::SwCollCondition( SwTextFormatColl* pColl, Master_CollCondition
 }
 
 SwCollCondition::SwCollCondition( const SwCollCondition& rCopy )
-    : SwClient( const_cast<SwModify*>(rCopy.GetRegisteredIn()) ),
+    : SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCopy.GetRegisteredIn())) ),
       m_nCondition( rCopy.m_nCondition ),
       m_nSubCondition( rCopy.m_nSubCondition )
 {
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index b3ae8b2b29f8..c4f21573d621 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -81,7 +81,7 @@ SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
 }
 
 // See if the Paragraph/Character/Frame/Page style is in use
-bool SwDoc::IsUsed( const SwModify& rModify ) const
+bool SwDoc::IsUsed( const sw::BroadcastingModify& rModify ) const
 {
     // Check if we have dependent ContentNodes in the Nodes array
     // (also indirect ones for derived Formats)
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 076fd4c545bd..93f58ecddff6 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -681,7 +681,7 @@ const SwPageDesc* SwNode::FindPageDesc( size_t* pPgDescNdIdx ) const
                 auto pPageDescItem = dynamic_cast<const SwFormatPageDesc*>(pItem);
                 if( pPageDescItem && pPageDescItem->GetDefinedIn() )
                 {
-                    const SwModify* pMod = pPageDescItem->GetDefinedIn();
+                    const sw::BroadcastingModify* pMod = pPageDescItem->GetDefinedIn();
                     if( auto pContentNode = dynamic_cast<const SwContentNode*>( pMod) )
                         aInfo.CheckNode( *pContentNode );
                     else if( auto pFormat = dynamic_cast<const SwFormat*>( pMod) )
@@ -1555,7 +1555,7 @@ bool SwContentNode::GetInfo( SfxPoolItem& rInfo ) const
         return false;
     }
 
-    return SwModify::GetInfo( rInfo );
+    return sw::BroadcastingModify::GetInfo( rInfo );
 }
 
 /// @param rAttr the attribute to set
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index 16e8ff328db6..17b8a82e707d 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -35,8 +35,8 @@
  */
 class SwNode2LayImpl
 {
-    std::unique_ptr<SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti>> mpIter;
-    SwModify* mpMod;
+    std::unique_ptr<SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti>> mpIter;
+    sw::BroadcastingModify* mpMod;
     std::vector<SwFrame*> mvUpperFrames; // To collect the Upper
     sal_uLong mnIndex;        // The Index of the to-be-inserted Nodes
     bool mbMaster    : 1; // true => only Master, false => only Frames without Follow
@@ -125,7 +125,7 @@ static SwNode* GoPreviousWithFrame(SwNodeIndex *pIdx)
 }
 
 /**
- * The main purpose of this ctor is to find the right SwModify to iterate over.
+ * The main purpose of this ctor is to find the right sw::BroadcastingModify to iterate over.
  *
  * @param bSearch true:     find the next Content or TableNode which contains
  *                          Frames (to collect the pUpper).
@@ -166,13 +166,13 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, bool bSearc
     if( pNd )
     {
         if( pNd->IsContentNode() )
-            mpMod = const_cast<SwModify*>(static_cast<SwModify const *>(pNd->GetContentNode()));
+            mpMod = const_cast<sw::BroadcastingModify*>(static_cast<sw::BroadcastingModify const *>(pNd->GetContentNode()));
         else
         {
             assert(pNd->IsTableNode());
             mpMod = pNd->GetTableNode()->GetTable().GetFrameFormat();
         }
-        mpIter.reset(new SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti>(*mpMod));
+        mpIter.reset(new SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti>(*mpMod));
     }
     else
     {
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index e3c20c5230ef..c22469501045 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -67,7 +67,7 @@ using namespace ::com::sun::star;
 
 namespace {
 
-    void lcl_SwClientNotify(SwModify& rModify, const SfxPoolItem* pOldNew)
+    void lcl_SwClientNotify(sw::BroadcastingModify& rModify, const SfxPoolItem* pOldNew)
     {
         const sw::LegacyModifyHint aHint(pOldNew, pOldNew);
         rModify.SwClientNotify(rModify, aHint);
@@ -872,7 +872,7 @@ bool SwSectionFormat::GetInfo( SfxPoolItem& rInfo ) const
         }
         return false;
     }
-    return SwModify::GetInfo( rInfo );
+    return sw::BroadcastingModify::GetInfo( rInfo );
 }
 
 static bool lcl_SectionCmpPos( const SwSection *pFirst, const SwSection *pSecond)
@@ -965,14 +965,14 @@ void SwSectionFormat::UpdateParent()
             if (!pProtect->IsContentProtected() !=
                 !pSection->IsProtectFlag())
             {
-                lcl_SwClientNotify(*static_cast<SwModify*>(pLast), static_cast<SfxPoolItem const *>(pProtect));
+                lcl_SwClientNotify(*static_cast<sw::BroadcastingModify*>(pLast), static_cast<SfxPoolItem const *>(pProtect));
             }
 
             // edit in readonly sections
             if (!pEditInReadonly->GetValue() !=
                 !pSection->IsEditInReadonlyFlag())
             {
-                lcl_SwClientNotify(*static_cast<SwModify*>(pLast), static_cast<SfxPoolItem const *>(pEditInReadonly));
+                lcl_SwClientNotify(*static_cast<sw::BroadcastingModify*>(pLast), static_cast<SfxPoolItem const *>(pEditInReadonly));
             }
 
             if( bIsHidden == pSection->IsHiddenFlag() )
@@ -980,7 +980,7 @@ void SwSectionFormat::UpdateParent()
                 SwMsgPoolItem aMsgItem( static_cast<sal_uInt16>(bIsHidden
                             ? RES_SECTION_HIDDEN
                             : RES_SECTION_NOT_HIDDEN ) );
-                lcl_SwClientNotify(*static_cast<SwModify*>(pLast), &aMsgItem);
+                lcl_SwClientNotify(*static_cast<sw::BroadcastingModify*>(pLast), &aMsgItem);
             }
         }
         else if( !pSection &&
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 8bdcac6344de..8707bcbaeb84 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1787,7 +1787,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch )
                 // anchor at first found frame the 'master' object and
                 // at the following frames 'virtual' drawing objects.
                 // Note: method is similar to <SwFlyFrameFormat::MakeFrames(..)>
-                SwModify *pModify = nullptr;
+                sw::BroadcastingModify *pModify = nullptr;
                 if( pAnch->GetContentAnchor() )
                 {
                     if ( pAnch->GetAnchorId() == RndStdIds::FLY_AT_FLY )
@@ -1827,7 +1827,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch )
                     break;
                 }
 
-                SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti> aIter(*pModify);
+                SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti> aIter(*pModify);
                 SwFrame* pAnchorFrameOfMaster = nullptr;
                 for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
                 {
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index de6e0a18a531..ec03360cdc8f 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -136,7 +136,7 @@ SwPageDesc* SwEditShell::GetPageDescFromPool( sal_uInt16 nId )
     return GetDoc()->getIDocumentStylePoolAccess().GetPageDescFromPool( nId );
 }
 
-bool SwEditShell::IsUsed( const SwModify& rModify ) const
+bool SwEditShell::IsUsed( const sw::BroadcastingModify& rModify ) const
 {
     return mxDoc->IsUsed( rModify );
 }
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 58c9f82c13b7..f4ab419cbff1 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -55,7 +55,7 @@ using namespace com::sun::star;
 
 namespace
 {
-    void lcl_SwClientNotify(SwModify& rModify, const SfxPoolItem& rOldNew)
+    void lcl_SwClientNotify(sw::BroadcastingModify& rModify, const SfxPoolItem& rOldNew)
     {
         const sw::LegacyModifyHint aHint(&rOldNew, &rOldNew);
         rModify.SwClientNotify(rModify, aHint);
@@ -378,8 +378,8 @@ void SwGrfNode::TriggerGraphicArrived()
     // RES_GRAPHIC_ARRIVED_PREP and RES_GRAPHIC_ARRIVED.
     LockModify();
     {
-        SwIterator<SwModify,SwGrfNode> aIter(*this);
-        for(SwModify* pLast = aIter.First(); pLast; pLast = aIter.Next())
+        SwIterator<sw::BroadcastingModify,SwGrfNode> aIter(*this);
+        for(sw::BroadcastingModify* pLast = aIter.First(); pLast; pLast = aIter.Next())
             if(dynamic_cast<const SwContentFrame*>(pLast) ==  nullptr)
                 pLast->SwClientNotify(*this, sw::LegacyModifyHint(&aMsgHint, &aMsgHint));
     }
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 1c099696c504..2a053eacd94f 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -457,10 +457,12 @@ protected:
 
     /// use these so we can grep for SwFrame's GetRegisteredIn accesses
     /// beware that SwTextFrame may return sw::WriterMultiListener
-    SwModify        *GetDep()       { return GetRegisteredInNonConst(); }
-    const SwModify  *GetDep() const { return GetRegisteredIn(); }
+    sw::BroadcastingModify* GetDep()
+            { return static_cast<sw::BroadcastingModify*>(GetRegisteredInNonConst()); }
+    const sw::BroadcastingModify* GetDep() const
+            { return static_cast<const sw::BroadcastingModify*>(GetRegisteredIn()); }
 
-    SwFrame( SwModify*, SwFrame* );
+    SwFrame( sw::BroadcastingModify*, SwFrame* );
 
     void CheckDir( SvxFrameDirection nDir, bool bVert, bool bOnlyBiDi, bool bBrowse );
 
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 9e4565f508cf..c525f59be56e 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -206,7 +206,7 @@ const SwFrame * FindPage( const SwRect &rRect, const SwFrame *pPage );
       with care!
  */
 SwFrame* GetFrameOfModify( const SwRootFrame* pLayout,
-                       SwModify const&,
+                       sw::BroadcastingModify const&,
                        SwFrameType const nFrameType,
                        const SwPosition *pPos = nullptr,
                        std::pair<Point, bool> const* pViewPosAndCalcFrame = nullptr);
@@ -377,7 +377,7 @@ class SwBorderAttrs : public SwCacheObj
     void CalcLineSpacing_();
 
 public:
-    SwBorderAttrs( const SwModify *pOwner, const SwFrame *pConstructor );
+    SwBorderAttrs( const sw::BroadcastingModify *pOwner, const SwFrame *pConstructor );
     virtual ~SwBorderAttrs() override;
 
     const SwAttrSet      &GetAttrSet() const { return m_rAttrSet;  }
@@ -595,7 +595,7 @@ class SwDeletionChecker
 {
 private:
     const SwFrame* mpFrame;
-    const SwModify* mpRegIn;
+    const sw::BroadcastingModify* mpRegIn;
 
 public:
     SwDeletionChecker(const SwFrame* pFrame);
diff --git a/sw/source/core/inc/node2lay.hxx b/sw/source/core/inc/node2lay.hxx
index 56073cd89bde..4475e3a03296 100644
--- a/sw/source/core/inc/node2lay.hxx
+++ b/sw/source/core/inc/node2lay.hxx
@@ -33,7 +33,7 @@
  * assigned to a SectionFrame or to multiple ones due to nesting.
  *
  * This class is an interface between the method and a SwClientIter: it
- * chooses the right SwModify depending on the task, creates a SwClientIter
+ * chooses the right sw::BroadcastingModify depending on the task, creates a SwClientIter
  * and filters its iterations depending on the task.
  * The task is determined by the choice of class.
  *
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index c0506fdf91e6..a67f0ea692e4 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -421,7 +421,7 @@ private:
 public:
     SwRegHistory( SwHistory* pHst );
     SwRegHistory( const SwNode& rNd, SwHistory* pHst );
-    SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst );
+    SwRegHistory( sw::BroadcastingModify* pRegIn, const SwNode& rNd, SwHistory* pHst );
     virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
 
     /// @return true if at least 1 item was inserted
@@ -432,7 +432,7 @@ public:
 
     void AddHint( SwTextAttr* pHt, const bool bNew );
 
-    void RegisterInModify( SwModify* pRegIn, const SwNode& rNd );
+    void RegisterInModify( sw::BroadcastingModify* pRegIn, const SwNode& rNd );
     void ChangeNodeIndex( sal_uLong nNew ) { m_nNodeIndex = nNew; }
 };
 
diff --git a/sw/source/core/inc/unoparaframeenum.hxx b/sw/source/core/inc/unoparaframeenum.hxx
index e3712cf28b8b..4fc8d98f1e63 100644
--- a/sw/source/core/inc/unoparaframeenum.hxx
+++ b/sw/source/core/inc/unoparaframeenum.hxx
@@ -34,7 +34,7 @@ namespace sw
 {
     struct FrameClient : public SwClient
     {
-        FrameClient(SwModify* pModify) : SwClient(pModify) {};
+        FrameClient(sw::BroadcastingModify* pModify) : SwClient(pModify) {};
     };
 }
 struct FrameClientSortListEntry
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index a7f6d62566c1..e3ee7fa334b8 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -487,7 +487,7 @@ SwFormatHeader::SwFormatHeader( SwFrameFormat *pHeaderFormat )
 
 SwFormatHeader::SwFormatHeader( const SwFormatHeader &rCpy )
     : SfxPoolItem( RES_HEADER ),
-    SwClient( const_cast<SwModify*>(rCpy.GetRegisteredIn()) ),
+    SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCpy.GetRegisteredIn())) ),
     m_bActive( rCpy.IsActive() )
 {
 }
@@ -532,7 +532,7 @@ SwFormatFooter::SwFormatFooter( SwFrameFormat *pFooterFormat )
 
 SwFormatFooter::SwFormatFooter( const SwFormatFooter &rCpy )
     : SfxPoolItem( RES_FOOTER ),
-    SwClient( const_cast<SwModify*>(rCpy.GetRegisteredIn()) ),
+    SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCpy.GetRegisteredIn())) ),
     m_bActive( rCpy.IsActive() )
 {
 }
@@ -677,7 +677,7 @@ void SwFormatPageDesc::SwClientNotify( const SwModify& rModify, const SfxHint& r
     // mba: shouldn't that be broadcasted also?
     SwFormatPageDesc aDfltDesc( pHint->GetPageDesc() );
     SwPageDesc* pDesc = pHint->GetPageDesc();
-    const SwModify* pMod = GetDefinedIn();
+    const sw::BroadcastingModify* pMod = GetDefinedIn();
     if ( pMod )
     {
         if( auto pContentNode = dynamic_cast<const SwContentNode*>( pMod) )
@@ -686,7 +686,7 @@ void SwFormatPageDesc::SwClientNotify( const SwModify& rModify, const SfxHint& r
             const_cast<SwFormat*>(pFormat)->SetFormatAttr( aDfltDesc );
         else
         {
-            OSL_FAIL( "What kind of SwModify is this?" );
+            OSL_FAIL( "What kind of sw::BroadcastingModify is this?" );
             RegisterToPageDesc( *pDesc );
         }
     }
@@ -2905,7 +2905,7 @@ void SwFlyFrameFormat::MakeFrames()
     if( !GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() )
         return;
 
-    SwModify *pModify = nullptr;
+    sw::BroadcastingModify *pModify = nullptr;
     // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
     SwFormatAnchor aAnchorAttr( GetAnchor() );
     switch( aAnchorAttr.GetAnchorId() )
@@ -3000,7 +3000,7 @@ void SwFlyFrameFormat::MakeFrames()
     if( !pModify )
         return;
 
-    SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti> aIter(*pModify);
+    SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti> aIter(*pModify);
     for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
     {
         bool bAdd = !pFrame->IsContentFrame() ||
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 97a514b8c79d..08d9c36c866c 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -517,8 +517,7 @@ static void lcl_FrameRect(OStringBuffer& rOut, const char* hint, const SwRect& r
 static OString lcl_TableInfo(const SwTabFrame* pTabFrame)
 {
     const SwTable* pTable = pTabFrame->GetTable();
-    const SwModify* pModify = pTable->GetRegisteredIn();
-    const SwFormat* pFormat = static_cast<const SwFormat*>(pModify);
+    const SwFormat* pFormat = static_cast<const SwFormat*>(pTable->GetRegisteredIn());
     const OUString& text = pFormat->GetName();
     return OUStringToOString(text, RTL_TEXTENCODING_ASCII_US);
 }
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index baba2d3fe7f4..947f0f520141 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2138,7 +2138,7 @@ void MakeFrames( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
     bObjsDirect = true;
 }
 
-SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrame *pConstructor)
+SwBorderAttrs::SwBorderAttrs(const sw::BroadcastingModify *pMod, const SwFrame *pConstructor)
     : SwCacheObj(pMod)
     , m_rAttrSet(pConstructor->IsContentFrame()
                     ? pConstructor->IsTextFrame()
@@ -2194,7 +2194,7 @@ SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrame *pConstructor)
 
 SwBorderAttrs::~SwBorderAttrs()
 {
-    const_cast<SwModify *>(static_cast<SwModify const *>(m_pOwner))->SetInCache( false );
+    const_cast<sw::BroadcastingModify *>(static_cast<sw::BroadcastingModify const *>(m_pOwner))->SetInCache( false );
 }
 
 /* All calc methods calculate a safety distance in addition to the values given by the attributes.
@@ -2533,14 +2533,14 @@ void SwBorderAttrs::CalcLineSpacing_()
     m_bLineSpacing = false;
 }
 
-static SwModify const* GetCacheOwner(SwFrame const& rFrame)
+static sw::BroadcastingModify const* GetCacheOwner(SwFrame const& rFrame)
 {
     return rFrame.IsContentFrame()
-        ? static_cast<SwModify const*>(rFrame.IsTextFrame()
+        ? static_cast<sw::BroadcastingModify const*>(rFrame.IsTextFrame()
         // sw_redlinehide: presumably this caches the border attrs at the model level and can be shared across different layouts so we want the ParaProps node here
             ? static_cast<const SwTextFrame&>(rFrame).GetTextNodeForParaProps()
             : static_cast<const SwNoTextFrame&>(rFrame).GetNode())
-        : static_cast<SwModify const*>(static_cast<const SwLayoutFrame&>(rFrame).GetFormat());
+        : static_cast<sw::BroadcastingModify const*>(static_cast<const SwLayoutFrame&>(rFrame).GetFormat());
 }
 
 SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrame *pFrame ) :
@@ -2553,8 +2553,8 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrame *pFrame )
 
 SwCacheObj *SwBorderAttrAccess::NewObj()
 {
-    const_cast<SwModify *>(static_cast<SwModify const *>(m_pOwner))->SetInCache( true );
-    return new SwBorderAttrs( static_cast<SwModify const *>(m_pOwner), m_pConstructor );
+    const_cast<sw::BroadcastingModify *>(static_cast<sw::BroadcastingModify const *>(m_pOwner))->SetInCache( true );
+    return new SwBorderAttrs( static_cast<sw::BroadcastingModify const *>(m_pOwner), m_pConstructor );
 }
 
 SwBorderAttrs *SwBorderAttrAccess::Get()
@@ -3662,7 +3662,7 @@ void SwFrameHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
     }
 }
 
-SwFrame* GetFrameOfModify(SwRootFrame const*const pLayout, SwModify const& rMod,
+SwFrame* GetFrameOfModify(SwRootFrame const*const pLayout, sw::BroadcastingModify const& rMod,
         SwFrameType const nFrameType, SwPosition const*const pPos,
         std::pair<Point, bool> const*const pViewPosAndCalcFrame)
 {
@@ -3671,7 +3671,7 @@ SwFrame* GetFrameOfModify(SwRootFrame const*const pLayout, SwModify const& rMod,
     SwRect aCalcRect;
     bool bClientIterChanged = false;
 
-    SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti> aIter(rMod);
+    SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti> aIter(rMod);
     do {
         pMinFrame = nullptr;
         aHolder.Reset();
@@ -3882,7 +3882,7 @@ bool SwDeletionChecker::HasBeenDeleted() const
     if ( !mpFrame || !mpRegIn )
         return false;
 
-    SwIterator<SwFrame, SwModify, sw::IteratorMode::UnwrapMulti> aIter(*mpRegIn);
+    SwIterator<SwFrame, sw::BroadcastingModify, sw::IteratorMode::UnwrapMulti> aIter(*mpRegIn);
     SwFrame* pLast = aIter.First();
     while ( pLast )
     {
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index d642beced472..fc8b7b08787e 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -287,7 +287,7 @@ void SwPageDesc::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
 
 static const SwFrame* lcl_GetFrameOfNode( const SwNode& rNd )
 {
-    const SwModify* pMod;
+    const sw::BroadcastingModify* pMod;
     SwFrameType nFrameType = FRM_CNTNT;
 
     if( rNd.IsContentNode() )
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index b3c36051b661..adf3e5478176 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1489,7 +1489,7 @@ bool SwContentFrame::CalcLowers(SwLayoutFrame & rLay, SwLayoutFrame const& rDont
     // FME 2007-08-30 #i81146# new loop control
     int nLoopControlRuns = 0;
     const int nLoopControlMax = 10;
-    const SwModify* pLoopControlCond = nullptr;
+    const sw::BroadcastingModify* pLoopControlCond = nullptr;
 
     while (pCnt && rDontLeave.IsAnLower(pCnt))
     {
@@ -3799,7 +3799,7 @@ SwRowFrame::SwRowFrame(const SwTableLine &rLine, SwFrame* pSib, bool bInsertCont
 
 void SwRowFrame::DestroyImpl()
 {
-    SwModify* pMod = GetFormat();
+    sw::BroadcastingModify* pMod = GetFormat();
     if( pMod )
     {
         pMod->Remove( this );
@@ -4784,7 +4784,7 @@ SwCellFrame::SwCellFrame(const SwTableBox &rBox, SwFrame* pSib, bool bInsertCont
 
 void SwCellFrame::DestroyImpl()
 {
-    SwModify* pMod = GetFormat();
+    sw::BroadcastingModify* pMod = GetFormat();
     if( pMod )
     {
         // At this stage the lower frames aren't destroyed already,
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index c1fb4b3bffc3..beffc60737d4 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1827,7 +1827,7 @@ sal_uInt16 SwFrame::GetVirtPageNum() const
 
         if ( pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
         {
-            const SwModify *pMod = pDesc->GetDefinedIn();
+            const sw::BroadcastingModify *pMod = pDesc->GetDefinedIn();
             SwVirtPageNumInfo aInfo( pPage );
             pMod->GetInfo( aInfo );
             if ( aInfo.GetPage() )
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index ae422dc2ea46..416c44378c60 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -287,7 +287,7 @@ void TransformableSwFrame::transform(const basegfx::B2DHomMatrix& aTransform)
     maFramePrintAreaTransformation *= aTransform;
 }
 
-SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib )
+SwFrame::SwFrame( sw::BroadcastingModify *pMod, SwFrame* pSib )
 :   SwFrameAreaDefinition(),
     SwClient( pMod ),
     SfxBroadcaster(),
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index c2d9eb0cf311..60df4bbdb5e7 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -76,7 +76,7 @@ void SwFormatDrop::SwClientNotify(const SwModify&, const SfxHint&)
         return;
     if(dynamic_cast<const SwFormat*>(m_pDefinedIn) == nullptr)
     {
-        SwModify aMod;
+        sw::BroadcastingModify aMod;
         m_pDefinedIn->SwClientNotify(aMod, sw::LegacyModifyHint(this, this));
     }
     else if(m_pDefinedIn->HasWriterListeners() && !m_pDefinedIn->IsModifyLocked())
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 7ef9481598b6..97e999b1e21f 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1399,12 +1399,12 @@ SwTableBox* SwTable::GetTableBox( sal_uLong nSttIdx )
 
     if ( pCNd || pTableNd )
     {
-        SwModify* pModify = pCNd;
+        sw::BroadcastingModify* pModify = pCNd;
         // #144862# Better handling of table in table
         if ( pTableNd && pTableNd->GetTable().GetFrameFormat() )
             pModify = pTableNd->GetTable().GetFrameFormat();
 
-        SwFrame* pFrame = pModify ? SwIterator<SwFrame,SwModify>(*pModify).First() : nullptr;
+        SwFrame* pFrame = pModify ? SwIterator<SwFrame,sw::BroadcastingModify>(*pModify).First() : nullptr;
         while ( pFrame && !pFrame->IsCellFrame() )
             pFrame = pFrame->GetUpper();
         if ( pFrame )
@@ -1456,7 +1456,7 @@ SwTableLine::~SwTableLine()
         delete m_aBoxes[i];
     }
     // the TabelleLine can be deleted if it's the last client of the FrameFormat
-    SwModify* pMod = GetFrameFormat();
+    sw::BroadcastingModify* pMod = GetFrameFormat();
     pMod->Remove( this );               // remove,
     if( !pMod->HasWriterListeners() )
         delete pMod;    // and delete
@@ -1656,7 +1656,7 @@ SwTableBox::~SwTableBox()
     }
 
     // the TabelleBox can be deleted if it's the last client of the FrameFormat
-    SwModify* pMod = GetFrameFormat();
+    sw::BroadcastingModify* pMod = GetFrameFormat();
     pMod->Remove( this );               // remove,
     if( !pMod->HasWriterListeners() )
         delete pMod;    // and delete
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index b9dfd52fa9cb..3b954b6f857d 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1230,7 +1230,7 @@ SwTextFrame::MapViewToModel(TextFrameIndex const nIndex) const
     }
     else
     {
-        return std::make_pair(static_cast<SwTextNode*>(const_cast<SwModify*>(
+        return std::make_pair(static_cast<SwTextNode*>(const_cast<sw::BroadcastingModify*>(
                     SwFrame::GetDep())), sal_Int32(nIndex));
     }
 }
@@ -1251,7 +1251,7 @@ TextFrameIndex SwTextFrame::MapModelToView(SwTextNode const*const pNode, sal_Int
     }
     else
     {
-        assert(static_cast<SwTextNode*>(const_cast<SwModify*>(SwFrame::GetDep())) == pNode);
+        assert(static_cast<SwTextNode*>(const_cast<sw::BroadcastingModify*>(SwFrame::GetDep())) == pNode);
         return TextFrameIndex(nIndex);
     }
 }
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index c94aa5dde16a..703cec868733 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -185,7 +185,7 @@ void SwTOXMark::Notify(const SfxHint& rHint)
 
 void SwTOXMark::InvalidateTOXMark()
 {
-    const SwPtrMsgPoolItem aMsgHint(RES_REMOVE_UNO_OBJECT, &static_cast<SwModify&>(*this));
+    const SwPtrMsgPoolItem aMsgHint(RES_REMOVE_UNO_OBJECT, &static_cast<sw::BroadcastingModify&>(*this));
     CallSwClientNotify(sw::LegacyModifyHint(&aMsgHint, &aMsgHint));
 }
 
@@ -525,7 +525,7 @@ OUString SwForm::GetFormAuth()        {return "<A>";}
 
 SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
                      SwTOXElement nCreaType, const OUString& rTitle )
-    : SwClient(const_cast<SwModify*>(static_cast<SwModify const *>(pTyp)))
+    : SwClient(const_cast<sw::BroadcastingModify*>(static_cast<sw::BroadcastingModify const *>(pTyp)))
     , m_aForm(rForm)
     , m_aTitle(rTitle)
     , m_eLanguage(::GetAppLanguage())
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 19114a8f4712..23363c6f3e3b 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -215,7 +215,7 @@ SwFormatField* SwFormatField::Clone( SfxItemPool* ) const
 
 void SwFormatField::InvalidateField()
 {
-    const SwPtrMsgPoolItem aItem(RES_REMOVE_UNO_OBJECT, &static_cast<SwModify&>(*this));
+    const SwPtrMsgPoolItem aItem(RES_REMOVE_UNO_OBJECT, &static_cast<sw::BroadcastingModify&>(*this));
     CallSwClientNotify(sw::LegacyModifyHint{ &aItem, &aItem });
 }
 
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 7726eac055d1..2274eb5e960b 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -162,7 +162,7 @@ void SwFormatFootnote::Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew)
 void SwFormatFootnote::InvalidateFootnote()
 {
     SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT,
-            &static_cast<SwModify&>(*this)); // cast to base class (void*)
+            &static_cast<sw::BroadcastingModify&>(*this)); // cast to base class (void*)
     NotifyClients(&item, &item);
 }
 
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 62302ae013d9..c4be350c3445 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -66,7 +66,7 @@ void SwFormatRefMark::Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew)
 void SwFormatRefMark::InvalidateRefMark()
 {
     SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT,
-            &static_cast<SwModify&>(*this)); // cast to base class (void*)
+            &static_cast<sw::BroadcastingModify&>(*this)); // cast to base class (void*)
     NotifyClients(&item, &item);
 }
 
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 62cf217563a1..c389b4d027f7 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1831,7 +1831,7 @@ static void lcl_CopyHint(
             && pDest->GetpSwpHints()->Contains( pNewHt ) )
         {
             // ToXMarks that are copied to different SwDocs must register
-            // at their new ToX (SwModify).
+            // at their new ToX (sw::BroadcastingModify).
             static_txtattr_cast<SwTextTOXMark*>(pNewHt)->CopyTOXMark(*pOtherDoc);
         }
         break;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index f7e8a968a6ef..13e240a3b6f5 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1368,7 +1368,7 @@ SwRegHistory::SwRegHistory( SwHistory* pHst )
     MakeSetWhichIds();
 }
 
-SwRegHistory::SwRegHistory( SwModify* pRegIn, const SwNode& rNd,
+SwRegHistory::SwRegHistory( sw::BroadcastingModify* pRegIn, const SwNode& rNd,
                             SwHistory* pHst )
     : SwClient( pRegIn )
     , m_pHistory( pHst )
@@ -1493,7 +1493,7 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
     return bInserted;
 }
 
-void SwRegHistory::RegisterInModify( SwModify* pRegIn, const SwNode& rNd )
+void SwRegHistory::RegisterInModify( sw::BroadcastingModify* pRegIn, const SwNode& rNd )
 {
     if ( m_pHistory && pRegIn )
     {
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index f6919bbc7467..fbb2a8744d8a 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -1199,11 +1199,11 @@ static void lcl_ExtractFramePositions(FrameClientSortList_t& rFrames, sal_Int32
         if (rFrame.nIndex > nCurrentIndex)
             break;
 
-        const SwModify* pFrame = rFrame.pFrameClient->GetRegisteredIn();
+        const auto pFrame = static_cast<const SwFrameFormat*>(rFrame.pFrameClient->GetRegisteredIn());
         if (!pFrame)
             continue;
 
-        auto& rFormat = *static_cast<SwFrameFormat*>(const_cast<SwModify*>(pFrame));
+        auto& rFormat = *const_cast<SwFrameFormat*>(pFrame);
         const SwFormatAnchor& rAnchor = rFormat.GetAnchor();
         const SwPosition* pPosition = rAnchor.GetContentAnchor();
         if (!pPosition)
@@ -1235,12 +1235,10 @@ static sal_Int32 lcl_ExportFrames(
     while (!i_rFrames.empty() && (i_rFrames.front().nIndex == i_nCurrentIndex))
     // do not check for i_nEnd here; this is done implicitly by lcl_MoveCursor
     {
-        const SwModify * const pFrame =
-            i_rFrames.front().pFrameClient->GetRegisteredIn();
+        auto pFrame = static_cast<SwFrameFormat*>(i_rFrames.front().pFrameClient->GetRegisteredIn());
         if (pFrame) // Frame could be disposed
         {
-            SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCursor, i_xParent,
-                *static_cast<SwFrameFormat*>( const_cast<SwModify*>( pFrame ) ) );
+            SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCursor, i_xParent, *pFrame );
             rPortions.emplace_back(pPortion);
         }
         i_rFrames.pop_front();
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index aa94abd1a229..62b34a61cd4f 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -652,7 +652,7 @@ inline const ::sw::Meta* SwXMeta::Impl::GetMeta() const
     return m_pMeta;
 }
 
-// SwModify
+// sw::BroadcastingModify
 void SwXMeta::Impl::Notify(const SfxHint& rHint)
 {
     m_pTextPortions.reset(); // throw away cache (SwTextNode changed)
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 97437d754923..fdfec6fde53a 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1138,7 +1138,7 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
     if (aTextAtrArr.empty())
         return;
 
-    const SwModify* pOldMod = m_rExport.m_pOutFormatNode;
+    const sw::BroadcastingModify* pOldMod = m_rExport.m_pOutFormatNode;
     m_rExport.m_pOutFormatNode = nullptr;
 
     const SfxItemPool* pSrcPool = pEditPool;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 96d12e8afe43..a59a13fe4766 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -499,7 +499,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bWriteCombChars)
 
     if ( !aExportItems.empty() )
     {
-        const SwModify* pOldMod = m_rExport.m_pOutFormatNode;
+        const sw::BroadcastingModify* pOldMod = m_rExport.m_pOutFormatNode;
         m_rExport.m_pOutFormatNode = &rNd;
         m_rExport.m_aCurrentCharPropStarts.push( nSwPos );
 
@@ -3060,7 +3060,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
             {                                               // Para-Attrs
                 m_pStyAttr = &rNode.GetAnyFormatColl().GetAttrSet();
 
-                const SwModify* pOldMod = m_pOutFormatNode;
+                const sw::BroadcastingModify* pOldMod = m_pOutFormatNode;
                 m_pOutFormatNode = &rNode;
 
                 // Pap-Attrs, so script is not necessary
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 3917f7ff2fa6..caae58fbb163 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -447,7 +447,7 @@ void WW8AttributeOutput::StartStyle( const OUString& rName, StyleType eType, sal
 
 void MSWordStyles::SetStyleDefaults( const SwFormat& rFormat, bool bPap )
 {
-    const SwModify* pOldMod = m_rExport.m_pOutFormatNode;
+    const sw::BroadcastingModify* pOldMod = m_rExport.m_pOutFormatNode;
     m_rExport.m_pOutFormatNode = &rFormat;
     bool aFlags[ RES_FRMATR_END - RES_CHRATR_BEGIN ];
     sal_uInt16 nStt, nEnd, n;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c7c1e3b14d05..3ad49714fac3 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -35,6 +35,7 @@
 #include <msfilter.hxx>
 #include <expfld.hxx>
 #include "WW8TableInfo.hxx"
+#include <calbck.hxx>
 
 #include <vcl/graph.hxx>
 
@@ -82,7 +83,6 @@ class SwFormatContent;
 class SwFormatFootnote;
 class SwFrameFormat;
 class SwGrfNode;
-class SwModify;
 class SwNumFormat;
 class SwNumRule;
 class SwNumRuleTable;
@@ -528,7 +528,7 @@ public:
                                     // graphics inside tables
     std::unique_ptr<SwWW8WrGrf> m_pGrf;
     const SwAttrSet* m_pStyAttr;      // StyleAttr for Tabs
-    const SwModify* m_pOutFormatNode;    // write Format or Node
+    const sw::BroadcastingModify* m_pOutFormatNode;    // write Format or Node
     const SwFormat *m_pCurrentStyle;     // iff bStyDef=true, then this store the current style
 
     MainTextPlcDrawObj *m_pSdrObjs;   // Draw-/Fly-Objects
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 29bb0369ded2..cc66c44952c0 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -760,7 +760,7 @@ bool WW8Export::DisallowInheritingOutlineNumbering(const SwFormat &rFormat)
 void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat )
 {
     bool bCallOutSet = true;
-    const SwModify* pOldMod = m_pOutFormatNode;
+    const sw::BroadcastingModify* pOldMod = m_pOutFormatNode;
     m_pOutFormatNode = &rFormat;
 
     switch( rFormat.Which() )
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 6c10b11eb65a..a15f9000883b 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2241,7 +2241,7 @@ bool  SwDocStyleSheet::IsUsed() const
     if( !bPhysical )
         return false;
 
-    const SwModify* pMod;
+    const sw::BroadcastingModify* pMod;
     switch( nFamily )
     {
     case SfxStyleFamily::Char : pMod = pCharFormat;   break;
@@ -2582,7 +2582,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName,
     }
 
     const bool bSearchUsed = ( n != SfxStyleSearchBits::All && n & SfxStyleSearchBits::Used );
-    const SwModify* pMod = nullptr;
+    const sw::BroadcastingModify* pMod = nullptr;
 
     mxStyleSheet->SetPhysical( false );
     mxStyleSheet->PresetName( rName );
commit c967a7f0130d804a73fa7073c4a1703fcd51bd75
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Thu Nov 5 11:23:02 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 5 14:10:12 2020 +0100

    loplugin:reducevarscope in scripting
    
    Change-Id: I214f58c9d0bd8e574e8882234c84f595605d2fe7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105331
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx
index 26ed5f08ed80..9ac68be5faf8 100644
--- a/scripting/source/basprov/basmethnode.cxx
+++ b/scripting/source/basprov/basmethnode.cxx
@@ -192,7 +192,7 @@ namespace basprov
         }
 
         OUString sDocURL, sLibName, sModName;
-        sal_uInt16 nLine1 = 0, nLine2;
+        sal_uInt16 nLine1 = 0;
 
         if ( !m_bIsAppScript )
         {
@@ -215,6 +215,7 @@ namespace basprov
 
         if ( m_pMethod )
         {
+            sal_uInt16 nLine2;
             m_pMethod->GetLineRange( nLine1, nLine2 );
             SbModule* pModule = m_pMethod->GetModule();
             if ( pModule )
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 217536d66c55..455174f2eff8 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -886,12 +886,11 @@ void StringResourcePersistenceImpl::implStoreAtStorage
             Reference< io::XStream > xElementStream =
                     Storage->openStreamElement( aStreamName, ElementModes::READWRITE );
 
-            OUString aPropName("MediaType");
-
             uno::Reference< beans::XPropertySet > xProps( xElementStream, uno::UNO_QUERY );
             OSL_ENSURE( xProps.is(), "The StorageStream must implement XPropertySet interface!" );
             if ( xProps.is() )
             {
+                OUString aPropName("MediaType");
                 xProps->setPropertyValue( aPropName, uno::makeAny( OUString("text/plain") ) );
 
                 aPropName = "UseCommonStoragePasswordEncryption";


More information about the Libreoffice-commits mailing list