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 00c259068e75991cc2dacd42e3a5c84837c526e5
Author:     Markus Mohrhard <markus.mohrh...@googlemail.com>
AuthorDate: Mon Jul 14 21:01:18 2025 +0800
Commit:     Markus Mohrhard <markus.mohrh...@googlemail.com>
CommitDate: Tue Jul 15 08:52:14 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>

diff --git a/chart2/qa/extras/chart2export3.cxx 
b/chart2/qa/extras/chart2export3.cxx
index dddce1ada490..bf0f5e15432a 100644
--- a/chart2/qa/extras/chart2export3.cxx
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -885,6 +885,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 3218141713e9..1ee209f8ce16 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1312,6 +1312,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
@@ -1340,10 +1349,6 @@ void ChartExport::exportChartSpace( const Reference< 
css::chart::XChartDocument
         }
     }
 
-    if( !bIncludeTable )
-    {
-        // TODO:external data
-    }
     //XML_chart
     exportChart(xChartDoc, bIsChartex);
 

Reply via email to