summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-09-30 21:14:36 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-10-01 21:02:59 +0200
commitcdb9610b74d13a3b974c66e7201d782291a7f3b1 (patch)
treee722ecd37452e8ffbb1417c3bd4db6142f994544
parentffeaa487a9ba67eee816016e50b6092abb217003 (diff)
Number scanner: accept negative year ISO 8601 input with 'T' time separator
This is valid input: -1999-11-23T12:34:56 Change-Id: I0464b623b76fb55c1d2b848d0db9278e9589a4d8 (cherry picked from commit c3819630e0205a372899ef67d689619657bbbf33) Reviewed-on: https://gerrit.libreoffice.org/42972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-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 b900f3856296..a411d08ac06b 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2553,9 +2553,10 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString,
}
else if (nPos == 0 && rString.getLength() == 1 && MayBeIso8601())
{
- if (nStringPos == 5 && rString[0] == 'T')
+ if ( (nStringPos == 5 && rString[0] == 'T') ||
+ (nStringPos == 6 && rString[0] == 'T' && sStrArray[0] == "-"))
{
- // ISO 8601 combined date and time, yyyy-mm-ddThh:mm
+ // ISO 8601 combined date and time, yyyy-mm-ddThh:mm or -yyyy-mm-ddThh:mm
++nPos;
}
else if (nStringPos == 7 && rString[0] == ':')