diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-03-09 12:32:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-03-09 14:13:21 +0100 |
commit | 3af025f0fe0daa1de24eb3ac80797cd618d06ec3 (patch) | |
tree | d2c8a1593d55a62eaaaa7dfa04689232272810fc | |
parent | 48bca65f1cf381cba7cb7a4c3916155a1bca0955 (diff) |
sw XHTML export: fix OutHTML_INetFormat()
<a> missed the namespace prefix, </a> did not.
Change-Id: I8f50249170c6323d35bbeb856e10a2c93038cdbf
Reviewed-on: https://gerrit.libreoffice.org/50993
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | sw/qa/extras/htmlexport/data/reqif-p.xhtml | 1 | ||||
-rw-r--r-- | sw/qa/extras/htmlexport/htmlexport.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/htmlexport/data/reqif-p.xhtml b/sw/qa/extras/htmlexport/data/reqif-p.xhtml index 2f069d78e0eb..3db2325467a2 100644 --- a/sw/qa/extras/htmlexport/data/reqif-p.xhtml +++ b/sw/qa/extras/htmlexport/data/reqif-p.xhtml @@ -1,2 +1,3 @@ <reqif-xhtml:p>aaa<reqif-xhtml:br/>bbb</reqif-xhtml:p> <reqif-xhtml:table><reqif-xhtml:tr><reqif-xhtml:td>in table</reqif-xhtml:tr></reqif-xhtml:tr></reqif-xhtml:table> +<reqif-xhtml:a href="http://libreoffice.org/">http://libreoffice.org</reqif-xhtml:a> diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index c30def092451..f65b0014e799 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -337,15 +337,23 @@ DECLARE_HTMLEXPORT_TEST(testReqIfParagraph, "reqif-p.xhtml") { SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); + pStream->Seek(STREAM_SEEK_TO_END); + sal_uInt64 nLength = pStream->Tell(); + pStream->Seek(0); OString aExpected("<reqif-xhtml:p>aaa<reqif-xhtml:br/>\nbbb</reqif-xhtml:p>" SAL_NEWLINE_STRING); // This was '<table' instead. aExpected += "<reqif-xhtml:table"; + OString aStream(read_uInt8s_ToOString(*pStream, nLength)); + pStream->Seek(0); OString aActual(read_uInt8s_ToOString(*pStream, aExpected.getLength())); // This was a HTML header, like '<!DOCTYPE html ...'. CPPUNIT_ASSERT_EQUAL(aExpected, aActual); + + // This was "<a", was not found. + CPPUNIT_ASSERT(aStream.indexOf("<reqif-xhtml:a") != -1); } DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleData, "reqif-ole-data.xhtml") diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 96b624a541f8..ac323a5ebc75 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2876,7 +2876,7 @@ Writer& OutHTML_INetFormat( Writer& rWrt, const SwFormatINetFormat& rINetFormat, return rWrt; } - OString sOut = "<" OOO_STRING_SVTOOLS_HTML_anchor; + OString sOut("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor); bool bScriptDependent = false; { |