summaryrefslogtreecommitdiff
path: root/svtools/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-02-27 13:51:13 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-02-28 11:41:50 +0100
commit9df0ce081eac287154ea496e9eb299b4bc4fa776 (patch)
tree662ab6bae70678e9a5d9a760e37b6c0bf21966a5 /svtools/qa
parent81260c448911069ce8cb051d3a973ec52b9b43a3 (diff)
sw HTML export: allow custom XHTML namespace alias
This helps in case the HTML filter expected to produce an XHTML fragment that has an explicit namespace alias for <http://www.w3.org/1999/xhtml>. This only has an effect when HtmlWriter is used to write elements, though. Change-Id: I161caf4bb6bc6d0c21a7a67433b08bb060b447f1 Reviewed-on: https://gerrit.libreoffice.org/50448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svtools/qa')
-rw-r--r--svtools/qa/unit/testHtmlWriter.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/svtools/qa/unit/testHtmlWriter.cxx b/svtools/qa/unit/testHtmlWriter.cxx
index dc0816b7875d..bdb5c5814fd7 100644
--- a/svtools/qa/unit/testHtmlWriter.cxx
+++ b/svtools/qa/unit/testHtmlWriter.cxx
@@ -39,6 +39,7 @@ public:
void testSingleElementWithContent();
void testSingleElementWithContentAndAttributes();
void testNested();
+ void testNamespace();
void testAttributeValues();
CPPUNIT_TEST_SUITE(Test);
@@ -47,6 +48,7 @@ public:
CPPUNIT_TEST(testSingleElementWithContent);
CPPUNIT_TEST(testSingleElementWithContentAndAttributes);
CPPUNIT_TEST(testNested);
+ CPPUNIT_TEST(testNamespace);
CPPUNIT_TEST(testAttributeValues);
CPPUNIT_TEST_SUITE_END();
@@ -157,6 +159,20 @@ void Test::testNested()
CPPUNIT_ASSERT_EQUAL(OString("<abc><xyz/></abc>"), aString);
}
+void Test::testNamespace()
+{
+ SvMemoryStream aStream;
+
+ HtmlWriter aHtml(aStream, "reqif-xhtml");
+ aHtml.prettyPrint(false);
+ aHtml.single("br");
+
+ OString aString = extractFromStream(aStream);
+
+ // This was <br/>, namespace request was ignored.
+ CPPUNIT_ASSERT_EQUAL(OString("<reqif-xhtml:br/>"), aString);
+}
+
void Test::testAttributeValues()
{
SvMemoryStream aStream;