sc/source/filter/xml/XMLCalculationSettingsContext.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
New commits: commit a60e3c28dbf561b0d1eb190baf32f06151bf32a0 Author: Eike Rathke <er...@redhat.com> AuthorDate: Thu Jun 30 01:38:43 2022 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Thu Jun 30 23:44:05 2022 +0200 crashtesting: assert on reexport to ods of forum-it-7248.ods source document available from: https://forum.openoffice.org/it/forum/download/file.php?id=7248 The actual cause is already a bad <table:null-date table:date-value="0000-00-00"/> imported unchecked. For this, sax::Converter::parseDateTime() returns a success value, just use it.. If bad keep the default NullDate. Change-Id: If4caa57e302cfe8304e6cb49bf9d330245a97660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136611 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins (cherry picked from commit 626458eaec9a1c6ef2c29fd25dc5612d3dd1555c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136646 diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx index 1989b337faf2..43da1437eb5c 100644 --- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx +++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx @@ -150,12 +150,14 @@ ScXMLNullDateContext::ScXMLNullDateContext( ScXMLImport& rImport, if (aIter != rAttrList->end()) { util::DateTime aDateTime; - ::sax::Converter::parseDateTime(aDateTime, aIter.toView()); - util::Date aDate; - aDate.Day = aDateTime.Day; - aDate.Month = aDateTime.Month; - aDate.Year = aDateTime.Year; - pCalcSet->SetNullDate(aDate); + if (::sax::Converter::parseDateTime(aDateTime, aIter.toView())) + { + util::Date aDate; + aDate.Day = aDateTime.Day; + aDate.Month = aDateTime.Month; + aDate.Year = aDateTime.Year; + pCalcSet->SetNullDate(aDate); + } } }