include/svl/hint.hxx                                    |    1 
 include/svl/poolitem.hxx                                |    1 
 sw/inc/hintids.hxx                                      |    1 
 sw/inc/hints.hxx                                        |   11 +-
 sw/inc/ndtxt.hxx                                        |    4 
 sw/inc/swevent.hxx                                      |    3 
 sw/source/core/attr/calbck.cxx                          |    3 
 sw/source/core/attr/format.cxx                          |    3 
 sw/source/core/attr/hints.cxx                           |    4 
 sw/source/core/crsr/bookmark.cxx                        |    2 
 sw/source/core/crsr/crsrsh.cxx                          |    6 -
 sw/source/core/crsr/pam.cxx                             |    2 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    2 
 sw/source/core/doc/docredln.cxx                         |    2 
 sw/source/core/doc/fmtcol.cxx                           |    8 +
 sw/source/core/doc/lineinfo.cxx                         |    3 
 sw/source/core/doc/notxtfrm.cxx                         |   23 ++--
 sw/source/core/doc/visiturl.cxx                         |    2 
 sw/source/core/docnode/node.cxx                         |   42 ++++----
 sw/source/core/docnode/section.cxx                      |    5 +
 sw/source/core/draw/dcontact.cxx                        |    3 
 sw/source/core/fields/ddetbl.cxx                        |    3 
 sw/source/core/fields/docufld.cxx                       |    4 
 sw/source/core/fields/reffld.cxx                        |   13 ++
 sw/source/core/fields/usrfld.cxx                        |    6 +
 sw/source/core/graphic/ndgrf.cxx                        |    2 
 sw/source/core/layout/atrfrm.cxx                        |    3 
 sw/source/core/layout/flyincnt.cxx                      |    3 
 sw/source/core/layout/flylay.cxx                        |    3 
 sw/source/core/layout/pagedesc.cxx                      |    3 
 sw/source/core/layout/tabfrm.cxx                        |    4 
 sw/source/core/table/swtable.cxx                        |    4 
 sw/source/core/text/txtfrm.cxx                          |   78 ++++++++--------
 sw/source/core/txtnode/atrfld.cxx                       |   35 ++++++-
 sw/source/core/txtnode/attrcontentcontrol.cxx           |    3 
 sw/source/core/txtnode/fmtatr2.cxx                      |    3 
 sw/source/core/txtnode/ndtxt.cxx                        |   25 +----
 sw/source/core/txtnode/thints.cxx                       |    8 -
 sw/source/core/txtnode/txtatr2.cxx                      |   24 ++--
 sw/source/core/txtnode/txtedt.cxx                       |    2 
 sw/source/core/unocore/unochart.cxx                     |    3 
 41 files changed, 219 insertions(+), 141 deletions(-)

New commits:
commit 384c21f8937b5b38c52178e051d929408eea6606
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Jan 6 21:29:55 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jan 16 21:08:27 2025 +0100

    convert RES_UPDATE_ATTR to SfxHint
    
    Change-Id: I4d5da5ba4e65ddbce2cb05bdfda34eb582c52d59
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179843
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
index 53875a19dfa5..ee919d32c442 100644
--- a/include/svl/hint.hxx
+++ b/include/svl/hint.hxx
@@ -234,6 +234,7 @@ enum class SfxHintId {
     SwFormatChange,
     SwAttrSetChange,
     SwObjectDying,
+    SwUpdateAttr,
 
     ThisIsAnSdrHint,
     ThisIsAnSfxEventHint
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index 979a4ceccc8d..6d0105707077 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -496,7 +496,6 @@ enum class SfxItemType : sal_uInt16
     SwTOXMarkType,
     SwTransparencyGrfType,
     SwUINumRuleItemType,
-    SwUpdateAttrType,
     SwWrtShellItemType,
     XColorItemType,
     XFillAttrSetItemType,
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index be104eedbeb8..6f6be37f80e6 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -431,7 +431,6 @@ inline constexpr sal_uInt16 RES_UPDATEATTR_ATTRSET_CHG(
     168); // used by SwUpdateAttr just as an ID to communicate what has changed
 inline constexpr sal_uInt16 RES_UPDATEATTR_OBJECTDYING(
     169); // used by SwUpdateAttr just as an ID to communicate what has changed
-inline constexpr TypedWhichId<SwUpdateAttr> RES_UPDATE_ATTR(170);
 // empty
 inline constexpr sal_uInt16 RES_FORMAT_MSG_END(190);
 
diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx
index d7a1049b12d1..645cf6b0c8d3 100644
--- a/sw/inc/hints.hxx
+++ b/sw/inc/hints.hxx
@@ -41,6 +41,7 @@ class SwTableLine;
 class SwTableLineFormat;
 class SwTableBox;
 class SwAttrSetChg;
+class SwUpdateAttr;
 
 // Base class for all Message-Hints:
 // "Overhead" of SfxPoolItem is handled here
@@ -322,9 +323,16 @@ public:
     SwModify* m_pDying;
     ObjectDyingHint(SwModify* pDead) : SfxHint(SfxHintId::SwObjectDying), 
m_pDying(pDead) {}
 };
+class UpdateAttrHint final : public SfxHint
+{
+public:
+    const SwUpdateAttr* m_pOld;
+    const SwUpdateAttr* m_pNew;
+    UpdateAttrHint(const SwUpdateAttr* pOld, const SwUpdateAttr* pNew) : 
SfxHint(SfxHintId::SwUpdateAttr), m_pOld(pOld), m_pNew(pNew) {}
+};
 } // namespace sw
 
-class SwUpdateAttr final : public SwMsgPoolItem
+class SwUpdateAttr final
 {
 private:
     sal_Int32 m_nStart;
@@ -333,7 +341,6 @@ private:
     std::vector<sal_uInt16> m_aWhichFmtAttrs; // attributes changed inside 
RES_TXTATR_AUTOFMT
 
 public:
-    DECLARE_ITEM_TYPE_FUNCTION(SwUpdateAttr)
     SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW );
     SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, 
