diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-02-15 12:36:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-15 12:36:11 +0100 |
commit | 3210bc85ae1276350f18f4795efefe491c2206c2 (patch) | |
tree | 75c8d5831620cdc1d0c9145ca4579197e5cf0d94 /sax/source | |
parent | a0acad42105bc3f0304121a86f755958e38aeaac (diff) |
Rename rtl::isValidCodePoint -> rtl::isUnicodeCodePoint
...and fix its documentation, and use it throughout the code base.
Change-Id: I349bc2009b1b0aa7115ea90bc6ecd0a812f63698
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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 <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> +#include <rtl/character.hxx> #include <rtl/ref.hxx> #include <rtl/ustrbuf.hxx> @@ -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; } |