diff options
author | Eike Rathke <erack@redhat.com> | 2021-08-02 22:11:29 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-04 12:34:31 +0200 |
commit | 5dd4c279a6bb6f297f1c02f2aeb905a81e5fa80d (patch) | |
tree | af92d01e788450afd488206357896136d914f3bd /svl | |
parent | edc53ec766993b0b7910e87b3765d720565191d6 (diff) |
Resolves: tdf#143664 {de-*} accept "Mär" and "Mrz" for March
Change-Id: I82c094687137995a634450cb4f617909859d1688
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119916
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 4961dbaecc9e5cac57d99d2ea9d265a90daa4a8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119857
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 8b01debbb1d4..121b9bd406f6 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -649,9 +649,25 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) res = sal::static_int_cast< short >(-(i+1)); // negative break; // for } + else if (i == 2 && pFormatter->GetLanguageTag().getLanguage() == "de") + { + if (pUpperAbbrevMonthText[i] == u"M\u00C4R" && StringContainsWord( "MRZ", rString, nPos)) + { // Accept MRZ for MÄR + nPos = nPos + 3; + res = sal::static_int_cast< short >(-(i+1)); // negative + break; // for + } + else if (pUpperAbbrevMonthText[i] == "MRZ" && StringContainsWord( u"M\u00C4R", rString, nPos)) + { // And vice versa, accept MÄR for MRZ + 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. + // It is the case for at least en-* and de-* 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. |