std::vector<sal_uInt16> aW );
 
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 95ef737cb486..0678c4086cd6 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -74,6 +74,7 @@ namespace sw {
     class TextNodeNotificationSuppressor;
     class RemoveUnoObjectHint;
     class AttrSetChangeHint;
+    class UpdateAttrHint;
     namespace mark { enum class RestoreMode; }
 }
 
@@ -245,8 +246,7 @@ public:
     /// for hanging TextFormatCollections somewhere else (Outline-Numbering!)
     void TriggerNodeUpdate(const sw::LegacyModifyHint&);
     void TriggerNodeUpdate(const sw::AttrSetChangeHint&);
-    void TriggerNodeUpdate(const sw::RemoveUnoObjectHint&);
-    void TriggerNodeUpdate(const sw::ObjectDyingHint&);
+    void TriggerNodeUpdate(const SfxHint&);
     void TriggerNodeUpdate(const SwFormatChangeHint&);
 
     const OUString& GetText() const { return m_Text; }
diff --git a/sw/inc/swevent.hxx b/sw/inc/swevent.hxx
index 90378efa5063..e35dc2c391c8 100644
--- a/sw/inc/swevent.hxx
+++ b/sw/inc/swevent.hxx
@@ -133,7 +133,8 @@ struct SwCallMouseEvent final
         }
         else if (rHint.GetId() == SfxHintId::SwLegacyModify
                 || SfxHintId::SwAttrSetChange == rHint.GetId()
-                || SfxHintId::SwObjectDying == rHint.GetId())
+                || SfxHintId::SwObjectDying == rHint.GetId()
+                || SfxHintId::SwUpdateAttr == rHint.GetId())
         {
             assert(EVENT_OBJECT_IMAGE == eType || EVENT_OBJECT_URLITEM == 
eType || EVENT_OBJECT_IMAGEMAP == eType);
             SwClient::SwClientNotify(rMod, rHint);
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 9b03cac2192e..8eeae58276ec 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -254,7 +254,8 @@ void SwModify::SwClientNotify(const SwModify&, const 
SfxHint& rHint)
     if (rHint.GetId() != SfxHintId::SwLegacyModify
         && rHint.GetId() != SfxHintId::SwRemoveUnoObject
         && rHint.GetId() != SfxHintId::SwAttrSetChange
-        && rHint.GetId() != SfxHintId::SwObjectDying)
+        && rHint.GetId() != SfxHintId::SwObjectDying
+        && rHint.GetId() != SfxHintId::SwUpdateAttr)
         return;
 
     DBG_TESTSOLARMUTEX();
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index a87a59529d4a..e941fa6320ef 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -207,7 +207,8 @@ SwFormat::~SwFormat()
 
 void SwFormat::SwClientNotify(const SwModify&, const SfxHint& rHint)
 {
-    if (rHint.GetId() == SfxHintId::SwRemoveUnoObject)
+    if (rHint.GetId() == SfxHintId::SwRemoveUnoObject
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwModify::SwClientNotify(*this, rHint);
         return;
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index a16ba772c8e8..8aaabaf26816 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -65,12 +65,12 @@ void AutoFormatUsedHint::CheckNode(const SwNode* pNode) 
const
 } // namespace sw
 
 SwUpdateAttr::SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW )
-    : SwMsgPoolItem( RES_UPDATE_ATTR ), m_nStart( nS ), m_nEnd( nE ), 
m_nWhichAttr( nW )
+    : m_nStart( nS ), m_nEnd( nE ), m_nWhichAttr( nW )
 {
 }
 
 SwUpdateAttr::SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW, 
std::vector<sal_uInt16> aW )
-    : SwMsgPoolItem( RES_UPDATE_ATTR ), m_nStart( nS ), m_nEnd( nE ), 
m_nWhichAttr( nW ), m_aWhichFmtAttrs(std::move( aW ))
+    : m_nStart( nS ), m_nEnd( nE ), m_nWhichAttr( nW ), 
m_aWhichFmtAttrs(std::move( aW ))
 {
 }
 
diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx
index 5e62e948db5e..b25bdbe50e6b 100644
--- a/sw/source/core/crsr/bookmark.cxx
+++ b/sw/source/core/crsr/bookmark.cxx
@@ -263,7 +263,7 @@ namespace
     auto InvalidatePosition(SwPosition const& rPos) -> void
     {
         SwUpdateAttr const aHint(rPos.GetContentIndex(), 
rPos.GetContentIndex(), 0);
-        
rPos.GetNode().GetTextNode()->CallSwClientNotify(sw::LegacyModifyHint(&aHint, 
&aHint));
+        
rPos.GetNode().GetTextNode()->CallSwClientNotify(sw::UpdateAttrHint(&aHint, 
&aHint));
     }
 }
 
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 21419732e594..12ded9650e55 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2907,7 +2907,9 @@ void SwCursorShell::SwClientNotify(const SwModify&, const 
SfxHint& rHint)
             m_aGrfArrivedLnk.Call(*this);
         return;
     }
-    if (rHint.GetId() == SfxHintId::SwFormatChange || rHint.GetId() == 
SfxHintId::SwAttrSetChange)
+    if (rHint.GetId() == SfxHintId::SwFormatChange
+        || rHint.GetId() == SfxHintId::SwAttrSetChange
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         if( m_bCallChgLnk )
             // messages are not forwarded
@@ -2927,7 +2929,7 @@ void SwCursorShell::SwClientNotify(const SwModify&, const 
SfxHint& rHint)
     auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
     auto nWhich = pLegacy->GetWhich();
     if( m_bCallChgLnk &&
-        ( nWhich == 0 || !isFormatMessage(nWhich) || nWhich == RES_UPDATE_ATTR 
))
+        ( nWhich == 0 || !isFormatMessage(nWhich) ))
         // messages are not forwarded
         // #i6681#: RES_UPDATE_ATTR is implicitly unset in
         // SwTextNode::Insert(SwTextHint*, sal_uInt16); we react here and thus 
