sw/source/filter/ww8/docxattributeoutput.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit f0c01947a56ea48c0b48164f5629caf9bf9bd99e Author: Jaume Pujantell <[email protected]> AuthorDate: Thu Jan 15 19:13:44 2026 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Jan 23 16:48:39 2026 +0100 cool#12055 docx: roundtrip hyperlink style Given a .docx document created in MSWord that contains a link with the default Hyperlink style. If this document is opened and saved in online with a non-English locale, the Hyperlink style is lost. This change adds a fail-save where, on save, the style is searched by id if not found by name, in case name differs due to some language mismatch. Note that it can't be search only by id because it may be a new user defined style. I tried to create a test but couldn't reproduce the issue in the test. Change-Id: I8fc0f6f320b5f5acd6ccb2e564aa3506373520b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197393 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit acf476953a313a3ba358959d23c4a27a534b71e0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197928 Tested-by: Miklos Vajna <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index fa35d20ce189..e1007c9eefb0 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -36,6 +36,7 @@ #include <redline.hxx> #include <unoframe.hxx> #include <textboxhelper.hxx> +#include <SwStyleNameMapper.hxx> #include <rdfhelper.hxx> #include "wrtww8.hxx" @@ -8516,6 +8517,11 @@ void DocxAttributeOutput::CharHighlight( const SvxBrushItem& rHighlight ) void DocxAttributeOutput::TextINetFormat( const SwFormatINetFormat& rLink ) { const SwCharFormat* pFormat = m_rExport.m_rDoc.FindCharFormatByName(rLink.GetINetFormat()); + if (!pFormat) + { + pFormat = m_rExport.m_rDoc.FindCharFormatByName( + SwStyleNameMapper::GetUIName(rLink.GetINetFormatId(), "")); + } if (pFormat) { OString aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(pFormat)));
