sw/source/filter/ww8/docxattributeoutput.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit acf476953a313a3ba358959d23c4a27a534b71e0 Author: Jaume Pujantell <[email protected]> AuthorDate: Thu Jan 15 19:13:44 2026 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Mon Jan 19 09:56:05 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]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ca9f3abbc95e..801f5a7de791 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" @@ -8522,6 +8523,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)));
