svl/source/numbers/zforfind.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 5dd4c279a6bb6f297f1c02f2aeb905a81e5fa80d
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Mon Aug 2 22:11:29 2021 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Aug 4 12:34:31 2021 +0200

    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 <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 4961dbaecc9e5cac57d99d2ea9d265a90daa4a8b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119857
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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.

Reply via email to