diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2008-06-30 20:04:11 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2008-06-30 20:04:11 +0000 |
| commit | 7962c458e23adba82b0184bf306bffae31955ae4 (patch) | |
| tree | 7a3aec8a6c56ee0e4e94191645319d642882392f /src/dom/ucd.cpp | |
| parent | simplify SPCurve::penultimate_point and return 2geom type (diff) | |
| download | inkscape-7962c458e23adba82b0184bf306bffae31955ae4.tar.gz inkscape-7962c458e23adba82b0184bf306bffae31955ae4.zip | |
fix range problem
(bzr r6103)
Diffstat (limited to 'src/dom/ucd.cpp')
| -rw-r--r-- | src/dom/ucd.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/dom/ucd.cpp b/src/dom/ucd.cpp index 602c71630..3747334d2 100644 --- a/src/dom/ucd.cpp +++ b/src/dom/ucd.cpp @@ -1,5 +1,5 @@ /* - * Generated by UcdReader at:Tue Jun 24 11:58:24 GMT-06:00 2008 + * Generated by UcdReader at:Mon Jun 30 13:52:41 GMT-06:00 2008 * block table size:2 (4 bytes) * plane table size:6 (64 bytes) * @@ -2266,10 +2266,16 @@ static unsigned int prop[] = #define UNI_CODE(ch) (prop[block[plane[(ch>>8)&8191]+((ch>>2)&63)]+(ch&3)]) /** + * Get type part of code + + */ +#define UNI_CODE_TO_TYPE(ch) (ch & 0x1f) + +/** * Fetch the category type */ -#define UNI_TYPE(ch) (UNI_CODE(ch) & 0x1f) +#define UNI_TYPE(ch) (UNI_CODE_TO_TYPE(UNI_CODE(ch))) /** * Fetch the digit offset @@ -2461,28 +2467,28 @@ int uni_is_defined(int ch) int uni_is_letter(int ch) { - int c = UNI_CODE(ch); + int c = UNI_TYPE(ch); return (c>=UNI_UPPERCASE_LETTER && c<=UNI_OTHER_LETTER); } int uni_is_letter_or_digit(int ch) { - int c = UNI_CODE(ch); + int c = UNI_TYPE(ch); return ((c>=UNI_UPPERCASE_LETTER && c<=UNI_OTHER_LETTER) || c==UNI_DECIMAL_DIGIT_NUMBER); } int uni_is_space(int ch) { - int c = UNI_CODE(ch); + int c = UNI_TYPE(ch); return (c==UNI_SPACE_SEPARATOR || c==UNI_LINE_SEPARATOR - || c==UNI_PARAGRAPH_SEPARATOR); + || c==UNI_PARAGRAPH_SEPARATOR || (ch>= 0x09 && ch <= 0x0d)); } int uni_to_lower(int ch) { int c = UNI_CODE(ch); - if (c == UNI_LOWERCASE_LETTER) + if (UNI_CODE_TO_TYPE(c) == UNI_LOWERCASE_LETTER) return ch; ch -= (c>>18) & 0x1ff; return ch; @@ -2491,7 +2497,7 @@ int uni_to_lower(int ch) int uni_to_upper(int ch) { int c = UNI_CODE(ch); - if (c == UNI_UPPERCASE_LETTER) + if (UNI_CODE_TO_TYPE(c) == UNI_UPPERCASE_LETTER) return ch; ch += (c>>18) & 0x1ff; return ch; @@ -2500,7 +2506,7 @@ int uni_to_upper(int ch) int uni_to_title(int ch) { int c = UNI_CODE(ch); - if (c == UNI_TITLECASE_LETTER) + if (UNI_CODE_TO_TYPE(c) == UNI_TITLECASE_LETTER) return ch; ch += (c>>18) & 0x1ff; return ch; |