do
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 710744b4b8ae..b122b474e38e 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1374,7 +1374,7 @@ void SwPaM::InvalidatePaM()
                     ? End()->GetContentIndex() - nStart
                     : pTextNode->Len() - nStart,
                 0);
-            pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aHint, &aHint));
+            pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aHint, &aHint));
         }
         // other node types not invalidated
     }
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index c26b9198c3da..2efcf0f94493 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2848,7 +2848,7 @@ bool DocumentContentOperationsManager::Overwrite( const 
SwPaM &rRg, const OUStri
     if( nOldAttrCnt != nNewAttrCnt )
     {
         const SwUpdateAttr aHint(0,0,0);
-        pNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aHint, &aHint));
+        pNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aHint, &aHint));
     }
 
     if (!m_rDoc.GetIDocumentUndoRedo().DoesUndo() &&
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 6d5a9247baae..2434d4863fb1 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1716,7 +1716,7 @@ void SwRangeRedline::InvalidateRange(Invalidation const 
eWhy)
                 n == nEndNd ? nEndCnt : pNd->GetText().getLength(),
                 RES_UPDATEATTR_FMT_CHG);
 
-            pNd->TriggerNodeUpdate(sw::LegacyModifyHint(&aHt, &aHt));
+            pNd->TriggerNodeUpdate(sw::UpdateAttrHint(&aHt, &aHt));
 
             // SwUpdateAttr must be handled first, otherwise indexes are off
             if (GetType() == RedlineType::Delete)
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 65c00b9b61ee..3f3fe2a037eb 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -140,7 +140,9 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
         return;
     }
     else if (rHint.GetId() != SfxHintId::SwLegacyModify && rHint.GetId() != 
SfxHintId::SwFormatChange
-             && rHint.GetId() != SfxHintId::SwAttrSetChange && rHint.GetId() 
!= SfxHintId::SwObjectDying)
+             && rHint.GetId() != SfxHintId::SwAttrSetChange
+             && rHint.GetId() != SfxHintId::SwObjectDying
+             && rHint.GetId() != SfxHintId::SwUpdateAttr)
         return;
     if(GetDoc()->IsInDtor())
     {
@@ -362,7 +364,9 @@ 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 (rHint.GetId() == SfxHintId::SwLegacyModify || rHint.GetId() == 
SfxHintId::SwObjectDying)
+    if (rHint.GetId() == SfxHintId::SwLegacyModify
+        || rHint.GetId() == SfxHintId::SwObjectDying
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         if (bNewParent || !nNoNotify)
             SwFormatColl::SwClientNotify(rModify, rHint);
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 70c2699ffd45..0330e4007da9 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -116,7 +116,8 @@ void SwLineNumberInfo::SwClientNotify(const SwModify&, 
const SfxHint& rHint)
 {
     if (rHint.GetId() != SfxHintId::SwLegacyModify
         && rHint.GetId() != SfxHintId::SwFormatChange
-        && rHint.GetId() != SfxHintId::SwAttrSetChange)
+        && rHint.GetId() != SfxHintId::SwAttrSetChange
+        && rHint.GetId() != SfxHintId::SwUpdateAttr)
         return;
     if (rHint.GetId() == SfxHintId::SwObjectDying)
     {
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 39b006670c7f..6fee44775281 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -826,6 +826,14 @@ void SwNoTextFrame::SwClientNotify(const SwModify& 
rModify, const SfxHint& rHint
         InvalidatePrt();
         SetCompletePaint();
     }
+    else if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        SwContentFrame::SwClientNotify(rModify, rHint);
+        if (GetNode()->GetNodeType() == SwNodeType::Grf)
+            ClearCache();
+        InvalidatePrt();
+        SetCompletePaint();
+    }
     else if (rHint.GetId() == SfxHintId::SwLegacyModify)
     {
         auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
@@ -833,19 +841,8 @@ void SwNoTextFrame::SwClientNotify(const SwModify& 
rModify, const SfxHint& rHint
 
         SwContentFrame::SwClientNotify(rModify, rHint);
 
-        switch( nWhich )
-        {
-        case RES_UPDATE_ATTR:
-            if (GetNode()->GetNodeType() != SwNodeType::Grf) {
-                break;
-            }
-            ClearCache();
-            break;
-
-        default:
-            if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
-                return;
-        }
+        if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
+            return;
 
         InvalidatePrt();
         SetCompletePaint();
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 1cbb1e2710bb..62aaad0afc76 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -78,7 +78,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const 
SfxHint& rHint )
                     *pAttr->End(),
                     RES_UPDATEATTR_FMT_CHG);
 
-                
const_cast<SwTextNode*>(pTextNd)->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr,
 &aUpdateAttr));
+                
const_cast<SwTextNode*>(pTextNd)->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr,
 &aUpdateAttr));
             }
             return true;
         });
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index fc2cc4fc18a7..9d7c57b15659 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1105,7 +1105,7 @@ void SwContentNode::UpdateAttr(const SwUpdateAttr& 
rUpdate)
             && IsTextNode()
             && RES_UPDATEATTR_ATTRSET_CHG == rUpdate.getWhichAttr())
         static_cast<SwTextNode*>(this)->SetCalcHiddenCharFlags();
-    CallSwClientNotify(sw::LegacyModifyHint(&rUpdate, &rUpdate));
+    CallSwClientNotify(sw::UpdateAttrHint(&rUpdate, &rUpdate));
 }
 
 void SwContentNode::SwClientNotify( const SwModify&, const SfxHint& rHint)
