chart2/qa/extras/chart2export3.cxx | 11 +++++++++++ chart2/qa/extras/data/pptx/tdf148117.pptx |binary oox/source/export/chartexport.cxx | 14 ++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-)
New commits: commit 91ef28affff4523fc304ea1db03b96f02868334b Author: Markus Mohrhard <markus.mohrh...@googlemail.com> AuthorDate: Mon Jul 14 21:01:18 2025 +0800 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Jul 15 13:06:09 2025 +0200 tdf#148117: always export date chart axis with 1900 null date We currently don't support the import of the 1904 setting correctly and internally always use the 1900 reference. We should fix the import as well and then use the correct export. Change-Id: Idd69cf086d1dee14b92cebeeb1c51ece158a2955 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187834 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187897 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187900 diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx index 2f8c06f620f9..627ee808c3fc 100644 --- a/chart2/qa/extras/chart2export3.cxx +++ b/chart2/qa/extras/chart2export3.cxx @@ -881,6 +881,17 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testODSFormattedChartTitles) checkCharacterProps(xTitleProp); } +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148117) +{ + // The document contains a line chart with "Between tick marks" X axis position. + loadFromFile(u"pptx/tdf148117.pptx"); + // Check formatted strings after export. + save(u"Impress MS PowerPoint 2007 XML"_ustr); + + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); + assertXPath(pXmlDoc, "/c:chartSpace/c:date1904", "val", u"0"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/data/pptx/tdf148117.pptx b/chart2/qa/extras/data/pptx/tdf148117.pptx new file mode 100644 index 000000000000..1c78f26d4168 Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf148117.pptx differ diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 7020c1afe060..d177c5c86fb1 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -945,15 +945,21 @@ void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument FSNS( XML_xmlns, XML_c ), pFB->getNamespaceURL(OOX_NS(dmlChart)), FSNS( XML_xmlns, XML_a ), pFB->getNamespaceURL(OOX_NS(dml)), FSNS( XML_xmlns, XML_r ), pFB->getNamespaceURL(OOX_NS(officeRel))); - // TODO: get the correct editing language - pFS->singleElement(FSNS(XML_c, XML_lang), XML_val, "en-US"); - - pFS->singleElement(FSNS(XML_c, XML_roundedCorners), XML_val, "0"); if( !bIncludeTable ) { // TODO:external data } + else + { + pFS->singleElement(FSNS(XML_c, XML_date1904), XML_val, "0"); + } + + // TODO: get the correct editing language + pFS->singleElement(FSNS(XML_c, XML_lang), XML_val, "en-US"); + + pFS->singleElement(FSNS(XML_c, XML_roundedCorners), XML_val, "0"); + //XML_chart exportChart(xChartDoc);