From 3210bc85ae1276350f18f4795efefe491c2206c2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 15 Feb 2016 12:36:11 +0100 Subject: Rename rtl::isValidCodePoint -> rtl::isUnicodeCodePoint ...and fix its documentation, and use it throughout the code base. Change-Id: I349bc2009b1b0aa7115ea90bc6ecd0a812f63698 --- sax/source/expatwrap/saxwriter.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sax') diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 09a78557c8cb..db75efe44d33 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -388,7 +389,7 @@ inline bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr, OSL_ENSURE( nSurrogate != 0, "lone 2nd Unicode surrogate" ); nSurrogate = ( nSurrogate << 10 ) | ( c & 0x03ff ); - if( nSurrogate >= 0x00010000 && nSurrogate <= 0x0010FFFF ) + if( rtl::isUnicodeCodePoint(nSurrogate) && nSurrogate >= 0x00010000 ) { sal_Int8 aBytes[] = { sal_Int8(0xF0 | ((nSurrogate >> 18) & 0x0F)), sal_Int8(0x80 | ((nSurrogate >> 12) & 0x3F)), @@ -831,7 +832,7 @@ inline sal_Int32 calcXMLByteLength( const sal_Unicode *pStr, sal_Int32 nStrLen, { // 2. surrogate: write as UTF-8 (if range is OK nSurrogate = ( nSurrogate << 10 ) | ( c & 0x03ff ); - if( nSurrogate >= 0x00010000 && nSurrogate <= 0x0010FFFF ) + if( rtl::isUnicodeCodePoint(nSurrogate) && nSurrogate >= 0x00010000 ) nOutputLength += 4; nSurrogate = 0; } -- cgit