sw/source/filter/ww8/docxattributeoutput.cxx | 9 +++++++++ sw/source/filter/ww8/docxattributeoutput.hxx | 1 + 2 files changed, 10 insertions(+)
New commits: commit e3c8805ee47067c89a6430d2e6c9bba2b67e9239 Author: Noel Grandin <[email protected]> AuthorDate: Tue Nov 25 21:12:42 2025 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Wed Nov 26 15:16:17 2025 +0100 officeotron: avoid writing <w:i/> twice Change-Id: I58f9d359aa66155e17686695642317948b839b09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194527 Reviewed-by: Miklos Vajna <[email protected]> Code-Style: Noel Grandin <[email protected]> Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> Tested-by: Noel Grandin <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194640 Code-Style: Miklos Vajna <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a956f1810528..484c803b8669 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3343,6 +3343,7 @@ void DocxAttributeOutput::InitCollectedRunProperties() m_pEastAsianLayoutAttrList = nullptr; m_pCharLangAttrList = nullptr; m_oFontSize.reset(); + m_bCharPostureWritten = false; // Write the elements in the spec order static const sal_Int32 aOrder[] = @@ -8167,6 +8168,10 @@ void DocxAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) void DocxAttributeOutput::CharPosture( const SvxPostureItem& rPosture ) { + if (m_bCharPostureWritten) // avoid writing this twice + return; + m_bCharPostureWritten = true; + if ( rPosture.GetPosture() != ITALIC_NONE ) m_pSerializer->singleElementNS(XML_w, XML_i); else @@ -8288,6 +8293,10 @@ void DocxAttributeOutput::CharFontCJK( const SvxFontItem& rFont ) void DocxAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture ) { + if (m_bCharPostureWritten) // avoid writing this twice + return; + m_bCharPostureWritten = true; + if ( rPosture.GetPosture() != ITALIC_NONE ) m_pSerializer->singleElementNS(XML_w, XML_i); else diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index ca720311b8d6..e0a31497b02c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -836,6 +836,7 @@ private: rtl::Reference<sax_fastparser::FastAttributeList> m_pParagraphSpacingAttrList; rtl::Reference<sax_fastparser::FastAttributeList> m_pHyperlinkAttrList; std::optional<double> m_oFontSize; + bool m_bCharPostureWritten; std::shared_ptr<SwContentControl> m_pContentControl; /// If the current SDT around runs should be ended before the current run. bool m_bEndCharSdt;
