diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-23 23:06:10 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-23 23:09:16 +0100 |
commit | af60316514f3ae3d4c475819bf86f2af837171e3 (patch) | |
tree | ccfbd673bd4a53047a04dad6457d09c7eea1566c /unotools/inc | |
parent | 37f5b864014e9ad17a561b77ea9f6141650e92ad (diff) |
some i18n wrappers with LanguageTag
Change-Id: I2ceaa3159e8669c2c569fa8559c1e061dcad399d
Diffstat (limited to 'unotools/inc')
-rw-r--r-- | unotools/inc/unotools/charclass.hxx | 15 | ||||
-rw-r--r-- | unotools/inc/unotools/intlwrapper.hxx | 11 | ||||
-rw-r--r-- | unotools/inc/unotools/localedatawrapper.hxx | 16 |
3 files changed, 23 insertions, 19 deletions
diff --git a/unotools/inc/unotools/charclass.hxx b/unotools/inc/unotools/charclass.hxx index 744321091230..c08e84c7d0a4 100644 --- a/unotools/inc/unotools/charclass.hxx +++ b/unotools/inc/unotools/charclass.hxx @@ -23,6 +23,7 @@ #include <ctype.h> // isdigit(), isalpha() #include <boost/noncopyable.hpp> +#include <i18npool/languagetag.hxx> #include <tools/string.hxx> #include <tools/solar.h> #include <com/sun/star/i18n/KCharacterType.hpp> @@ -68,7 +69,7 @@ const sal_Int32 nCharClassNumericTypeMask = class UNOTOOLS_DLLPUBLIC CharClass : private boost::noncopyable { - ::com::sun::star::lang::Locale aLocale; + LanguageTag maLanguageTag; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > xCC; mutable ::osl::Mutex aMutex; @@ -76,19 +77,19 @@ public: /// Preferred ctor with service manager specified CharClass( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext, - const ::com::sun::star::lang::Locale& rLocale); + const LanguageTag& rLanguageTag ); /// Depricated ctor, tries to get a process service manager or to load the /// library directly. - CharClass(const ::com::sun::star::lang::Locale& rLocale); + CharClass( const LanguageTag& rLanguageTag ); ~CharClass(); /// set a new Locale - void setLocale( const ::com::sun::star::lang::Locale& rLocale ); + void setLanguageTag( const LanguageTag& rLanguageTag ); /// get current Locale - const ::com::sun::star::lang::Locale& getLocale() const; + const LanguageTag& getLanguageTag() const; /// isdigit() on ascii values @@ -213,6 +214,10 @@ public: sal_Bool isNumeric( const String& rStr ) const; sal_Bool isAlphaNumeric( const String& rStr ) const; sal_Bool isLetterNumeric( const String& rStr ) const; + +private: + + const ::com::sun::star::lang::Locale & getMyLocale() const; }; #endif // _UNOTOOLS_CHARCLASS_HXX diff --git a/unotools/inc/unotools/intlwrapper.hxx b/unotools/inc/unotools/intlwrapper.hxx index fa2625057d24..7d1665264d4d 100644 --- a/unotools/inc/unotools/intlwrapper.hxx +++ b/unotools/inc/unotools/intlwrapper.hxx @@ -48,7 +48,7 @@ class UNOTOOLS_DLLPUBLIC IntlWrapper { private: - LanguageTag aLanguageTag; + LanguageTag maLanguageTag; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; LocaleDataWrapper* pLocaleData; @@ -62,16 +62,11 @@ private: public: IntlWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF, - const ::com::sun::star::lang::Locale& rLocale - ); - IntlWrapper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF, - LanguageType eLang + const LanguageTag& rLanguageTag ); ~IntlWrapper(); - LanguageType getLanguage() const { return aLanguageTag.getLanguageType(); } - const ::com::sun::star::lang::Locale& getLocale() const { return aLanguageTag.getLocale(); } + const LanguageTag& getLanguageTag() const { return maLanguageTag; } const LocaleDataWrapper* getLocaleData() const { diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx index 1198895753d9..1db497abcd3f 100644 --- a/unotools/inc/unotools/localedatawrapper.hxx +++ b/unotools/inc/unotools/localedatawrapper.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/i18n/LocaleItem.hpp> #include <com/sun/star/i18n/reservedWords.hpp> #include <rtl/ustring.hxx> +#include <i18npool/languagetag.hxx> #include <unotools/readwritemutexguard.hxx> #include "unotools/unotoolsdllapi.h" @@ -58,7 +59,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4 > xLD; - ::com::sun::star::lang::Locale aLocale; + LanguageTag maLanguageTag; ::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > xDefaultCalendar; ::com::sun::star::i18n::LocaleDataItem aLocaleDataItem; ::com::sun::star::uno::Sequence< ::rtl::OUString > aReservedWordSeq; @@ -112,10 +113,10 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable public: LocaleDataWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext, - const ::com::sun::star::lang::Locale& rLocale + const LanguageTag& rLanguageTag ); LocaleDataWrapper( - const ::com::sun::star::lang::Locale& rLocale + const LanguageTag& rLanguageTag ); ~LocaleDataWrapper(); @@ -129,13 +130,13 @@ public: const { return m_xContext; } /// set a new Locale to request - void setLocale( const ::com::sun::star::lang::Locale& rLocale ); + void setLanguageTag( const LanguageTag& rLanguageTag ); /// get current requested Locale - const ::com::sun::star::lang::Locale& getLocale() const; + const LanguageTag& getLanguageTag() const; /// get current loaded Locale, which might differ from the requested Locale - ::com::sun::star::lang::Locale getLoadedLocale() const; + LanguageTag getLoadedLanguageTag() const; // Wrapper implementations of service LocaleData @@ -349,6 +350,9 @@ public: static void outputCheckMessage( const char* pStr); private: + + const ::com::sun::star::lang::Locale & getMyLocale() const; + static void evaluateLocaleDataChecking(); }; |