diff options
author | Eike Rathke <erack@redhat.com> | 2022-06-30 01:38:43 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-09-23 14:27:39 +0200 |
commit | fab7f620ef8ffda8627c3058e18d3042fef5a1df (patch) | |
tree | 95de6c12ee14528b439d33545afa8006b2f9dafb | |
parent | tdf#149692 crash importing document with vba forms (diff) | |
download | core-fab7f620ef8ffda8627c3058e18d3042fef5a1df.tar.gz core-fab7f620ef8ffda8627c3058e18d3042fef5a1df.zip |
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.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136611
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 626458eaec9a1c6ef2c29fd25dc5612d3dd1555c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136646
(cherry picked from commit a60e3c28dbf561b0d1eb190baf32f06151bf32a0)
Change-Id: If4caa57e302cfe8304e6cb49bf9d330245a97660
-rw-r--r-- | sc/source/filter/xml/XMLCalculationSettingsContext.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx index fd7aab6ddb23..802cbf35a00c 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.toString()); - util::Date aDate; - aDate.Day = aDateTime.Day; - aDate.Month = aDateTime.Month; - aDate.Year = aDateTime.Year; - pCalcSet->SetNullDate(aDate); + if (::sax::Converter::parseDateTime(aDateTime, aIter.toString())) + { + util::Date aDate; + aDate.Day = aDateTime.Day; + aDate.Month = aDateTime.Month; + aDate.Year = aDateTime.Year; + pCalcSet->SetNullDate(aDate); + } } } } |