summaryrefslogtreecommitdiff
path: root/xmlreader
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 /xmlreader
parenta0acad42105bc3f0304121a86f755958e38aeaac (diff)
Rename rtl::isValidCodePoint -> rtl::isUnicodeCodePoint
...and fix its documentation, and use it throughout the code base. Change-Id: I349bc2009b1b0aa7115ea90bc6ecd0a812f63698
Diffstat (limited to 'xmlreader')
-rw-r--r--xmlreader/source/xmlreader.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx
index 011a09485d2c..25b56847f692 100644
--- a/xmlreader/source/xmlreader.cxx
+++ b/xmlreader/source/xmlreader.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <osl/file.h>
+#include <rtl/character.hxx>
#include <rtl/string.h>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
@@ -399,7 +400,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
++position;
if (*position == '#') {
++position;
- sal_Int32 val = 0;
+ sal_uInt32 val = 0;
char const * p;
if (*position == 'x') {
++position;
@@ -415,7 +416,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
} else {
break;
}
- if (val > 0x10FFFF) { // avoid overflow
+ if (!rtl::isUnicodeCodePoint(val)) { // avoid overflow
throw css::uno::RuntimeException(
"'&#x...' too large in " + fileUrl_ );
}
@@ -429,7 +430,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
} else {
break;
}
- if (val > 0x10FFFF) { // avoid overflow
+ if (!rtl::isUnicodeCodePoint(val)) { // avoid overflow
throw css::uno::RuntimeException(
"'&#...' too large in " + fileUrl_ );
}
@@ -439,7 +440,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
throw css::uno::RuntimeException(
"'&#...' missing ';' in " + fileUrl_ );
}
- assert(val >= 0 && val <= 0x10FFFF);
+ assert(rtl::isUnicodeCodePoint(val));
if ((val < 0x20 && val != 0x9 && val != 0xA && val != 0xD) ||
(val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF)
{