summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-09-13 11:42:39 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-14 10:26:37 +0200
commitd2a78a49438134e174bb8fc83d4adb486f692ff7 (patch)
tree46466fe6712b3e7cffd1f6e91e64c0b7367737ea
parent0d957c6474f6dfb713fd7ed6edc6edf70efe42b3 (diff)
Resolves: tdf#116184 Check that there is no trailing number behind a match
... without being separated by a blank so the match is rejected if it doesn't possibly form a date+time input and input can be accepted as decimal fraction. Change-Id: Iabd1d216366ecb8454c59822ce58f112bfa6091e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122024 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit eb0b4ab2d3b86d77ee0edb652d4486343e5b3b1f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122055 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--svl/source/numbers/zforfind.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 191a388581ea..9f90dd28b732 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1487,8 +1487,9 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt )
if (!IsNum[nCheck])
{
// Trailing (or separating if time follows) blanks are ok.
- SkipBlanks( sStrArray[nCheck], nPos);
- if (nPos == sStrArray[nCheck].getLength())
+ // No blank and a following number is not.
+ const bool bBlanks = SkipBlanks( sStrArray[nCheck], nPos);
+ if (nPos == sStrArray[nCheck].getLength() && (bBlanks || !IsNum[nNext]))
{
nAcceptedDatePattern = nPattern;
return true;