@@ -1161,30 +1161,28 @@ void SwContentNode::SwClientNotify( const SwModify&, 
const SfxHint& rHint)
         auto pLegacyHint = static_cast<const sw::LegacyModifyHint*>(&rHint);
         const sal_uInt16 nWhich = pLegacyHint->GetWhich();
         InvalidateInSwCache(nWhich);
+        CallSwClientNotify(rHint);
+    }
+    else if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        auto pUpdateAttrHint = static_cast<const sw::UpdateAttrHint*>(&rHint);
 
-        switch(nWhich)
-        {
-            case RES_UPDATE_ATTR:
-                // RES_UPDATE_ATTR _should_ always contain a SwUpdateAttr hint 
in old and new.
-                // However, faking one with just a basic SfxPoolItem setting a 
WhichId has been observed.
-                // This makes the crude "WhichId" type divert from the true 
type, which is bad.
-                // Thus we are asserting here, but falling back to an proper
-                // hint instead. so that we at least will not spread such 
poison further.
+        // RES_UPDATE_ATTR _should_ always contain a SwUpdateAttr hint in old 
and new.
+        // However, faking one with just a basic SfxPoolItem setting a WhichId 
has been observed.
+        // This makes the crude "WhichId" type divert from the true type, 
which is bad.
+        // Thus we are asserting here, but falling back to an proper
+        // hint instead. so that we at least will not spread such poison 
further.
 #ifdef DBG_UTIL
-                if (!SfxPoolItem::areSame(pLegacyHint->m_pNew, 
pLegacyHint->m_pOld))
-                {
-                    auto pBT = sal::backtrace_get(20);
-                    SAL_WARN("sw.core", "UpdateAttr not matching! " << 
sal::backtrace_to_string(pBT.get()));
-                }
-#endif
-                assert(SfxPoolItem::areSame(pLegacyHint->m_pNew, 
pLegacyHint->m_pOld));
-                assert(dynamic_cast<const SwUpdateAttr*>(pLegacyHint->m_pNew));
-                const SwUpdateAttr aFallbackHint(0,0,0);
-                const SwUpdateAttr& rUpdateAttr = pLegacyHint->m_pNew ? 
*static_cast<const SwUpdateAttr*>(pLegacyHint->m_pNew) : aFallbackHint;
-                UpdateAttr(rUpdateAttr);
-                return;
+        if (pUpdateAttrHint->m_pNew != pUpdateAttrHint->m_pOld)
+        {
+            auto pBT = sal::backtrace_get(20);
+            SAL_WARN("sw.core", "UpdateAttr not matching! " << 
sal::backtrace_to_string(pBT.get()));
         }
-        CallSwClientNotify(rHint);
+#endif
+        assert(pUpdateAttrHint->m_pNew == pUpdateAttrHint->m_pOld);
+        const SwUpdateAttr aFallbackHint(0,0,0);
+        const SwUpdateAttr& rUpdateAttr = pUpdateAttrHint->m_pNew ? 
*pUpdateAttrHint->m_pNew : aFallbackHint;
+        UpdateAttr(rUpdateAttr);
     }
     else if (rHint.GetId() == SfxHintId::SwAutoFormatUsedHint)
     {
diff --git a/sw/source/core/docnode/section.cxx 
b/sw/source/core/docnode/section.cxx
index 53ac6e8f0df3..0fb7d171f6f8 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -799,6 +799,11 @@ void SwSectionFormat::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
             SwFrameFormat::SwClientNotify(rMod, rHint);
         return;
     }
+    else if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        SwFrameFormat::SwClientNotify(rMod, rHint);
+        return;
+    }
     else if (rHint.GetId() != SfxHintId::SwLegacyModify)
         return;
     auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 6594b0ac8ddc..cc0b3556bc1a 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1420,7 +1420,8 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
         // #i51474#
         GetAnchoredObj(nullptr)->ResetLayoutProcessBools();
     }
-    else if(SfxHintId::SwFormatChange == rHint.GetId())
+    else if(SfxHintId::SwFormatChange == rHint.GetId()
+            || SfxHintId::SwUpdateAttr == rHint.GetId())
     {
         // #i51474#
         GetAnchoredObj(nullptr)->ResetLayoutProcessBools();
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index ecb1ced273bc..e528bd99366a 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -88,7 +88,8 @@ void SwDDETable::SwClientNotify(const SwModify& rModify, 
const SfxHint& rHint)
     if (rHint.GetId() == SfxHintId::SwLegacyModify
         || rHint.GetId() == SfxHintId::SwAutoFormatUsedHint
         || rHint.GetId() == SfxHintId::SwAttrSetChange
-        || rHint.GetId() == SfxHintId::SwObjectDying)
+        || rHint.GetId() == SfxHintId::SwObjectDying
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwTable::SwClientNotify(rModify, rHint);
     }
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 832b5177841b..0605bb34b0cc 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2260,7 +2260,9 @@ std::unique_ptr<SwFieldType> 
SwRefPageGetFieldType::Copy() const
 
 void SwRefPageGetFieldType::SwClientNotify(const SwModify&, const SfxHint& 
rHint)
 {
-    if (rHint.GetId() == SfxHintId::SwFormatChange || rHint.GetId() == 
SfxHintId::SwObjectDying)
+    if (rHint.GetId() == SfxHintId::SwFormatChange
+        || rHint.GetId() == SfxHintId::SwObjectDying
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         // forward to text fields, they "expand" the text
         CallSwClientNotify(rHint);
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index fcbb45cf539d..3961aebf9594 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1178,6 +1178,19 @@ void SwGetRefFieldType::SwClientNotify(const SwModify&, 
const SfxHint& rHint)
             CallSwClientNotify(rHint);
         return;
     }
+    if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        auto pChangeHint = static_cast<const sw::UpdateAttrHint*>(&rHint);
+        if(!pChangeHint->m_pNew && !pChangeHint->m_pOld)
+            // update to all GetReference fields
+            // hopefully, this codepath is soon dead code, and
+            // UpdateGetReferences gets only called directly
+            UpdateGetReferences();
+        else
+            // forward to text fields, they "expand" the text
+            CallSwClientNotify(rHint);
+        return;
+    }
     if (rHint.GetId() != SfxHintId::SwLegacyModify)
         return;
     auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index e9b50826c585..11f19b03150a 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -223,6 +223,12 @@ void SwUserFieldType::SwClientNotify(const SwModify&, 
const SfxHint& rHint)
         if (!pLegacy->m_pOld && !pLegacy->m_pNew)
             m_bValidValue = false;
     }
