chart2/qa/extras/chart2export3.cxx | 11 +++++++++++ chart2/qa/extras/data/pptx/tdf148117.pptx |binary oox/source/export/chartexport.cxx | 13 +++++++++---- 3 files changed, 20 insertions(+), 4 deletions(-)
New commits: commit 35f6b0cd1b8f54cb1a2df71b16ea9b76f3257ed1 Author: Markus Mohrhard <[email protected]> AuthorDate: Mon Jul 14 21:01:18 2025 +0800 Commit: Andras Timar <[email protected]> CommitDate: Sat Jul 26 13:11:02 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 <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188396 Reviewed-by: Andras Timar <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> 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 7c7b0ed9c17a..3bc992024911 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1081,6 +1081,15 @@ void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument FSNS( XML_xmlns, XML_r ), pFB->getNamespaceURL(OOX_NS(officeRel))); } + if( !bIncludeTable ) + { + // TODO:external data + } + else + { + pFS->singleElement(FSNS(XML_c, XML_date1904), XML_val, "0"); + } + // TODO: get the correct editing language if (bIsChartex) { // chartData @@ -1096,10 +1105,6 @@ void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument pFS->singleElement(FSNS(XML_c, XML_roundedCorners), XML_val, "0"); } - if( !bIncludeTable ) - { - // TODO:external data - } //XML_chart exportChart(xChartDoc, bIsChartex);
