[Libreoffice-commits] .: i18nutil/source unotools/source

Caolán McNamara caolan at kemper.freedesktop.org
Sun Jan 16 06:25:28 PST 2011


 i18nutil/source/utility/casefolding.cxx  |    2 +-
 unotools/source/config/compatibility.cxx |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 3132b358bd07705e7e3d9c82a2a7cba6fb7ec885
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 16 14:13:07 2011 +0000

    equalsAsciiL faster than equalsAscii & comparetoAscii(const sal_Char*)

diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx
index 125aa60..392b22e 100644
--- a/i18nutil/source/utility/casefolding.cxx
+++ b/i18nutil/source/utility/casefolding.cxx
@@ -46,7 +46,7 @@ static Mapping mapping_0049[] = {{0, 2, {0x0069, 0x0307, 0}},{0, 1, {0x0131, 0,
 static Mapping mapping_0069[] = {{0, 1, {0x0130, 0, 0}},{0, 1, {0x0049, 0, 0}}};
 static Mapping mapping_0130[] = {{0, 1, {0x0069, 0, 0}},{0, 1, {0x0130, 0, 0}}};
 
-#define langIs(lang) (aLocale.Language.compareToAscii(lang) == 0)
+#define langIs(lang) (aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(lang)))
 
 // only check simple case, there is more complicated case need to be checked.
 #define type_i(ch) ((ch) == 0x0069 || (ch) == 0x006a) 
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index bd6a9a8..17cf8f1 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -429,8 +429,9 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl()
         {
             SvtSysLocale aSysLocale;
             com::sun::star::lang::Locale aLocale = aSysLocale.GetLocale();
-            if ( aLocale.Language.equalsAscii( "zh" ) || aLocale.Language.equalsAscii( "ja" ) ||
-                    aLocale.Language.equalsAscii( "ko" ) )
+            if ( aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("zh")) ||
+                 aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ja")) ||
+                 aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ko")) )
                 aItem.bExpandWordSpace = false;
 
             m_aDefOptions = aItem;


More information about the Libreoffice-commits mailing list