diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:29:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:33:31 +0100 |
commit | c3f4909b992735f6a90b97b8019442a8acd12f95 (patch) | |
tree | fcf5ba14a2f02018e611bc17ffaa6fee91f3b93c /i18npool | |
parent | b98a8221c70474687c4da8c60f2892ce9a792e93 (diff) |
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I7b184414d822e7d3f4f7694dcea540d731f970d9
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/collator/collatorImpl.cxx | 4 | ||||
-rw-r--r-- | i18npool/source/inputchecker/inputsequencechecker.cxx | 4 | ||||
-rw-r--r-- | i18npool/source/transliteration/transliteration_caseignore.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/i18npool/source/collator/collatorImpl.cxx b/i18npool/source/collator/collatorImpl.cxx index fc5b48259575..2c931443a630 100644 --- a/i18npool/source/collator/collatorImpl.cxx +++ b/i18npool/source/collator/collatorImpl.cxx @@ -52,8 +52,8 @@ CollatorImpl::compareSubstring( const OUString& str1, sal_Int32 off1, sal_Int32 if (cachedItem) return cachedItem->xC->compareSubstring(str1, off1, len1, str2, off2, len2); - sal_Unicode *unistr1 = (sal_Unicode*) str1.getStr() + off1; - sal_Unicode *unistr2 = (sal_Unicode*) str2.getStr() + off2; + sal_Unicode *unistr1 = const_cast<sal_Unicode*>(str1.getStr()) + off1; + sal_Unicode *unistr2 = const_cast<sal_Unicode*>(str2.getStr()) + off2; for (int i = 0; i < len1 && i < len2; i++) if (unistr1[i] != unistr2[i]) return unistr1[i] < unistr2[i] ? -1 : 1; diff --git a/i18npool/source/inputchecker/inputsequencechecker.cxx b/i18npool/source/inputchecker/inputsequencechecker.cxx index 039f5ed19c85..93da474aee14 100644 --- a/i18npool/source/inputchecker/inputsequencechecker.cxx +++ b/i18npool/source/inputchecker/inputsequencechecker.cxx @@ -95,10 +95,10 @@ InputSequenceCheckerImpl::getLanguageByScripType(sal_Unicode cChar, sal_Unicode if (type != UnicodeScript_kScriptCount && type == unicode::getUnicodeScriptType( nChar, typeList, UnicodeScript_kScriptCount )) { switch(type) { - case UnicodeScript_kThai: return (sal_Char*)"th"; + case UnicodeScript_kThai: return const_cast<sal_Char*>("th"); //case UnicodeScript_kArabic: return (sal_Char*)"ar"; //case UnicodeScript_kHebrew: return (sal_Char*)"he"; - case UnicodeScript_kDevanagari: return (sal_Char*)"hi"; + case UnicodeScript_kDevanagari: return const_cast<sal_Char*>("hi"); } } return NULL; diff --git a/i18npool/source/transliteration/transliteration_caseignore.cxx b/i18npool/source/transliteration/transliteration_caseignore.cxx index 3b33e460b656..dcfefe3f6d5a 100644 --- a/i18npool/source/transliteration/transliteration_caseignore.cxx +++ b/i18npool/source/transliteration/transliteration_caseignore.cxx @@ -121,8 +121,8 @@ Transliteration_caseignore::compare( const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2) throw(RuntimeException) { - const sal_Unicode *unistr1 = (sal_Unicode*) str1.getStr() + pos1; - const sal_Unicode *unistr2 = (sal_Unicode*) str2.getStr() + pos2; + const sal_Unicode *unistr1 = const_cast<sal_Unicode*>(str1.getStr()) + pos1; + const sal_Unicode *unistr2 = const_cast<sal_Unicode*>(str2.getStr()) + pos2; sal_Unicode c1, c2; MappingElement e1, e2; nMatch1 = nMatch2 = 0; |