sw/source/filter/ww8/wrtw8nds.cxx |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit d280912840d8a459e96c5fc0fbd9fc97cff28432
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Jan 27 11:14:46 2025 +0000
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jan 29 09:02:41 2025 +0100

    We don't need to broadcast these GrabBag changes
    
    no need to redo any layout, etc due to these
    
    Change-Id: Id0d849221527db26b196f07865722d450093f13c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180778
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit eb568de67b0671ac93d84ee8fbb659408b7e6d4a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180823
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 28dc8ade91b0..db93f406c356 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3428,6 +3428,17 @@ void MSWordExportBase::OutputSectionNode( const 
SwSectionNode& rSectionNode )
     }
 }
 
+// don't need to broadcast modification
+static void SetAttrNoBroadcast(SwContentNode& rNode, const SfxPoolItem& rItem)
+{
+    const bool bModifyNotifyDisabled = rNode.IsModifyLocked();
+    if (!bModifyNotifyDisabled)
+        rNode.LockModify();
+    rNode.SetAttr(rItem);
+    if (!bModifyNotifyDisabled)
+        rNode.UnlockModify();
+}
+
 // tdf#121561: During export of the ODT file with TOC inside into DOCX format,
 // the TOC title is being exported as regular paragraph. We should surround it
 // with <w:sdt><w:sdtPr><w:sdtContent> to make it (TOC title) recognizable
@@ -3490,7 +3501,7 @@ void 
MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect
         aGrabBag.GetGrabBag()["SdtPr"] <<= aSdtPrPropertyValues;
 
         // set new attr to node
-        const_cast<SwContentNode*>(pNode)->SetAttr(aGrabBag);
+        SetAttrNoBroadcast(*const_cast<SwContentNode*>(pNode), aGrabBag);
     }
 
     // set flag for the next node after TOC
@@ -3506,7 +3517,7 @@ void 
MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect
             aGrabBag.GetGrabBag()["ParaSdtEndBefore"] <<= true;
 
             // set new attr to node
-            const_cast<SwContentNode*>(pNodeAfterToc)->SetAttr(aGrabBag);
+            SetAttrNoBroadcast(*const_cast<SwContentNode*>(pNodeAfterToc), 
aGrabBag);
         }
     }
 }

Reply via email to