summaryrefslogtreecommitdiff
path: root/cui/source/tabpages
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-10-27 08:36:37 +0200
committerLászló Németh <nemeth@numbertext.org>2022-11-03 22:20:36 +0100
commit2a1d2d42af7f365330479f4032ddfdd9eeba7c1d (patch)
tree079e5d9995d8fe86e4290604011897f057eb6d0f /cui/source/tabpages
parent142d3e15916afd1c38bcccf0d23cac292ea357fc (diff)
tdf#115007 add NatNum12 number format list items, fix title case
Add NumberText NatNum12 number formats, e.g. "One Hundred", and currency formats, e.g. "One U.S. Dollar and Twenty Cents" to number formatting dialog windows, i.e. Format Cells->Numbers in Calc and Format Numbers in Writer (Edit Fields->Format-> Additional formats...). Fix also bad English title case: "One Euro *and* *Twenty-Two* cents" (not *And* and *Twenty-two*) Details: – svl: list NatNum12 NumberText currency codes in Currency formats (i.e. after choosing Currency category). – svx: Recognize bank symbol "CURRENCY" in NatNum12 parameters defined in locale resource files. For example, "[NatNum12 CURRENCY]" is converted to "[NatNum12 USD]" in the number format dialog windows, using bank symbol of the current locale settings. Recognize compatible (old) bank symbol "CCC" in NatNum12 parameters defined in locale resource files. For example, "[NatNum12 CCC]" is converted to "[NatNum12 DEM]" in the number format dialog windows, using bank symbol of the compatible currency of the German locale settings. User-defined formats with arbitrary bank codes are recognized as currency formats, e.g. modifying "[NatNum12 USD]" to "[NatNum12 EUR]" in the dialog window results a new currency format item. – i18npool/*en_US.xml: define four Standard NatNum12 formats (lower case, sentence case, title case, upper case) and four Currency NatNum12 formats (title case, title case with digits, upper case, upper case with digits). – cui: use lower sample numbers for spell out formats: – 100 for Standard: One Hundred one hundred One hundred ONE HUNDRED – 1.2 for Currency: One U.S. Dollar ONE U.S. DOLLAR One U.S. Dollar and Twenty Cents ONE U.S. DOLLAR AND TWENTY CENTS – i18npool: fix English title casing of NatNum12 conversions: – Don't apply casing on "and", according to the title case rules, for example: "One Euro and One Cent" instead of "One Euro And One Cent". – Apply casing on the second element of the hyphenated compound words: "Twenty-One" instead of the bad "Twenty-one". – add unit test for extended Number and Currency categories. Note: according to the changes, update user-defined number format id in chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt Change-Id: Ieaf9a8f75a4f197b858eaf67f83484df70295834 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141994 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r--cui/source/tabpages/numfmt.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index ee6d949353a0..54b5b53d9aac 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1665,6 +1665,16 @@ OUString SvxNumberFormatTabPage::GetExpColorString(
}
double fVal = fSvxNumValConst[i];
+ // use lower number for long NatNum12 transliteration
+ if ( ( CAT_CURRENCY == nTmpCatPos || CAT_NUMBER == nTmpCatPos ) &&
+ rFormatStr.indexOf("NatNum12") >= 0 )
+ {
+ if ( CAT_CURRENCY == nTmpCatPos )
+ fVal = 1.2;
+ else
+ fVal = 100; // show also title case for English: One Hundred
+ }
+
OUString aPreviewString;
pNumFmtShell->MakePrevStringFromVal( rFormatStr, aPreviewString, rpPreviewColor, fVal );
return aPreviewString;