[Libreoffice-commits] core.git: svl/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 26 23:24:34 UTC 2019


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

New commits:
commit f526a525758c8e4507e0bcc039330f4fc8a174b4
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Sep 26 19:44:41 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Fri Sep 27 01:23:16 2019 +0200

    Resolves: tdf#127363 accept SEPT as SEP for September
    
    Change-Id: Idc0fb30308ca32428125656dc8b2ce68e35c4770
    Reviewed-on: https://gerrit.libreoffice.org/79655
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

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)


More information about the Libreoffice-commits mailing list