summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svl/zforlist.hxx4
-rw-r--r--svl/source/numbers/zforlist.cxx14
2 files changed, 18 insertions, 0 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 2e3760e084ee..159763b451d8 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -758,6 +758,10 @@ public:
/// Fill a NfKeywordIndex table with keywords of a language/country
void FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang );
+ /** Fill a NfKeywordIndex table with keywords usable in Excel export with
+ GetMappedFormatstring() */
+ void FillKeywordTableForExcel( NfKeywordTable& rKeywords );
+
/** Return a keyword for a language/country and NfKeywordIndex
for XML import, to generate number format strings. */
OUString GetKeyword( LanguageType eLnge, sal_uInt16 nIndex );
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 53b421376b8c..f12ee01405ba 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -775,6 +775,20 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords,
}
+void SvNumberFormatter::FillKeywordTableForExcel( NfKeywordTable& rKeywords )
+{
+ FillKeywordTable( rKeywords, LANGUAGE_ENGLISH_US );
+
+ // Remap codes unknown to Excel.
+ rKeywords[ NF_KEY_NN ] = "DDD";
+ rKeywords[ NF_KEY_NNN ] = "DDDD";
+ // NNNN gets a separator appended in SvNumberformat::GetMappedFormatString()
+ rKeywords[ NF_KEY_NNNN ] = "DDDD";
+ // Export the Thai T NatNum modifier.
+ rKeywords[ NF_KEY_THAI_T ] = "T";
+}
+
+
OUString SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex )
{
ChangeIntl(eLnge);