sw/source/filter/ww8/docxattributeoutput.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit a04ed691ea3f4891c98e7dde0344d461cb9def18 Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Mon Oct 24 13:52:27 2022 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Wed Nov 2 03:02:18 2022 +0100 tdf#151384 DOCX export: lost hyperlink format in localized UI Fix losing color and underline of hyperlinks in localized builds, at least with Russian UI. Regression from commit d57b4480903f700ad7c95e885b9dd0ace5883cfc "tdf#127579 DOCX export: fix losing color and underline of ODT hyperlinks". Change-Id: I1eebcf58a7071226e80df3f84ed1264c5a8baf31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141761 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit 2dfd9e3e00f6e57ab1b307cf57c01a0830da4b17) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142134 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8020576cfcab..f62fb4440929 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8527,9 +8527,13 @@ void DocxAttributeOutput::CharHighlight( const SvxBrushItem& rHighlight ) void DocxAttributeOutput::TextINetFormat( const SwFormatINetFormat& rLink ) { - OString aStyleId = MSWordStyles::CreateStyleId(rLink.GetINetFormat()); - if (!aStyleId.isEmpty() && !aStyleId.equalsIgnoreAsciiCase("DefaultStyle")) - m_pSerializer->singleElementNS(XML_w, XML_rStyle, FSNS(XML_w, XML_val), aStyleId); + const SwCharFormat* pFormat = m_rExport.m_rDoc.FindCharFormatByName(rLink.GetINetFormat()); + if (pFormat) + { + OString aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(pFormat))); + if (!aStyleId.equalsIgnoreAsciiCase("DefaultStyle")) + m_pSerializer->singleElementNS(XML_w, XML_rStyle, FSNS(XML_w, XML_val), aStyleId); + } } void DocxAttributeOutput::TextCharFormat( const SwFormatCharFormat& rCharFormat )