diff options
author | Eike Rathke <ooo@erack.de> | 2011-08-04 23:43:19 +0200 |
---|---|---|
committer | Eike Rathke <ooo@erack.de> | 2011-08-05 12:35:58 +0200 |
commit | 9c830990146958660604bb57ada18afd96f25cf4 (patch) | |
tree | fd559d1e302e2400b6e264b2f67a9bebdfd3c854 /svl/inc | |
parent | e423dc7321674e5e6442ce1e7c19f50e3eabc9ea (diff) |
Fix fdo#38956 discarding bracketed prefixes in number formats, such as [RED]
* Fixed discarding of prefixes.
* Fixed the broken handling of Thai calendar and numerals speciality.
* Added bits to actually display a format with embedded LCID in the dialog if
the LCID doesn't match the currently viewed locale.
Diffstat (limited to 'svl/inc')
-rw-r--r-- | svl/inc/svl/zforlist.hxx | 20 | ||||
-rw-r--r-- | svl/inc/svl/zformat.hxx | 16 |
2 files changed, 36 insertions, 0 deletions
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 279282fe88dd..7c92b78339a6 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -42,6 +42,7 @@ #include <svl/nfkeytab.hxx> #include <map> +#include <set> class Date; class SvStream; @@ -225,6 +226,8 @@ typedef Table SvNumberFormatterIndexTable; typedef ::std::map< sal_uInt32, sal_uInt32 > SvNumberFormatterMergeMap; +typedef ::std::set< LanguageType > NfInstalledLocales; + /** Language/country dependent currency entries */ @@ -343,6 +346,9 @@ public: */ static const sal_uInt16 INPUTSTRING_PRECISION; + /** THE set of installed locales. */ + static NfInstalledLocales theInstalledLocales; + /// Preferred ctor with service manager and language/country enum SvNumberFormatter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr, @@ -798,6 +804,20 @@ public: language/country, used in XML import */ String GetStandardName( LanguageType eLnge ); + /// Skip a NumberFormatter in stream, Chart needs this + static void SkipNumberFormatterInStream( SvStream& ); + + /** Check if a specific locale has supported locale data. */ + static bool IsLocaleInstalled( LanguageType eLang ) + { + // The set is initialized as a side effect of the currency table + // created, make sure that exists, which usually is the case unless a + // SvNumberFormatter was never instanciated. + GetTheCurrencyTable(); + return theInstalledLocales.find( eLang) != theInstalledLocales.end(); + } + + private: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager; ::com::sun::star::lang::Locale aLocale; diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index aa84528b96d5..c65d2a4046b4 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -529,6 +529,22 @@ private: */ SVL_DLLPRIVATE static LocaleType ImpGetLocaleType( const String& rString, xub_StrLen& nPos ); + /** Obtain calendar and numerals from a LocaleType that was parsed from a + LCID with ImpGetLocaleType(). + + Inserts a NatNum modifier to rString at nPos if needed as determined + from the numeral code. + + @ATTENTION: may modify <member>maLocale</member> to make it follow + aTmpLocale, in which case also nLang is adapted. + + @returns a string with the calendar if one was determined from the + calendar code, else an empty string. The calendar string needs to be + inserted at a proper positon to rString after all bracketed prefixes. + */ + SVL_DLLPRIVATE String ImpObtainCalendarAndNumerals( String & rString, + xub_StrLen & nPos, LanguageType & nLang, const LocaleType & aTmpLocale ); + // standard number output SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, String& OutString ); SVL_DLLPRIVATE void ImpGetOutputStdToPrecision( double& rNumber, String& rOutString, sal_uInt16 nPrecision ) const; |