diff options
author | Eike Rathke <erack@redhat.com> | 2015-10-16 18:11:17 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-10-16 18:15:31 +0200 |
commit | 9f5ab26bdada54898cac79e3c524664926de66b5 (patch) | |
tree | f35909befac3d14fae4299dca4aaecb790811706 | |
parent | 71ec25ea725ee887a789fdb9dc2b221b8525bc61 (diff) |
use rtl::toAsciiUpperCase() instead of home baked lcl_toupper()
Change-Id: I73dcf0d9f7741409c4dbf1c75f2d7f43649889bb
-rw-r--r-- | sc/source/core/tool/address.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index d301e65457b9..2c39f1bcfcfb 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -834,15 +834,6 @@ static sal_uInt16 lcl_ScRange_Parse_XL_R1C1( ScRange& r, return 0; } -static inline sal_Unicode lcl_toupper( const sal_Unicode c ) -{ - // Do not use libc toupper() because that is localized and *might* yield - // unexpected results (apparently not encountered yet?), for example - // Turkish lower case ASCII 'i' might result in upper case 'İ', which is - // U+0130 but 0xDD in ISO-8859-9 and 0xA9 in ISO-8859-3 encodings. - return ('a' <= c && c <= 'z') ? c - ('a'-'A') : c; -} - static inline const sal_Unicode* lcl_a1_get_col( const sal_Unicode* p, ScAddress* pAddr, sal_uInt16* nFlags ) @@ -855,9 +846,9 @@ static inline const sal_Unicode* lcl_a1_get_col( const sal_Unicode* p, if( !rtl::isAsciiAlpha( *p ) ) return NULL; - nCol = sal::static_int_cast<SCCOL>( lcl_toupper( *p++ ) - 'A' ); + nCol = sal::static_int_cast<SCCOL>( rtl::toAsciiUpperCase( *p++ ) - 'A' ); while (nCol <= MAXCOL && rtl::isAsciiAlpha(*p)) - nCol = sal::static_int_cast<SCCOL>( ((nCol + 1) * 26) + lcl_toupper( *p++ ) - 'A' ); + nCol = sal::static_int_cast<SCCOL>( ((nCol + 1) * 26) + rtl::toAsciiUpperCase( *p++ ) - 'A' ); if( nCol > MAXCOL || rtl::isAsciiAlpha( *p ) ) return NULL; @@ -1154,9 +1145,9 @@ static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo if (rtl::isAsciiAlpha( *p )) { - nCol = sal::static_int_cast<SCCOL>( lcl_toupper( *p++ ) - 'A' ); + nCol = sal::static_int_cast<SCCOL>( rtl::toAsciiUpperCase( *p++ ) - 'A' ); while (nCol < MAXCOL && rtl::isAsciiAlpha(*p)) - nCol = sal::static_int_cast<SCCOL>( ((nCol + 1) * 26) + lcl_toupper( *p++ ) - 'A' ); + nCol = sal::static_int_cast<SCCOL>( ((nCol + 1) * 26) + rtl::toAsciiUpperCase( *p++ ) - 'A' ); } else nBits = 0; |