From f6437b3a98256cd2782164fedefbc109bf5ab114 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Wed, 6 Nov 2019 15:50:32 +0100 Subject: tdf#128618 OOXML chart export: deleted automatic title returns on save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there is no main title and/or subtitle, write out autoTitleDeleted with a true value. Regression from the commit 96a29c12a9d8734c9d2a812f38fc6654b5df9c48 (tdf#101322 Chart OOXML Export: fix missing subtitle) Change-Id: I0094014fc4da4cb66d31e4249f916452d00758c7 Reviewed-on: https://gerrit.libreoffice.org/82142 Reviewed-by: László Németh Tested-by: László Németh --- chart2/qa/extras/chart2export.cxx | 10 ++++++++++ chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx | Bin 0 -> 15097 bytes 2 files changed, 10 insertions(+) create mode 100644 chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx (limited to 'chart2') diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index dd07808b1d05..4d14a1e96638 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -108,6 +108,7 @@ public: void testLegendManualLayoutXLSX(); void testChartSubTitle(); void testChartMainWithSubTitle(); + void testAutoTitleDeleted(); void testChartTitlePropertiesColorFillXLSX(); void testChartTitlePropertiesGradientFillXLSX(); void testChartTitlePropertiesBitmapFillXLSX(); @@ -217,6 +218,7 @@ public: CPPUNIT_TEST(testLegendManualLayoutXLSX); CPPUNIT_TEST(testChartSubTitle); CPPUNIT_TEST(testChartMainWithSubTitle); + CPPUNIT_TEST(testAutoTitleDeleted); CPPUNIT_TEST(testChartTitlePropertiesColorFillXLSX); CPPUNIT_TEST(testChartTitlePropertiesGradientFillXLSX); CPPUNIT_TEST(testChartTitlePropertiesBitmapFillXLSX); @@ -1732,6 +1734,14 @@ void Chart2ExportTest::testChartMainWithSubTitle() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "81d41a"); } +void Chart2ExportTest::testAutoTitleDeleted() +{ + load("/chart2/qa/extras/data/xlsx/", "testAutoTitleDeleted.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "1"); +} + void Chart2ExportTest::testChartTitlePropertiesColorFillXLSX() { load("/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesColorFill.xlsx"); diff --git a/chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx b/chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx new file mode 100644 index 000000000000..409389e23beb Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testAutoTitleDeleted.xlsx differ -- cgit