summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-11-27 14:18:01 +0100
committerEike Rathke <erack@redhat.com>2015-11-27 23:21:35 +0100
commitb55548043e969a6aa4c211217cfc3fb85d50d2da (patch)
tree850a864b3860f594e7fc4e5f51fdaf6bfbf6b8f2
parente5cc49dbf139b2d3ca2bbc0c41e7c47d63c11d66 (diff)
introduce SvNumberFormatter::FillKeywordTableForExcel()
... to conflate the places that do this on their own. Change-Id: Idde2173780e0515ad982b4be46fc4df23a7577ad
-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);