summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2019-10-18 19:35:47 +0200
committerEike Rathke <erack@redhat.com>2019-10-18 23:44:09 +0200
commit7d72b9d34c1183b7471a7a97c007aba10de2d27e (patch)
treef4f1b1a5a2a5c184626f3efef83277416c157c4f /svl/source
parentb3f67f9887e30240292b2f40c64161ed53281795 (diff)
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@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/numbers/zforfind.cxx4
1 files changed, 4 insertions, 0 deletions
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)
{