summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-01-10 00:28:14 +0800
committerMichael Stahl <mstahl@redhat.com>2016-01-14 14:57:07 +0100
commite99f22bbc499ab0566621ee0bb01e4a7747efe76 (patch)
treea2eaa8ae508ddc7e13d1e4f39a360a62e92a98b3 /sw
parent5290bb4d221051b05f6146ddc4bf2a47ba662655 (diff)
Fix FastSaxSerializer::write() for non-BMP unicode characters.
Reviewed-on: https://gerrit.libreoffice.org/21293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 7ec5ba47783ac8b2d0141109d0efe6b20b363ced) Signed-off-by: Michael Stahl <mstahl@redhat.com> Change-Id: I6ee9d028813c970b9ac5b9f0574af932e73111bd
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/nonbmpchar.docxbin0 -> 4194 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/nonbmpchar.docx b/sw/qa/extras/ooxmlexport/data/nonbmpchar.docx
new file mode 100644
index 000000000000..a6b5d416c15e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/nonbmpchar.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 3626d570cc2c..f66aeca71ddc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -970,6 +970,15 @@ DECLARE_OOXMLEXPORT_TEST(testOO106020, "ooo106020-1.odt")
assertXPath(pXmlDoc, "//w:tbl", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx")
+{
+ sal_uInt32 nCh = 0x24b62;
+ OUString aExpected( &nCh, 1);
+ // Assert that UTF8 encoded non-BMP Unicode character is correct
+ uno::Reference<text::XTextRange> xTextRange1 = getRun(getParagraph(1), 1);
+ CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange1->getString());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */