diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-17 10:38:13 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-17 10:38:13 +0100 |
commit | 0b8a21a33a3d751b885c964853f73afde18632e9 (patch) | |
tree | 5a6c4c8b39d591a8a89be7fb6a5c88f62507fc22 | |
parent | 1acbdc6bbda4021b40fa6d2da75f26e59a156d7f (diff) |
Don't assume sal_Unicode is unsigned short
Change-Id: I727951614587654c11af5f6635a45c52ebec1b5a
-rw-r--r-- | i18npool/source/indexentry/indexentrysupplier_asian.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/nativenumber/nativenumbersupplier.cxx | 3 | ||||
-rw-r--r-- | i18npool/source/transliteration/textToPronounce_zh.cxx | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/i18npool/source/indexentry/indexentrysupplier_asian.cxx b/i18npool/source/indexentry/indexentrysupplier_asian.cxx index 469a459d60a0..aaaee94d52a3 100644 --- a/i18npool/source/indexentry/indexentrysupplier_asian.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_asian.cxx @@ -121,7 +121,10 @@ IndexEntrySupplier_asian::getIndexCharacter( const OUString& rIndexEntry, sal_uInt16 address=idx[0][ch >> 8]; if (address != 0xFFFF) { address=idx[1][address+(ch & 0xFF)]; - return idx[2] ? OUString(&idx[2][address]) : OUString(address); + return idx[2] + ? OUString( + reinterpret_cast<sal_Unicode *>(&idx[2][address])) + : OUString(sal_Unicode(address)); } } } @@ -190,7 +193,8 @@ IndexEntrySupplier_asian::getPhoneticCandidate( const OUString& rIndexEntry, if ( i > 0 && rLocale.Language == "zh" ) candidate.append(" "); if (idx[2]) - candidate.append(&idx[2][address]); + candidate.append( + reinterpret_cast<sal_Unicode *>(&idx[2][address])); else candidate.append(address); } else diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index b0bd76ded5bf..76f421433ecd 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -318,7 +318,8 @@ static OUString SAL_CALL NativeToAscii(const OUString& inStr, multiplierChar = OUString(MultiplierChar_7_CJK[0], ExponentCount_7_CJK*Multiplier_Count); decimalChar = OUString(DecimalChar, NumberChar_Count); minusChar = OUString(MinusChar, NumberChar_Count); - separatorChar = OUString(SeparatorChar, NumberChar_Count); + separatorChar = OUString( + reinterpret_cast<sal_Unicode *>(SeparatorChar), NumberChar_Count); for ( i = 0; i < nCount; i++) { if ((index = multiplierChar.indexOf(str[i])) >= 0) { diff --git a/i18npool/source/transliteration/textToPronounce_zh.cxx b/i18npool/source/transliteration/textToPronounce_zh.cxx index f0d99179e964..526b1fa30d73 100644 --- a/i18npool/source/transliteration/textToPronounce_zh.cxx +++ b/i18npool/source/transliteration/textToPronounce_zh.cxx @@ -38,7 +38,8 @@ TextToPronounce_zh::getPronounce(const sal_Unicode ch) if (idx) { sal_uInt16 address = idx[0][ch>>8]; if (address != 0xFFFF) - return &idx[2][idx[1][address + (ch & 0xFF)]]; + return reinterpret_cast<sal_Unicode *>( + &idx[2][idx[1][address + (ch & 0xFF)]]); } return emptyString; } |