From 3f0fba004badec01e536ca0fe2889e7e0bb93d7a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 13 Sep 2017 13:35:49 +0200 Subject: New rtl::isUnicodeScalarValue, rtl::isSurrogate There are apparently various places that want to check for a Unicode scalar value rather than for a Unicode code point. Changed those uses of rtl::isUnicodeCodePoint where that was obvious. (For changing svtools/source/svrtf/svparser.cxx see 8e0fb74dc01927b60d8b868548ef8fe1d7a80ce3 "Revert 'svtools: HTML import: don't put lone surrogates in OUString'".) Other uses of rtl::isUnicodeCodePoint might also want to use rtl::isUnicodeScalarValue instead. As a side effect, this change also introduces rtl::isSurrogate, which is useful in a few places as well. Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535 --- tools/source/fsys/urlobj.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index eeadb7df38d2..ccebbd3f4e2a 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4745,10 +4745,8 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin, break; nShift -= 6; } - if (bUTF8 && rtl::isUnicodeCodePoint(nEncoded) - && nEncoded >= nMin - && !rtl::isHighSurrogate(nEncoded) - && !rtl::isLowSurrogate(nEncoded)) + if (bUTF8 && rtl::isUnicodeScalarValue(nEncoded) + && nEncoded >= nMin) { rBegin = p; nUTF32 = nEncoded; -- cgit