sw/source/filter/ww8/wrtw8nds.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
New commits: commit eb568de67b0671ac93d84ee8fbb659408b7e6d4a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Jan 27 11:14:46 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Jan 27 14:00:32 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> diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 8227d3577f27..a2b5897ff195 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -3463,6 +3463,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 @@ -3525,7 +3536,7 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect std::map<OUString, css::uno::Any>{{ u"SdtPr"_ustr, uno::Any(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 @@ -3541,7 +3552,7 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect std::map<OUString, css::uno::Any>{{u"ParaSdtEndBefore"_ustr, uno::Any(true)}}); // set new attr to node - const_cast<SwContentNode*>(pNodeAfterToc)->SetAttr(aGrabBag); + SetAttrNoBroadcast(*const_cast<SwContentNode*>(pNodeAfterToc), aGrabBag); } } }