summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-02-15 12:36:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-02-15 12:36:11 +0100
commit3210bc85ae1276350f18f4795efefe491c2206c2 (patch)
tree75c8d5831620cdc1d0c9145ca4579197e5cf0d94 /sax
parenta0acad42105bc3f0304121a86f755958e38aeaac (diff)
Rename rtl::isValidCodePoint -> rtl::isUnicodeCodePoint
...and fix its documentation, and use it throughout the code base. Change-Id: I349bc2009b1b0aa7115ea90bc6ecd0a812f63698
Diffstat (limited to 'sax')
-rw-r--r--sax/source/expatwrap/saxwriter.cxx5
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;
}