diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-11 16:42:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-12 20:14:17 +0000 |
commit | 76b923ebf17eba7d2ec13b66bf03f3ac4ea347c3 (patch) | |
tree | 2c6180301d4dc6f1bec8a78f200174c65fe51f68 /oox | |
parent | bc2d59641c38b237eecef464a1c725da6592f55c (diff) |
crashtesting: accept timestamp with Z suffix as valid
seen with forum-mso-en4-652977.xlsx
Change-Id: I5ca7be851c279d28e225cba1ba401a4f7fa99e87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143945
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/attributelist.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index e0bea17c22e6..c247fdb43e8d 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -250,8 +250,9 @@ OptValue< util::DateTime > AttributeList::getDateTime( sal_Int32 nAttrToken ) co { OUString aValue = mxAttribs->getOptionalValue( nAttrToken ); util::DateTime aDateTime; - bool bValid = (aValue.getLength() == 19) && (aValue[ 4 ] == '-') && (aValue[ 7 ] == '-') && - (aValue[ 10 ] == 'T') && (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); + bool bValid = (aValue.getLength() == 19 || (aValue.getLength() == 20 && aValue[19] == 'Z')) && + (aValue[ 4 ] == '-') && (aValue[ 7 ] == '-') && (aValue[ 10 ] == 'T') && + (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); if( bValid ) { aDateTime.Year = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 0, 4 )) ); |