+    else if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        auto pUpdateHint = static_cast<const sw::UpdateAttrHint*>(&rHint);
+        if (!pUpdateHint->m_pOld && !pUpdateHint->m_pNew)
+            m_bValidValue = false;
+    }
     else if (rHint.GetId() == SfxHintId::SwAttrSetChange)
     {
         auto pChangeHint = static_cast<const sw::AttrSetChangeHint*>(&rHint);
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 2477913e2872..66c5734a3da7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -252,7 +252,7 @@ bool SwGrfNode::ReRead(
     if( bReadGrf && bNewGrf )
     {
         const SwUpdateAttr aHint(0,0,0);
-        CallSwClientNotify(sw::LegacyModifyHint(&aHint, &aHint));
+        CallSwClientNotify(sw::UpdateAttrHint(&aHint, &aHint));
     }
 
     return bReadGrf;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 3248ac8074c4..788fd13a2419 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2751,7 +2751,8 @@ void SwFrameFormat::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
         SwFormat::SwClientNotify(rMod, rHint);
         return;
     }
-    else if (rHint.GetId() == SfxHintId::SwObjectDying)
+    else if (rHint.GetId() == SfxHintId::SwObjectDying
+            || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwFormat::SwClientNotify(rMod, rHint);
         return;
diff --git a/sw/source/core/layout/flyincnt.cxx 
b/sw/source/core/layout/flyincnt.cxx
index 673522376a3e..dcfe0ae9b8e8 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -139,7 +139,8 @@ void SwFlyInContentFrame::SwClientNotify(const SwModify& 
rMod, const SfxHint& rH
         }
         return;
     }
-    if (rHint.GetId() == SfxHintId::SwObjectDying)
+    if (rHint.GetId() == SfxHintId::SwObjectDying
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwFlyFrame::SwClientNotify(rMod, rHint);
         if(GetAnchorFrame())
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 0dcad35ee79a..fedcef628a2c 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -751,7 +751,8 @@ void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
             SwFlyFrame::SwClientNotify(rMod, rHint);
         return;
     }
-    if (rHint.GetId() == SfxHintId::SwObjectDying)
+    if (rHint.GetId() == SfxHintId::SwObjectDying
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwFlyFrame::SwClientNotify(rMod, rHint);
         return;
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 8b2d48f7305f..f2a803467851 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -295,7 +295,8 @@ void SwPageDesc::SwClientNotify(const SwModify& rModify, 
const SfxHint& rHint)
         CallSwClientNotify(rHint);
         RegisterChange();
     }
-    else if (rHint.GetId() == SfxHintId::SwObjectDying)
+    else if (rHint.GetId() == SfxHintId::SwObjectDying
+            || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         CallSwClientNotify(rHint);
     }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 54db69c2e281..56f381729bb8 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -6273,7 +6273,9 @@ void SwCellFrame::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
         SetDerivedVert(false);
         CheckDirChange();
     }
-    else if (rHint.GetId() == SfxHintId::SwFormatChange || rHint.GetId() == 
SfxHintId::SwObjectDying)
+    else if (rHint.GetId() == SfxHintId::SwFormatChange
+            || rHint.GetId() == SfxHintId::SwObjectDying
+            || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwLayoutFrame::SwClientNotify(rMod, rHint);
     }
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index b5e9218ff842..a7e4359d1a43 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2754,7 +2754,9 @@ SwTableBox* 
SwTableBoxFormat::SwTableBoxFormat::GetTableBox()
 // for detection of modifications (mainly TableBoxAttribute)
 void SwTableBoxFormat::SwClientNotify(const SwModify& rMod, const SfxHint& 
rHint)
 {
-    if(rHint.GetId() == SfxHintId::SwFormatChange || rHint.GetId() == 
SfxHintId::SwObjectDying)
+    if(rHint.GetId() == SfxHintId::SwFormatChange
+        || rHint.GetId() == SfxHintId::SwObjectDying
+        || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         SwFrameFormat::SwClientNotify(rMod, rHint);
         return;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 4a3cfaf5624e..77ab42f41895 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2188,6 +2188,7 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, 
SfxHint const& rHint)
     sw::RedlineUnDelText const* pRedlineUnDelText(nullptr);
     SwFormatChangeHint const * pFormatChangedHint(nullptr);
     sw::AttrSetChangeHint const* pAttrSetChangeHint(nullptr);
+    sw::UpdateAttrHint const* pUpdateAttrHint(nullptr);
 
     sal_uInt16 nWhich = 0;
     if (rHint.GetId() == SfxHintId::SwLegacyModify)
@@ -2197,6 +2198,10 @@ void SwTextFrame::SwClientNotify(SwModify const& 
rModify, SfxHint const& rHint)
         pNew = pHint->m_pNew;
         nWhich = pHint->GetWhich();
     }
+    else if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        pUpdateAttrHint = static_cast<const sw::UpdateAttrHint*>(&rHint);
+    }
     else if (rHint.GetId() == SfxHintId::SwInsertText)
     {
         pInsertText = static_cast<const sw::InsertText*>(&rHint);
@@ -2713,54 +2718,53 @@ void SwTextFrame::SwClientNotify(SwModify const& 
rModify, SfxHint const& rHint)
     }
     else if (rHint.GetId() == SfxHintId::SwObjectDying)
         ; // do nothing
