summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorLaurent BP <laurent.balland-poirier@laposte.net>2017-10-21 00:56:00 +0200
committerEike Rathke <erack@redhat.com>2017-10-23 13:43:12 +0200
commitb4da498db27bcf6e93c1899e9a19942b3462946b (patch)
tree8ea68d31ca4af245043400a75c2a3e5498091353 /svl
parentadc20182157c604e702a4af4e73e63be614ae6d8 (diff)
Follow-up of resolution of tdf#33689 for Finnish
Using MM in Finnish should be minutes. However, if English NfKeywords are used, MM can be month or minutes. This patch try to distinguish minute/month if minute was first detected. Change-Id: I029f3f2a4d79cb4a9730f8c32147f14bedd8094c Reviewed-on: https://gerrit.libreoffice.org/43633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforscan.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index d4991fad3c57..cbb71aa47733 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1273,6 +1273,8 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
break;
case NF_KEY_M: // M
case NF_KEY_MM: // MM
+ case NF_KEY_MI: // M minute detected in Finnish
+ case NF_KEY_MMI: // MM
/* Minute or month.
Minute if one of:
* preceded by time keyword H (ignoring separators)
@@ -1296,13 +1298,20 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
PreviousChar(i) == '[' ) // [M
{
eNewType = css::util::NumberFormat::TIME;
- nTypeArray[i] -= 2; // 6 -> 4, 7 -> 5
+ if ( nTypeArray[i] == NF_KEY_M || nTypeArray[i] == NF_KEY_MM )
+ {
+ nTypeArray[i] -= 2; // 6 -> 4, 7 -> 5
+ }
bIsTimeDetected = false; // next M should be month
bHaveMinute = true;
}
else
{
eNewType = css::util::NumberFormat::DATE;
+ if ( nTypeArray[i] == NF_KEY_MI || nTypeArray[i] == NF_KEY_MMI )
+ { // follow resolution of tdf#33689 for Finnish
+ nTypeArray[i] += 2; // 4 -> 6, 5 -> 7
+ }
}
break;
case NF_KEY_MMM: // MMM