diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-17 15:34:14 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-17 16:39:32 +0100 |
commit | 0ba6360363fb73b5b200bbc486ed8eeac5f3d337 (patch) | |
tree | 18146e0c4495301affa72baaae66ed2913484967 /sw | |
parent | 7d70efaac360dbbd9bea2d51b1ae53b577fc6559 (diff) |
Garbage in, garbage out?
Non-ASCII characters (like Unicode "é", represented as two bytes \xC3 \xA9 in
the UTF-8--encoded source file, and presumably passed trhough unchanged by
compilers into the resulting string literal object) in the OUString "literal"
ctor trigger a SAL_WARN_IF in rtl_uString_newFromLiteral, but are copied
"verbatim" into the resulting OUString, which will thus contain UTF-16 code
units \x00C3 \x00A9 (if char is unsigned) resp. \xFFC3 \xFFA9 (if char is
signed).
That assertXPathContent shall indeed match such an odd OUString value looks
suspiciously like a bug elsewhere, papered over by a broken test. To be
investigated.
Change-Id: I07c995ad0e17235c214d7630fb34e8ef35d5ad30
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index e187959c3013..c953ad1200a8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -589,7 +589,12 @@ DECLARE_OOXMLEXPORT_TEST(testDateControl, "date-control.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", "2014-03-05T00:00:00Z"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "dddd, dd' de 'MMMM' de 'yyyy"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid", "val", "es-ES"); - assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "miércoles, 05 de marzo de 2014"); + static sal_Unicode const Broken[] = { + 'm', 'i', static_cast<sal_Unicode>('\xC3'), + static_cast<sal_Unicode>('\xA9'), 'r', 'c', 'o', 'l', 'e', 's', ',', + ' ', '0', '5', ' ', 'd', 'e', ' ', 'm', 'a', 'r', 'z', 'o', ' ', 'd', + 'e', ' ', '2', '0', '1', '4' }; + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", OUString(Broken, SAL_N_ELEMENTS(Broken))); // check imported control uno::Reference<drawing::XControlShape> xControl(getShape(1), uno::UNO_QUERY); |