-    else switch (nWhich)
+    else if (pUpdateAttrHint)
     {
-        case RES_LINENUMBER:
-        {
-            assert(false); // should have been forwarded to SwContentFrame
-            InvalidateLineNum();
-        }
-        break;
-        case RES_UPDATE_ATTR:
-        {
-            const SwUpdateAttr* pNewUpdate = static_cast<const 
SwUpdateAttr*>(pNew);
+        const SwUpdateAttr* pNewUpdate = pUpdateAttrHint->m_pNew;
 
-            sal_Int32 const nNPos = pNewUpdate->getStart();
-            sal_Int32 const nNLen = pNewUpdate->getEnd() - nNPos;
-            nPos = MapModelToView(&rNode, nNPos);
-            nLen = MapModelToView(&rNode, nNPos + nNLen) - nPos;
-            if( IsIdxInside( nPos, nLen ) )
-            {
-                // We need to reformat anyways, even if the invalidated
-                // range is empty.
-                // E.g.: empty line, set 14 pt!
+        sal_Int32 const nNPos = pNewUpdate->getStart();
+        sal_Int32 const nNLen = pNewUpdate->getEnd() - nNPos;
+        nPos = MapModelToView(&rNode, nNPos);
+        nLen = MapModelToView(&rNode, nNPos + nNLen) - nPos;
+        if( IsIdxInside( nPos, nLen ) )
+        {
+            // We need to reformat anyways, even if the invalidated
+            // range is empty.
+            // E.g.: empty line, set 14 pt!
 
-                // FootnoteNumbers need to be formatted
-                if( !nLen )
-                    nLen = TextFrameIndex(1);
+            // FootnoteNumbers need to be formatted
+            if( !nLen )
+                nLen = TextFrameIndex(1);
 
-                InvalidateRange_( SwCharRange( nPos, nLen) );
-                const sal_uInt16 nTmp = pNewUpdate->getWhichAttr();
+            InvalidateRange_( SwCharRange( nPos, nLen) );
+            const sal_uInt16 nTmp = pNewUpdate->getWhichAttr();
 
-                if( ! nTmp || RES_TXTATR_CHARFMT == nTmp || RES_TXTATR_INETFMT 
== nTmp || RES_TXTATR_AUTOFMT == nTmp ||
-                    RES_UPDATEATTR_FMT_CHG == nTmp || 
RES_UPDATEATTR_ATTRSET_CHG == nTmp )
-                {
-                    lcl_SetWrong( *this, rNode, nNPos, nNPos + nNLen, false );
-                    lcl_SetScriptInval( *this, nPos );
-                }
+            if( ! nTmp || RES_TXTATR_CHARFMT == nTmp || RES_TXTATR_INETFMT == 
nTmp || RES_TXTATR_AUTOFMT == nTmp ||
+                RES_UPDATEATTR_FMT_CHG == nTmp || RES_UPDATEATTR_ATTRSET_CHG 
== nTmp )
+            {
+                lcl_SetWrong( *this, rNode, nNPos, nNPos + nNLen, false );
+                lcl_SetScriptInval( *this, nPos );
             }
+        }
 
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
-            if( isA11yRelevantAttribute( pNewUpdate->getWhichAttr() ) &&
-                hasA11yRelevantAttribute( pNewUpdate->getFmtAttrs() ) )
+        if( isA11yRelevantAttribute( pNewUpdate->getWhichAttr() ) &&
+            hasA11yRelevantAttribute( pNewUpdate->getFmtAttrs() ) )
+        {
+            SwViewShell* pViewSh = getRootFrame() ? 
getRootFrame()->GetCurrShell() : nullptr;
+            if ( pViewSh  )
             {
-                SwViewShell* pViewSh = getRootFrame() ? 
getRootFrame()->GetCurrShell() : nullptr;
-                if ( pViewSh  )
-                {
-                    pViewSh->InvalidateAccessibleParaAttrs( *this );
-                }
+                pViewSh->InvalidateAccessibleParaAttrs( *this );
             }
+        }
 #endif
+    }
+    else switch (nWhich)
+    {
+        case RES_LINENUMBER:
+        {
+            assert(false); // should have been forwarded to SwContentFrame
+            InvalidateLineNum();
         }
         break;
 
diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index 1d7377343274..679cf6d81085 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -256,7 +256,8 @@ void SwFormatField::SwClientNotify( const SwModify& 
rModify, const SfxHint& rHin
     else if (rHint.GetId() == SfxHintId::SwLegacyModify
             || rHint.GetId() == SfxHintId::SwFormatChange
             || rHint.GetId() == SfxHintId::SwAttrSetChange
-            || rHint.GetId() == SfxHintId::SwObjectDying)
+            || rHint.GetId() == SfxHintId::SwObjectDying
+            || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         if(!mpTextField)
             return;
@@ -469,6 +470,38 @@ void SwFormatField::UpdateTextNode(const SfxHint& rHint)
     {
         assert(false && "do not expect this, might need to restore some code");
     }
+    else if(SfxHintId::SwUpdateAttr == rHint.GetId())
+    {
+        auto pUpdateHint = static_cast<const sw::UpdateAttrHint*>(&rHint);
+        auto pOld = pUpdateHint->m_pOld;
+        auto pNew = pUpdateHint->m_pNew;
+        if (pOld == nullptr && pNew == nullptr)
+        {
+            ForceUpdateTextNode();
+            return;
+        }
+
+        if (!IsFieldInDoc())
+            return;
+
+        SwTextNode* pTextNd = &mpTextField->GetTextNode();
+        OSL_ENSURE(pTextNd, "Where is my Node?");
+
+        bool bTriggerNode = pNew != nullptr;
+        bool bExpand = false;
+        if(pNew)
+        {
+            auto pType = mpField->GetTyp();
+            lcl_EnsureUserFieldValid(*pType);
+            bTriggerNode = lcl_TriggerNode(pType->Which());
+            bExpand = lcl_ExpandField(pType->Which());
+            pOld = nullptr;
+        }
+        if(bTriggerNode)
+            pTextNd->TriggerNodeUpdate(sw::UpdateAttrHint(pOld, pNew));
+        if(bExpand)
+            mpTextField->ExpandTextField(false);
+    }
     else if(SfxHintId::SwLegacyModify == rHint.GetId())
     {
         auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
diff --git a/sw/source/core/txtnode/attrcontentcontrol.cxx 
b/sw/source/core/txtnode/attrcontentcontrol.cxx
index 449124f9dc23..901fa17013a3 100644
--- a/sw/source/core/txtnode/attrcontentcontrol.cxx
+++ b/sw/source/core/txtnode/attrcontentcontrol.cxx
@@ -273,7 +273,8 @@ void SwContentControl::SwClientNotify(const SwModify&, 
const SfxHint& rHint)
     else if (rHint.GetId() == SfxHintId::SwLegacyModify
              || rHint.GetId() == SfxHintId::SwFormatChange
              || rHint.GetId() == SfxHintId::SwAttrSetChange
-             || rHint.GetId() == SfxHintId::SwObjectDying)
+             || rHint.GetId() == SfxHintId::SwObjectDying
+             || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         CallSwClientNotify(rHint);
         GetNotifier().Broadcast(SfxHint(SfxHintId::DataChanged));
diff --git a/sw/source/core/txtnode/fmtatr2.cxx 
b/sw/source/core/txtnode/fmtatr2.cxx
index ee48e1e88ca9..8159e0c5e812 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -747,7 +747,8 @@ void Meta::SwClientNotify(const SwModify&, const SfxHint& 
rHint)
     else if (rHint.GetId() == SfxHintId::SwLegacyModify
             || rHint.GetId() == SfxHintId::SwFormatChange
             || rHint.GetId() == SfxHintId::SwAttrSetChange
-            || rHint.GetId() == SfxHintId::SwObjectDying)
+            || rHint.GetId() == SfxHintId::SwObjectDying
+            || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         CallSwClientNotify(rHint);
         GetNotifier().Broadcast(SfxHint(SfxHintId::DataChanged));
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 9650fb75212f..105357a165dc 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2073,7 +2073,7 @@ void SwTextNode::CopyAttr( SwTextNode *pDest, const 
sal_Int32 nTextStartIdx,
             nOldPos,
             0);
 
-        pDest->TriggerNodeUpdate(sw::LegacyModifyHint(&aHint, &aHint));
+        pDest->TriggerNodeUpdate(sw::UpdateAttrHint(&aHint, &aHint));
     }
 }
 
@@ -2925,7 +2925,7 @@ void SwTextNode::GCAttr()
             nMax,
             0);
 
-        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
+        CallSwClientNotify(sw::UpdateAttrHint(nullptr, &aHint));
         CallSwClientNotify(SwFormatChangeHint(nullptr, GetTextColl()));
     }
 }
