[Libreoffice-commits] core.git: i18npool/source

Stephan Bergmann sbergman at redhat.com
Tue Nov 17 01:38:38 PST 2015


 i18npool/source/indexentry/indexentrysupplier_asian.cxx |    8 ++++++--
 i18npool/source/nativenumber/nativenumbersupplier.cxx   |    3 ++-
 i18npool/source/transliteration/textToPronounce_zh.cxx  |    3 ++-
 3 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 0b8a21a33a3d751b885c964853f73afde18632e9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 17 10:38:13 2015 +0100

    Don't assume sal_Unicode is unsigned short
    
    Change-Id: I727951614587654c11af5f6635a45c52ebec1b5a

diff --git a/i18npool/source/indexentry/indexentrysupplier_asian.cxx b/i18npool/source/indexentry/indexentrysupplier_asian.cxx
index 469a459..aaaee94 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 b0bd76d..76f4214 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 f0d9917..526b1fa 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;
 }


More information about the Libreoffice-commits mailing list