summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-11-09 18:45:29 +0100
committerEike Rathke <erack@redhat.com>2012-11-09 18:51:40 +0100
commitcfe101e31c16984d1061d8aa1d4cfdc07e33471f (patch)
tree7080c81ba907330f8c96407c78e71f3b1f9f2d92 /i18npool
parentf39238693096fe0001f8d526f22b920fc0be185b (diff)
LanguageTag conversion helper define
Prepared private methods to force compiler errors during conversion to LanguageTag. Commented current usage on some methods. Change-Id: If365e24c7cf06bdf33ecd0bc15ddbfe33cd347c0
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/inc/i18npool/mslangid.hxx42
1 files changed, 40 insertions, 2 deletions
diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx
index 9c9cbdba8e41..574a07dbabe4 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 );