summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2019-10-15 16:32:43 +0200
committerLászló Németh <nemeth@numbertext.org>2019-11-11 11:06:08 +0100
commit1d81d52b5da45f26e9d3adeb3b279eb9a488b94f (patch)
tree87d0f92eed9c77e68d0d6a7515add62e8ed70f2e
parent4ae5fe896e96d082e21788ae6d42a67133567ba7 (diff)
tdf#127579 DOCX export: fix losing color and underline of ODT hyperlinks
using "InternetLink" in hyperlink/r/rPr/rStyle instead of the actual character style, and keep actual character formatting in hyperlink/r/rPr/rFonts, like MSO does. Change-Id: I13a5e1758ec5b96e647ca77736396ee2f8b22814 Reviewed-on: https://gerrit.libreoffice.org/80868 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf127579.odtbin0 -> 8655 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx10
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
3 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf127579.odt b/sw/qa/extras/ooxmlexport/data/tdf127579.odt
new file mode 100644
index 000000000000..d9277b0732d0
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf127579.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 49184bd1ade4..d9ee746f74b6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -872,6 +872,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx")
CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf127579, "tdf127579.odt")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink");
+}
+
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 17780b0e0efb..b72a0246bf21 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -221,8 +221,12 @@ void MSWordExportBase::ExportPoolItemsToCHP( ww8::PoolItems &rItems, sal_uInt16
//properties that it rises to the top and is exported first."
//In bug 119649, it is in such situation, so we need to ignore the link style when doing ms word filter exports and
//add the second judgement for #i24291# definition.
- if ( nWhich == RES_TXTATR_INETFMT && ( rItems.begin()->second->Which() == RES_TXTATR_CHARFMT ) )
+ if (nWhich == RES_TXTATR_CHARFMT && SearchPoolItems(rItems, RES_TXTATR_INETFMT))
+ {
+ const SwCharFormat* pFormat = static_cast<const SwFormatCharFormat&>(*pItem).GetCharFormat();
+ OutputFormat(*pFormat, false, true);
continue;
+ }
// tdf#38778 Fix output of the font in DOC run for fields
if (pFont &&