[Libreoffice-commits] .: i18npool/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 9 09:52:00 PST 2012


 i18npool/inc/i18npool/mslangid.hxx |   42 +++++++++++++++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

New commits:
commit cfe101e31c16984d1061d8aa1d4cfdc07e33471f
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Nov 9 18:45:29 2012 +0100

    LanguageTag conversion helper define
    
    Prepared private methods to force compiler errors during conversion to
    LanguageTag. Commented current usage on some methods.
    
    Change-Id: If365e24c7cf06bdf33ecd0bc15ddbfe33cd347c0

diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx
index 9c9cbdb..574a07d 100644
--- a/i18npool/inc/i18npool/mslangid.hxx
+++ b/i18npool/inc/i18npool/mslangid.hxx
@@ -26,11 +26,20 @@
 #include "i18npool/lang.h"
 #include <com/sun/star/lang/Locale.hpp>
 
+// 0 := normal usage
+// 1 := force LanguageTag and make all conversion functions private to make the
+// compiler bail out
+#define I18NPOOL_FORCE_LANGUAGETAG 0
 
 /** Methods related to Microsoft language IDs. For details about MS-LANGIDs
     please see lang.h */
 class I18NISOLANG_DLLPUBLIC MsLangId
 {
+
+#if I18NPOOL_FORCE_LANGUAGETAG
+    friend class LanguageTag;
+#endif
+
 public:
 
     /// Create a LangID from a primary and a sublanguage.
@@ -84,6 +93,10 @@ public:
     static LanguageType getRealLanguage( LanguageType nLang );
 
 
+#if I18NPOOL_FORCE_LANGUAGETAG
+private:
+#endif
+
     /** @short: Convert a LanguageType to a Locale, resolving LANGUAGE_SYSTEM.
 
         @ATTENTION: A round trip convertLanguageToLocale(
@@ -136,6 +149,12 @@ public:
             const ::com::sun::star::lang::Locale & rLocale );
 
 
+#if I18NPOOL_FORCE_LANGUAGETAG
+public:
+#endif
+    // TODO: refactor to LanguageTag? Used only in
+    // i18npool/source/localedata/localedata.cxx
+
     /** Get fall-back Locale for Locale with handling of an empty language name
         designating the SYSTEM language. Returns the same Locale if an exact
         match was found.
@@ -143,6 +162,10 @@ public:
     static ::com::sun::star::lang::Locale getFallbackLocale(
             const ::com::sun::star::lang::Locale & rLocale );
 
+#if I18NPOOL_FORCE_LANGUAGETAG
+private:
+#endif
+
     // -----------------------------
     // - ConvertLanguageToIsoNames -
     // -----------------------------
@@ -166,8 +189,23 @@ public:
             const rtl::OString& rCountry );
     static LanguageType convertIsoStringToLanguage(
             const rtl::OUString& rString, sal_Unicode cSep = '-' );
-    static LanguageType convertUnxByteStringToLanguage(
-            const rtl::OString& rString );
+
+#if I18NPOOL_FORCE_LANGUAGETAG
+public:
+#endif
+    // TODO: refactor to LanguageTag, used only in
+    // i18npool/source/isolang/inunx.cxx to convert Unix locale string
+
+    static LanguageType convertUnxByteStringToLanguage( const rtl::OString& rString );
+
+#if I18NPOOL_FORCE_LANGUAGETAG
+private:
+#endif
+
+
+#if I18NPOOL_FORCE_LANGUAGETAG
+public:
+#endif
 
     static LanguageType resolveSystemLanguageByScriptType( LanguageType nLang, sal_Int16 nType );
 


More information about the Libreoffice-commits mailing list