@@ -5558,7 +5558,7 @@ void SwTextNode::TriggerNodeUpdate(const 
sw::LegacyModifyHint& rHint)
     }
 }
 
-void SwTextNode::TriggerNodeUpdate(const sw::ObjectDyingHint& rHint)
+void SwTextNode::TriggerNodeUpdate(const SfxHint& rHint)
 {
     sw::TextNodeNotificationSuppressor(*this);
 
@@ -5614,20 +5614,6 @@ void SwTextNode::TriggerNodeUpdate(const 
sw::AttrSetChangeHint& rHint)
     }
 }
 
-void SwTextNode::TriggerNodeUpdate(const sw::RemoveUnoObjectHint& rHint)
-{
-    sw::TextNodeNotificationSuppressor(*this);
-
-    SwContentNode::SwClientNotify(*this, rHint);
-
-    SwDoc& rDoc = GetDoc();
-    // #125329# - assure that text node is in document nodes array
-    if ( !rDoc.IsInDtor() && &rDoc.GetNodes() == &GetNodes() )
-    {
-        rDoc.GetNodes().UpdateOutlineNode(*this);
-    }
-}
-
 void SwTextNode::TriggerNodeUpdate(const SwFormatChangeHint& rHint)
 {
     assert(!rHint.m_pOldFormat || dynamic_cast<const 
SwTextFormatColl*>(rHint.m_pOldFormat));
@@ -5693,6 +5679,11 @@ void SwTextNode::SwClientNotify( const SwModify& 
rModify, const SfxHint& rHint )
         auto pLegacyHint = static_cast<const sw::LegacyModifyHint*>(&rHint);
         TriggerNodeUpdate(*pLegacyHint);
     }
+    else if (rHint.GetId() == SfxHintId::SwUpdateAttr)
+    {
+        auto pUpdateHint = static_cast<const sw::UpdateAttrHint*>(&rHint);
+        TriggerNodeUpdate(*pUpdateHint);
+    }
     else if (rHint.GetId() == SfxHintId::SwAttrSetChange)
     {
         auto pChangeHint = static_cast<const sw::AttrSetChangeHint*>(&rHint);
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 5285fd9e75cb..9330d2e037bd 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1802,7 +1802,7 @@ void SwTextNode::DeleteAttribute( SwTextAttr * const 
pAttr )
 
         m_pSwpHints->Delete( pAttr );
         SwTextAttr::Destroy( pAttr );
-        CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
+        CallSwClientNotify(sw::UpdateAttrHint(nullptr, &aHint));
 
         TryDeleteSwpHints();
     }
