summaryrefslogtreecommitdiff
path: root/include/rtl/ustring.h
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-09-04 20:26:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-09-05 12:29:10 +0200
commit9abaa6492899b3a8e467b08ec8a084ed3db7f518 (patch)
treecf223bf313df7f1eb3f55f17b24542df0b526482 /include/rtl/ustring.h
parent7003fe557bd2223e9af1ed0eb6c97b209686a8ab (diff)
Make OUString(char16_t const[N]) ctor check for embedded NULs
...and fix the detected fallout. That ctor only started to get used recently with a1570b6052ae9c9349282027c9007b071589bce6 "Make the OUString ConstCharArrayDetector::TypeUtf16 overloads are actually used", but it turns out that that also gave rise to that ctor being picked in error. To better guard against such erroneous uses, make that ctor assert that the given array does not contain embedded NUL characters, see the new sal/qa/rtl/strings/nonconstarray.cxx tests. The one place where that assert would fire during `make check` is fixed now in SwWW8ImplReader::ImportDopTypography. That assert would also fire for tow OUStringLiteral-related tests in the recently added test::oustring::StringLiterals::checkEmbeddedNul, so drop those for how. They cna presumably be added back (with reversed logic values) when OUStringLiteral is changed similarly to how OStringLiteral was changed in 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String". Change-Id: I6056244003a20f77ba0d953538d25edcbd562211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102063 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl/ustring.h')
0 files changed, 0 insertions, 0 deletions