diff options
author | Karl Hong <khong@openoffice.org> | 2002-11-05 22:31:53 +0000 |
---|---|---|
committer | Karl Hong <khong@openoffice.org> | 2002-11-05 22:31:53 +0000 |
commit | 87f8f9d0d48ee6f9519f76882f7a8e4ed1b98af5 (patch) | |
tree | 7295846bda243d1e0266ac2cea774da36f6de2c7 /i18npool/source/nativenumber | |
parent | d0f5e938f23874ced006bba50ab2e82001f43b94 (diff) |
#104749#add CJK double byte thousand delimiter
Diffstat (limited to 'i18npool/source/nativenumber')
-rw-r--r-- | i18npool/source/nativenumber/data/numberchar.h | 35 | ||||
-rw-r--r-- | i18npool/source/nativenumber/nativenumbersupplier.cxx | 8 |
2 files changed, 37 insertions, 6 deletions
diff --git a/i18npool/source/nativenumber/data/numberchar.h b/i18npool/source/nativenumber/data/numberchar.h index aa9625a4883e..7e0b42bd2534 100644 --- a/i18npool/source/nativenumber/data/numberchar.h +++ b/i18npool/source/nativenumber/data/numberchar.h @@ -2,9 +2,9 @@ * * $RCSfile: numberchar.h,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: khong $ $Date: 2002-09-15 22:28:56 $ + * last change: $Author: khong $ $Date: 2002-11-05 23:31:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -166,6 +166,37 @@ static sal_Unicode MinusChar[] = { 0x002D, // Mongolian }; +static sal_uInt16 SeparatorChar[] = { + 0x002C, // Half Width (Ascii) + 0x3001, // Full Width + 0x3001, // Chinese Lower + 0x3001, // S. Chinese Upper + 0x3001, // T. Chinese Upper + 0x3001, // Japanese Modern + 0x3001, // Japanese Trad. + 0x3001, // Korean Lower + 0x3001, // Korean Upper + 0x3001, // Korean Hangul + 0x002C, // Arabic Indic + 0x002C, // Est. Arabic Indic + 0x002C, // Indic + 0x002C, // Thai + 0x002C, // Oriya + 0x002C, // Marathi + 0x002C, // Bengali + 0x002C, // Punjabi + 0x002C, // Gujarali + 0x002C, // Tamil + 0x002C, // Telugu + 0x002C, // Kannada + 0x002C, // Malayalam + 0x002C, // Lao + 0x002C, // Tibetan + 0x002C, // Myammar + 0x002C, // Cambodian (Khmer) + 0x002C, // Mongolian +}; + #define NUMBER_ZERO NumberChar[NumberChar_HalfWidth][0] // 0x0030 #define NUMBER_ONE NumberChar[NumberChar_HalfWidth][1] // 0x0031 #define NUMBER_NINE NumberChar[NumberChar_HalfWidth][9] // 0x0039 diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index 2ca9203db269..04c496a1a6ad 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -2,9 +2,9 @@ * * $RCSfile: nativenumbersupplier.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: khong $ $Date: 2002-10-19 00:22:50 $ + * last change: $Author: khong $ $Date: 2002-11-05 23:31:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -119,7 +119,7 @@ OUString SAL_CALL AsciiToNativeChar( const OUString& inStr, sal_Int32 startPos, sal_Unicode ch = src[i]; newStr->buffer[i] = (isNumber(ch) ? NumberChar[number][ ch - NUMBER_ZERO ] : isDecimal(ch) ? DecimalChar[number] : isMinus(ch) ? MinusChar[number] : - (isSeparator(ch) && number == NumberChar_FullWidth) ? thousandSeparator + 0xFEE0 : ch); + ! isSeparator(ch) ? ch : number == NumberChar_FullWidth ? thousandSeparator + 0xFEE0 : SeparatorChar[number]); offset[i] = startPos + i; } return OUString(newStr->buffer, nCount); @@ -331,7 +331,7 @@ static OUString SAL_CALL NativeToAscii(const OUString& inStr, } else { if ((index = numberChar.indexOf(str[i])) >= 0) newStr->buffer[count] = (index % 10) + NUMBER_ZERO; - else if (isSeparator(str[i]) && + else if ((isSeparator(str[i]) || str[i] == 0x3001) && (i < nCount-1 && (numberChar.indexOf(str[i+1]) >= 0 || multiplierChar.indexOf(str[i+1]) >= 0))) newStr->buffer[count] = thousandSeparator; |