oox/source/helper/attributelist.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit 76b923ebf17eba7d2ec13b66bf03f3ac4ea347c3 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Dec 11 16:42:37 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Dec 12 20:14:17 2022 +0000 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 <caol...@redhat.com> 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 )) );