diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2013-08-10 12:41:03 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-08-19 15:49:18 +0000 |
commit | c8e39e66528affb66f1ae121fa36dd4ab31a9b0b (patch) | |
tree | 227691ebad802e87695bfffb96889a1ccfe147a4 /sal/rtl/ustring.cxx | |
parent | 2e45813b7e5757bc050e121acfe942763b9544ff (diff) |
Introduce rtl::compareIgnoreCase and deprecate rtl/character.hxx equivalents.
Change-Id: Id90935fd2b0f904f89477792edc8140cfc31e91f
Reviewed-on: https://gerrit.libreoffice.org/5412
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'sal/rtl/ustring.cxx')
-rw-r--r-- | sal/rtl/ustring.cxx | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx index abf9db7b388b..3f54088c8573 100644 --- a/sal/rtl/ustring.cxx +++ b/sal/rtl/ustring.cxx @@ -41,6 +41,7 @@ #include "strimp.hxx" #include "surrogates.hxx" #include <rtl/ustring.h> +#include <rtl/character.hxx> #include "rtl/math.h" #include "rtl/tencinfo.h" @@ -404,23 +405,10 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( co { const sal_Unicode* pStr1End = pStr1 + nStr1Len; sal_Int32 nRet; - sal_Int32 c1; - sal_Int32 c2; while ( (nShortenedLength > 0) && (pStr1 < pStr1End) && *pStr2 ) { - /* Check ASCII range */ - SAL_WARN_IF( ((unsigned char)*pStr2) > 127, "rtl.string", - "rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength - Found char > 127" ); - - /* If character between 'A' and 'Z', than convert it to lowercase */ - c1 = (sal_Int32)*pStr1; - c2 = (sal_Int32)((unsigned char)*pStr2); - if ( (c1 >= 65) && (c1 <= 90) ) - c1 += 32; - if ( (c2 >= 65) && (c2 <= 90) ) - c2 += 32; - nRet = c1-c2; + nRet = rtl::compareAsciiIgnoreCase( *pStr1, (sal_Int32)((unsigned char)*pStr2)); if ( nRet != 0 ) return nRet; |