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

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 18 21:45:30 UTC 2019


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

New commits:
commit 7d72b9d34c1183b7471a7a97c007aba10de2d27e
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Fri Oct 18 19:35:47 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Fri Oct 18 23:44:09 2019 +0200

    Input with subsequent part greater than 59 is not time or duration
    
    Like 1:123 or 1:1:123 is text, but 123:1 or 123:1:1 is a duration.
    
    Change-Id: I4a59d9ed74ae3d4e4bee8a9b86ed0697a02c55e0
    Reviewed-on: https://gerrit.libreoffice.org/81087
    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 cdf4d1e255e0..2ad9bfea50df 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -979,10 +979,14 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
     else if (nIndex - nStartIndex < nCnt)
     {
         nMinute = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32());
+        if (nIndex > 1 && nMinute > 59)
+            bRet = false;   // 1:60 or 1:123 is invalid, 123:1 is valid
     }
     if (nIndex - nStartIndex < nCnt)
     {
         nSecond = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32());
+        if (nIndex > 1 && nSecond > 59)
+            bRet = false;   // 1:60 or 1:123 or 1:1:123 is invalid, 123:1 or 123:1:1 is valid
     }
     if (nIndex - nStartIndex < nCnt)
     {


More information about the Libreoffice-commits mailing list