[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source

Tünde Tóth (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 13 09:33:14 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf127925.odt     |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx      |    8 ++++++++
 sw/source/filter/ww8/wrtw8sty.cxx               |    4 ++++
 writerfilter/source/dmapper/StyleSheetTable.cxx |    2 +-
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 8bd15459527b527454900dd781f1226dade5b118
Author:     Tünde Tóth <tundeth at gmail.com>
AuthorDate: Wed Oct 2 15:25:23 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed Nov 13 10:32:28 2019 +0100

    tdf#127925 DOCX export: fix visited hyperlink style
    
    Custom visited hyperlink style reset to default in Word.
    
    Change-Id: I6a36c900788bb17d4f31c60048cf65960490a46b
    Reviewed-on: https://gerrit.libreoffice.org/80043
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    Tested-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf127925.odt b/sw/qa/extras/ooxmlexport/data/tdf127925.odt
new file mode 100644
index 000000000000..b91e48f055de
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf127925.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index d9ee746f74b6..0d9cd773ef9a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -881,6 +881,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127579, "tdf127579.odt")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt")
+{
+    xmlDocPtr pXmlStyles = parseExport("word/styles.xml");
+    if (!pXmlStyles)
+        return;
+
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='VisitedInternetLink']/w:name", "val", "FollowedHyperlink");
+}
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index ca492efdd6b5..3c6813406420 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -633,6 +633,10 @@ void MSWordStyles::OutputStyle( SwFormat* pFormat, sal_uInt16 nPos )
         {
             aName = "Hyperlink";
         }
+        else if (aName.equalsIgnoreAsciiCase("Visited Internet Link"))
+        {
+            aName = "FollowedHyperlink";
+        }
 
         m_rExport.AttrOutput().StartStyle( aName, (bFormatColl ? STYLE_TYPE_PARA : STYLE_TYPE_CHAR),
                 nBase, nWwNext, GetWWId( *pFormat ), nPos,
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index aec6817c8fd3..08881a93a9fe 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1408,7 +1408,7 @@ OUString StyleSheetTable::ConvertStyleName( const OUString& rWWName, bool bExten
 //        { "Body Text Indent 3", "" },
 //        { "Block Text", "" },
         { "Hyperlink", "Internet link" },
-        { "Followed Hyperlink", "Visited Internet Link" },
+        { "FollowedHyperlink", "Visited Internet Link" },
         { "Emphasis", "Emphasis" },
 //        { "Document Map", "" },
 //        { "Plain Text", "" },


More information about the Libreoffice-commits mailing list