diff options
author | Eike Rathke <erack@redhat.com> | 2019-09-26 19:44:41 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-09-27 01:23:16 +0200 |
commit | f526a525758c8e4507e0bcc039330f4fc8a174b4 (patch) | |
tree | 46cd164d6836a558773020c44e6e664eb8a245ab /svl | |
parent | 5f01b90b305696915d500df81d153d262053d4a9 (diff) |
Resolves: tdf#127363 accept SEPT as SEP for September
Change-Id: Idc0fb30308ca32428125656dc8b2ce68e35c4770
Reviewed-on: https://gerrit.libreoffice.org/79655
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 0872ea5b5121..cdf4d1e255e0 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -640,13 +640,22 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) res = sal::static_int_cast< short >(-(i+1)); // negative break; // for } - else if ( i == 8 && pUpperAbbrevMonthText[i] == "SEPT" && - StringContainsWord( "SEP", rString, nPos ) ) - { // #102136# The correct English form of month September abbreviated is - // SEPT, but almost every data contains SEP instead. - nPos = nPos + 3; - res = sal::static_int_cast< short >(-(i+1)); // negative - break; // for + else if (i == 8) + { + // This assumes the weirdness is applicable to all locales. + if (pUpperAbbrevMonthText[i] == "SEPT" && StringContainsWord( "SEP", rString, nPos)) + { // #102136# The correct English form of month September abbreviated is + // SEPT, but almost every data contains SEP instead. + nPos = nPos + 3; + res = sal::static_int_cast< short >(-(i+1)); // negative + break; // for + } + else if (pUpperAbbrevMonthText[i] == "SEP" && StringContainsWord( "SEPT", rString, nPos)) + { // And vice versa, accept SEPT for SEP + nPos = nPos + 4; + res = sal::static_int_cast< short >(-(i+1)); // negative + break; // for + } } } if (!res) |