[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - svl/source
Eike Rathke
erack at redhat.com
Tue Mar 3 02:07:06 PST 2015
svl/source/numbers/zforfind.cxx | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
New commits:
commit a46a1895f6280b8da2dd6ea61b6c39aea9952f3d
Author: Eike Rathke <erack at redhat.com>
Date: Fri Feb 20 15:11:36 2015 +0100
Resolves: tdf#89500 catch ISO 8601 datetime in all locales
Change-Id: I906ebdc6aa5c365df98a29e9e0f319f89f6833c6
(cherry picked from commit 5d572e673dec3396487b14bb1f9e86aa8ab86786)
Reviewed-on: https://gerrit.libreoffice.org/14565
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index cd8bc6f..fab73b4 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2451,16 +2451,35 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString,
SkipBlanks( rString, nPos );
}
}
- else if (nStringPos == 5 && nPos == 0 && rString.getLength() == 1 &&
- rString[ 0 ] == 'T' && MayBeIso8601())
+ else if (nPos == 0 && rString.getLength() == 1 && MayBeIso8601())
{
- // ISO 8601 combined date and time, yyyy-mm-ddThh:mm
- ++nPos;
+ if (nStringPos == 5 && rString[0] == 'T')
+ {
+ // ISO 8601 combined date and time, yyyy-mm-ddThh:mm
+ ++nPos;
+ }
+ else if (nStringPos == 7 && rString[0] == ':')
+ {
+ // ISO 8601 combined date and time, the time part; we reach
+ // here if the locale's separator is not ':' so it couldn't
+ // be detected above in the time block.
+ if (nAnzNums >= 5)
+ eScannedType = NUMBERFORMAT_DATETIME;
+ ++nPos;
+ }
}
break;
-#if NF_RECOGNIZE_ISO8601_TIMEZONES
case NUMBERFORMAT_DATETIME:
- if (nPos == 0 && rString.getLength() == 1 && nStringPos >= 9 && MayBeIso8601())
+ if (nPos == 0 && rString.getLength() == 1 && MayBeIso8601())
+ {
+ if (nStringPos == 9 && rString[0] == ':')
+ {
+ // ISO 8601 combined date and time, the time part continued.
+ ++nPos;
+ }
+ }
+#if NF_RECOGNIZE_ISO8601_TIMEZONES
+ else if (nPos == 0 && rString.getLength() == 1 && nStringPos >= 9 && MayBeIso8601())
{
// ISO 8601 timezone offset
switch (rString[ 0 ])
@@ -2487,8 +2506,8 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString,
break;
}
}
- break;
#endif
+ break;
}
}
More information about the Libreoffice-commits
mailing list