@@ -1877,7 +1877,7 @@ void SwTextNode::DeleteAttributes(
 
                 m_pSwpHints->DeleteAtPos( nPos );
                 SwTextAttr::Destroy( pTextHt );
-                CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
+                CallSwClientNotify(sw::UpdateAttrHint(nullptr, &aHint));
             }
         }
     }
@@ -3296,7 +3296,7 @@ bool SwpHints::TryInsertHint(
                 nHtStart,
                 nWhich);
 
-            rNode.TriggerNodeUpdate(sw::LegacyModifyHint(&aHint, &aHint));
+            rNode.TriggerNodeUpdate(sw::UpdateAttrHint(&aHint, &aHint));
         }
 
         return true;
@@ -3373,7 +3373,7 @@ bool SwpHints::TryInsertHint(
     if ( rNode.HasWriterListeners() )
     {
         const SwUpdateAttr aHint(nHtStart, nHintEnd, nWhich, 
std::move(aWhichSublist));
-        rNode.TriggerNodeUpdate(sw::LegacyModifyHint(&aHint, &aHint));
+        rNode.TriggerNodeUpdate(sw::UpdateAttrHint(&aHint, &aHint));
     }
 
 #ifdef DBG_UTIL
diff --git a/sw/source/core/txtnode/txtatr2.cxx 
b/sw/source/core/txtnode/txtatr2.cxx
index cb8c20476acb..219664f76d86 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -83,7 +83,7 @@ void SwTextCharFormat::TriggerNodeUpdate(const 
sw::LegacyModifyHint& rHint)
             GetStart(),
             *GetEnd(),
             nWhich);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
 }
 
@@ -95,7 +95,7 @@ void SwTextCharFormat::TriggerNodeUpdate(const 
sw::ObjectDyingHint& /*rHint*/)
             GetStart(),
             *GetEnd(),
             RES_UPDATEATTR_OBJECTDYING);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
 }
 
@@ -107,7 +107,7 @@ void SwTextCharFormat::TriggerNodeUpdate(const 
sw::AttrSetChangeHint& /*rHint*/)
             GetStart(),
             *GetEnd(),
             RES_UPDATEATTR_ATTRSET_CHG);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
 }
 
@@ -119,7 +119,7 @@ void SwTextCharFormat::TriggerNodeUpdate(const 
SwFormatChangeHint&)
             GetStart(),
             *GetEnd(),
             RES_UPDATEATTR_FMT_CHG);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
 }
 
@@ -218,21 +218,21 @@ void SwTextINetFormat::SwClientNotify(const SwModify&, 
const SfxHint& rHint)
         if(!m_pTextNode)
             return;
         const SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), 
RES_UPDATEATTR_FMT_CHG);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
     else if (rHint.GetId() == SfxHintId::SwAttrSetChange)
     {
         if(!m_pTextNode)
             return;
         const SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), 
RES_UPDATEATTR_ATTRSET_CHG);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
     else if (rHint.GetId() == SfxHintId::SwObjectDying)
     {
         if(!m_pTextNode)
             return;
         const SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), 
RES_UPDATEATTR_OBJECTDYING);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
     else if (rHint.GetId() == SfxHintId::SwLegacyModify)
     {
@@ -242,7 +242,7 @@ void SwTextINetFormat::SwClientNotify(const SwModify&, 
const SfxHint& rHint)
         if(!m_pTextNode)
             return;
         const SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), nWhich);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
 }
 
@@ -277,21 +277,21 @@ void SwTextRuby::SwClientNotify(const SwModify&, const 
SfxHint& rHint)
         if(!m_pTextNode)
             return;
         SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), 
RES_UPDATEATTR_FMT_CHG);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
     else if (rHint.GetId() == SfxHintId::SwAttrSetChange)
     {
         if(!m_pTextNode)
             return;
         SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), 
RES_UPDATEATTR_ATTRSET_CHG);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
     else if (rHint.GetId() == SfxHintId::SwObjectDying)
     {
         if(!m_pTextNode)
             return;
         SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), 
RES_UPDATEATTR_OBJECTDYING);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
     else if (rHint.GetId() == SfxHintId::SwLegacyModify)
     {
@@ -301,7 +301,7 @@ void SwTextRuby::SwClientNotify(const SwModify&, const 
SfxHint& rHint)
         if(!m_pTextNode)
             return;
         SwUpdateAttr aUpdateAttr(GetStart(), *GetEnd(), nWhich);
-        m_pTextNode->TriggerNodeUpdate(sw::LegacyModifyHint(&aUpdateAttr, 
&aUpdateAttr));
+        m_pTextNode->TriggerNodeUpdate(sw::UpdateAttrHint(&aUpdateAttr, 
&aUpdateAttr));
     }
 }
 
diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index df0582e1f058..55837fd52e60 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -668,7 +668,7 @@ void SwTextNode::RstTextAttr(
         nMax,
         0);
 
-    CallSwClientNotify(sw::LegacyModifyHint(nullptr, &aHint));
+    CallSwClientNotify(sw::UpdateAttrHint(nullptr, &aHint));
     CallSwClientNotify(SwFormatChangeHint(nullptr, GetFormatColl()));
 }
 
diff --git a/sw/source/core/unocore/unochart.cxx 
b/sw/source/core/unocore/unochart.cxx
index 7b7a34d2aad2..dbfaa99c9671 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -2153,7 +2153,8 @@ void SwChartDataSequence::Notify( const SfxHint& rHint)
     else if (rHint.GetId() == SfxHintId::SwLegacyModify
             || rHint.GetId() == SfxHintId::SwFormatChange
             || rHint.GetId() == SfxHintId::SwAttrSetChange
-            || rHint.GetId() == SfxHintId::SwObjectDying)
+            || rHint.GetId() == SfxHintId::SwObjectDying
+            || rHint.GetId() == SfxHintId::SwUpdateAttr)
     {
         setModified( true );
     }

Reply via email to