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

New commits:
commit 87aa35ce8c5df017e6bd05e7a87cd8e1d1c6f616
Author:     Jaume Pujantell <[email protected]>
AuthorDate: Thu Jan 15 19:13:44 2026 +0100
Commit:     Jaume Pujantell <[email protected]>
CommitDate: Fri Jan 23 16:35:18 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/+/197678
    Tested-by: Jenkins
    Reviewed-by: Jaume Pujantell <[email protected]>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 493ee69c5a5e..ddcc2c629a2b 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"
 
@@ -8523,6 +8524,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