summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-05-17 15:59:00 +0200
committerEike Rathke <erack@redhat.com>2021-05-17 17:15:32 +0200
commitdef94a6b50f02682c3f04ce3171665c703c47b2c (patch)
tree07275cd2c8b6296b250c259d24b5188999fead3b /svl
parent5c682a5e24337ac022fb3eba585583b16718d246 (diff)
Resolves: tdf#128314 Use GenitiveMonths name also if comma is following
So 'D MMMM,' works the same as 'D MMMM '. Change-Id: Id910c67174260401b9c37672f189d550480793a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115708 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zformat.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index fd1776bb1cd9..648034f9352a 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3237,9 +3237,9 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
genitive case if the day follows the month, and partitive case if the day
precedes the month. If there is no day of month the nominative case (noun)
is returned. Also if the month is immediately preceded or followed by a
- literal string other than space the nominative name is used, this prevents
- duplicated casing for MMMM\t\a and such in documents imported from (e.g.
- Finnish) Excel or older LibO/OOo releases.
+ literal string other than space and not followed by a comma, the nominative
+ name is used, this prevents duplicated casing for MMMM\t\a and such in
+ documents imported from (e.g. Finnish) Excel or older LibO/OOo releases.
*/
// IDEA: instead of eCodeType pass the index to nTypeArray and restrict
@@ -3276,9 +3276,11 @@ sal_Int32 SvNumberformat::ImpUseMonthCase( int & io_nState, const ImpSvNumFor& r
case NF_KEY_MMMMM:
if ((i < nCount-1 &&
rInfo.nTypeArray[i+1] == NF_SYMBOLTYPE_STRING &&
- rInfo.sStrArray[i+1][0] != ' ') ||
+ // Literal following, not space nor comma.
+ rInfo.sStrArray[i+1][0] != ' ' && rInfo.sStrArray[i+1][0] != ',') ||
(i > 0 && rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_STRING &&
((nLen = rInfo.sStrArray[i-1].getLength()) > 0) &&
+ // Literal preceding, not space.
rInfo.sStrArray[i-1][nLen-1] != ' '))
{
io_nState = 1;