sw/source/filter/ww8/docxattributeoutput.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 3bf0e056f17eadbff8ac40bdcdfc53c5836e1c76
Author:     Jaume Pujantell <[email protected]>
AuthorDate: Thu Jan 15 19:13:44 2026 +0100
Commit:     Jaume Pujantell <[email protected]>
CommitDate: Wed Feb 25 19:37:07 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/+/200222
    Reviewed-by: Jaume Pujantell <[email protected]>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index c51b18ecf662..9cade593cded 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"
 
@@ -8646,6 +8647,11 @@ void DocxAttributeOutput::CharScriptHint(const 
SvxScriptHintItem& rHint)
 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(), ProgName()));
+    }
     if (pFormat)
     {
         OString 
aStyleId(m_rExport.m_pStyles->GetStyleId(m_rExport.GetId(pFormat)));

Reply via email to