diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-03-08 10:01:51 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-03-08 12:15:03 +0000 |
commit | 366812f72f73c12e5be83d27409272769e9337f2 (patch) | |
tree | 30496d26737dc09a8376168144f4ce4d95ee493d | |
parent | d2cdc92d4a2664ead411a5e848dafaf559ba47ce (diff) |
UnoApiXmlTest: remove workaround to handle chart file names in tests
No longer needed after 269585d6b461b565fe75f77b6dbf219749edc5ab
"oox, sd: fix ever-increasing chart IDs when exporting to PPTX"
and b27b250f70f4651d387ef0646a9668950371e779
"sc: fix ever-increasing chart IDs when exporting to XLSX"
Also restored the documents modified in d913584909c2e0a235546a5f800baf45c3446d8b
"UnoApiXmlTest: merge parseExport from ChartTest" to ensure
only one chart was possible per document. Sample documents in unittests
can have more than one chart now, since the chart file name wouldn't
change
Kudos to Miklos Vajna for fixing the chart file names when exporting them
Change-Id: I10e2c44e41953a2d0d08bbb2a813134861e74660
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148461
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 70 | ||||
-rw-r--r-- | chart2/qa/extras/chart2export2.cxx | 130 | ||||
-rw-r--r-- | chart2/qa/extras/chart2export3.cxx | 86 | ||||
-rw-r--r-- | chart2/qa/extras/chart2geometry.cxx | 10 | ||||
-rw-r--r-- | chart2/qa/extras/data/docx/MSO_axis_position.docx | bin | 28027 -> 41444 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/MSO_axis_position_2.docx | bin | 26074 -> 0 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/testExternalData.docx | bin | 24082 -> 0 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/testMultipleChart.docx | bin | 0 -> 47534 bytes | |||
-rw-r--r-- | test/source/unoapixml_test.cxx | 47 |
9 files changed, 148 insertions, 195 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 166f9ccdd5d8..f89c391124bb 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -232,7 +232,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarPropXLSX) { loadFromURL(u"xlsx/testErrorBarProp.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test y error bars property @@ -315,7 +315,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart) loadFromURL(u"docx/testStockChart.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1"); @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChart) { loadFromURL(u"docx/testBarChart.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir", "val", "col"); @@ -342,7 +342,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses) { loadFromURL(u"docx/Bar_horizontal_cone.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero"); } @@ -350,7 +350,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses) { loadFromURL(u"xlsx/tdf142351.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crossesAt", "val", "-50"); @@ -400,7 +400,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterChartTextXValues) // Test the export. save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal[1]/c:numRef[1]/c:numCache[1]/c:pt[1]/c:v[1]", "1"); @@ -411,7 +411,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisValues) loadFromURL(u"odt/tdf114657.odt"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:ptCount", "val", "5"); @@ -426,7 +426,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisCategories) loadFromURL(u"odt/tdf131143.odt"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:ptCount", "val", "4"); assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[1]/c:v", "Row 1"); @@ -438,7 +438,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable) loadFromURL(u"docx/testChartDataTable.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder", "val", "1"); @@ -447,10 +447,10 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartExternalData) { - loadFromURL(u"docx/testExternalData.docx"); + loadFromURL(u"docx/testMultipleChart.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:externalData"); } @@ -502,7 +502,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAreaChartLoad) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:showVal", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:dLbl", 0); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars) { loadFromURL(u"docx/UpDownBars.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars", 0); } @@ -521,7 +521,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart) { loadFromURL(u"docx/doughnutChart.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart"); @@ -531,7 +531,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits) { loadFromURL(u"docx/DisplayUnits.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:dispUnits/c:builtInUnit", "val", "billions"); @@ -541,7 +541,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill) { loadFromURL(u"docx/fdo74115_WallGradientFill.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"); @@ -551,7 +551,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallBitmapFill) { loadFromURL(u"docx/fdo74115_WallBitmapFill.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"); } @@ -564,7 +564,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill"); } @@ -575,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX) { loadFromURL(u"docx/fdo78290_Line_Chart_Marker_x.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x"); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7"); @@ -587,7 +587,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX) { loadFromURL(u"docx/fdo78290_Scatter_Chart_Marker_x.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x"); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:scatterChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7"); @@ -600,7 +600,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290CombinationChartMarkerX) { loadFromURL(u"docx/fdo78290_Combination_Chart_Marker_x.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:symbol[1]","val","x"); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:marker[1]/c:size[1]","val","7"); @@ -611,7 +611,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTdf126115IndividualMarker) // Check individual marker properties. loadFromURL(u"xlsx/tdf126115.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // 1. series assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:dPt/c:marker/c:symbol", "val", "square"); @@ -855,7 +855,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabel3DChartDOCX) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for 3D bar charts. The @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBarChartDOCX) CPPUNIT_ASSERT(xChartDoc.is()); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos", "val", "ctr"); @@ -891,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelClusteredBarChartDOCX) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // This was "t", should be one of the allowed values. @@ -906,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelRadarChartDOCX) CPPUNIT_ASSERT(xChartDoc.is()); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for radar charts. @@ -925,7 +925,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDoughnutChartDOCX) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for doughnut charts. @@ -944,7 +944,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelAreaChartDOCX) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for area charts. @@ -983,7 +983,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr", "b", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1600"); @@ -995,7 +995,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChartRotation) { loadFromURL(u"docx/barChartRotation.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", "30"); @@ -1032,7 +1032,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", "outEnd"); } @@ -1041,7 +1041,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSeriesIdxOrder) { loadFromURL(u"docx/testSeriesIdxOrder.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:idx[1]", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:order[1]", "val", "1"); @@ -1112,7 +1112,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash) { loadFromURL(u"docx/FDO75975.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); } @@ -1120,7 +1120,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartRotation) { loadFromURL(u"docx/pieChartRotation.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", "40"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotY", "val", "30"); @@ -1224,7 +1224,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSmoothedLines) { loadFromURL(u"ods/smoothedLines.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:smooth", "val", "0"); } diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index bedc7904bf87..06e1333f5164 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -51,7 +51,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testSetSeriesToSecondaryAxisXLSX) xPropSet->setPropertyValue("AttachedAxisIndex", uno::Any(AxisIndex)); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Check there are only two <lineChart> tag in the XML, one for the primary and one for the secondary axis. assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2); @@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisXLSX) // Original file was created with MS Office loadFromURL(u"xlsx/combined_chart_secondary_axis.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis OUString XValueIdOfBarchart @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisODS) // Original file was created with LibreOffice loadFromURL(u"ods/combined_chart_secondary_axis.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis OUString XValueIdOfBarchart @@ -124,7 +124,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenXLSX) { loadFromURL(u"xlsx/tdf127777.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -132,7 +132,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenXLSX) { loadFromURL(u"xlsx/tdf132076.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenWithDeletedAxis) // Original file was created with MS Office (the category axis is deleted in the file) loadFromURL(u"xlsx/tdf128633.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -155,7 +155,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenODS) // Original file was created with LibreOffice loadFromURL(u"ods/test_CrossBetween.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -165,7 +165,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitleRotationXLSX) { loadFromURL(u"xlsx/axis_title_rotation.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:tx/c:rich/a:bodyPr", @@ -176,7 +176,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitlePositionDOCX) { loadFromURL(u"docx/testAxisTitlePosition.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test X Axis title position @@ -213,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisCrossBetweenDOCX) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", "midCat"); } @@ -221,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testPieChartDataPointExplosionXLSX) { loadFromURL(u"xlsx/pie_chart_datapoint_explosion.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dPt/c:explosion", @@ -340,7 +340,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel) CPPUNIT_ASSERT_EQUAL(OUString(" <CELLREF"), aFields[1]->getString()); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Check the data labels font color for the complete data series assertXPath(pXmlDoc, @@ -389,7 +389,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel) loadFromURL(u"xlsx/testCustomPosDataLabels.xlsx"); { save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test custom position of data label (xlsx) @@ -414,7 +414,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel) loadFromURL(u"docx/testTdf108110.docx"); { save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test custom position of data label (docx) @@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines) loadFromURL(u"xlsx/testTdf90749.xlsx"); { save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/" @@ -540,7 +540,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines) loadFromURL(u"docx/MSO_Custom_Leader_Line.docx"); { save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // tdf#134571: Check the leader line is switch off. assertXPath(pXmlDoc, @@ -554,7 +554,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNumberFormatExportPPTX) { loadFromURL(u"pptx/tdf115859.pptx"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt", @@ -571,7 +571,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLabelSeparatorExportDOCX) CPPUNIT_ASSERT(xChartDoc.is()); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // The text separator should be a new line @@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesColorFillPPTX) { loadFromURL(u"pptx/testChartTitlePropertiesColorFill.pptx"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000"); @@ -600,7 +600,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesGradientFillPPTX { loadFromURL(u"pptx/testChartTitlePropertiesGradientFill.pptx"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", @@ -615,7 +615,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesBitmapFillPPTX) { loadFromURL(u"pptx/testChartTitlePropertiesBitmapFill.pptx"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", "rId1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1); @@ -625,7 +625,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testxAxisLabelsRotation) { loadFromURL(u"xlsx/xAxisLabelsRotation.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc1); // Chart1 xAxis labels should be 45 degree @@ -637,7 +637,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesXLSX) { loadFromURL(u"ods/multilevelcat.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level assertXPath(pXmlDoc, @@ -670,7 +670,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesDOCX) { loadFromURL(u"odt/multilevelcat.odt"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level assertXPath(pXmlDoc, @@ -703,7 +703,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf116163) { loadFromURL(u"pptx/tdf116163.pptx"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", @@ -714,7 +714,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf111824) { loadFromURL(u"xlsx/tdf111824.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Collect 3D barchart Z axID @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, test3DAreaChartZAxis) { loadFromURL(u"xlsx/test3DAreaChartZAxis.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Collect 3D area chart Z axID @@ -745,7 +745,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf119029) loadFromURL(u"odp/tdf119029.odp"); // Only use "chart", without number, because the number depends on the previous tests save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -769,7 +769,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121744) { loadFromURL(u"docx/tdf121744.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); OUString XValueId @@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf122031) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", @@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf115012) { loadFromURL(u"xlsx/tdf115012.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // workaround: use-zero instead of leave-gap to show the original line chart assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "zero"); @@ -837,7 +837,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134118) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // workaround: use leave-gap instead of zero to show the original line chart assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap"); @@ -854,7 +854,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123206_customLabelText) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, @@ -874,7 +874,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomLabelText) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -945,7 +945,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf60316) { loadFromURL(u"pptx/tdf60316.pptx"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Without the fix in place, the shape would have had a solidFill background @@ -972,7 +972,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf59857) { loadFromURL(u"ods/tdf59857.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:ln/a:noFill", 1); @@ -987,7 +987,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf126076) { loadFromURL(u"xlsx/auto_marker_excel10.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // This was 12: all series exported with square markers @@ -1025,23 +1025,17 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf75330) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf127792) { - { - loadFromURL(u"docx/MSO_axis_position.docx"); - save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); - CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", - "between"); - } + loadFromURL(u"docx/MSO_axis_position.docx"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", + "between"); - { - loadFromURL(u"docx/MSO_axis_position_2.docx"); - save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); - CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", - "midCat"); - } + pXmlDoc = parseExport("word/charts/chart2.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", + "midCat"); } CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf131979) @@ -1087,7 +1081,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076) { loadFromURL(u"ods/tdf132076.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "formatCode", "dd"); @@ -1097,7 +1091,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076) { loadFromURL(u"xlsx/tdf132076.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "formatCode", "dd"); @@ -1110,7 +1104,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf125812) { loadFromURL(u"odp/ellipticalGradientFill.odp"); save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path", "path", "circle"); @@ -1132,7 +1126,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133190) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Test word wrap of data point label @@ -1154,7 +1148,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133191) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Test rotation of data point label @@ -1168,7 +1162,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132594) { loadFromURL(u"xlsx/chart_pie2007.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1); @@ -1193,7 +1187,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134255) // export test save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -1223,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134977) //export test save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:tx/c:rich/a:p/" @@ -1235,7 +1229,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123647) { loadFromURL(u"xlsx/empty_chart.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart", 1); @@ -1249,7 +1243,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf136267) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent( @@ -1282,7 +1276,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf137917) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:baseTimeUnit", "val", "days"); @@ -1352,7 +1346,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138204) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Check the first data label field type @@ -1497,7 +1491,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNameRangeXLSX) { loadFromURL(u"xlsx/chart_with_name_range.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test the syntax of local range name on the local sheet. assertXPathContent(pXmlDoc, @@ -1546,7 +1540,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf143942) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext", @@ -1586,7 +1580,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDateCategoriesPPTX) skipValidation(); save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); constexpr size_t nCats = 16; diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx index fd888c43d54e..05dbdc48c41b 100644 --- a/chart2/qa/extras/chart2export3.cxx +++ b/chart2/qa/extras/chart2export3.cxx @@ -44,7 +44,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107) skipValidation(); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:p/a:pPr/a:defRPr", "b", "1"); @@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139) { loadFromURL(u"xlsx/tdf114139.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart", 1); @@ -68,7 +68,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224) { loadFromURL(u"ods/tdf64224.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); //no fill @@ -80,7 +80,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX) { loadFromURL(u"docx/testChartTitlePropertiesColorFill.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1); @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX { loadFromURL(u"docx/testChartTitlePropertiesGradientFill.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "cccccc"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "666666"); @@ -101,7 +101,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillDOCX) { loadFromURL(u"docx/testChartTitlePropertiesBitmapFill.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", "rId1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1); @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyDOCX) // Test color gradient (two color) with gradient transparency loadFromURL(u"docx/testColorGradientWithTransparency.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Test the transparency of the first color assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000"); @@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyODS) // Test color gradient (two color) with simple transparency loadFromURL(u"ods/testColorGradientWithTransparency.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Test the transparency of the first color assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000"); @@ -139,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX) // Test color gradient (two color) stop of the first color loadFromURL(u"xlsx/tdf128619.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Test the position of the first color assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:spPr/a:gradFill/a:gsLst/a:gs[1]", "pos", "45000"); @@ -151,7 +151,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX) { loadFromURL(u"docx/tdf128794.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Test the gradient style (if there is no 'a:path' attribute, it is a linear gradient) assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path", 0); @@ -163,7 +163,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropDOCX) { loadFromURL(u"docx/testBarChartDataPointPropDOCX.docx"); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -186,7 +186,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos) skipValidation(); save("Office Open XML Text"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[2]/c:dLblPos", "val", "outEnd"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls[1]/c:dLbl[3]/c:dLblPos", "val", "outEnd"); @@ -198,7 +198,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX) { loadFromURL(u"xlsx/autotitledel_2007.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "0"); } @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX) { loadFromURL(u"xlsx/dispBlanksAs_2007.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap"); } @@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX) { loadFromURL(u"xlsx/markerColor.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", "92d050"); } @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX) { loadFromURL(u"xlsx/markerColor.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners", "val", "0"); } @@ -234,7 +234,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisNumberFormatXLSX) { loadFromURL(u"ods/axis_number_format.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx", 2); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx[1]/c:numFmt", "formatCode", "0.00E+000"); @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) loadFromURL(u"ods/tdf123774.ods"); { save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "formatCode", "[$-40E]0.00%"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "sourceLinked", "0"); @@ -264,7 +264,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) loadFromURL(u"xlsx/tdf130986.xlsx"); { save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:idx", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:numFmt", "formatCode", "0.00E+00"); @@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelDefaultValuesXLSX) CPPUNIT_ASSERT(aLabel.ShowNumber); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:showVal", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLblPos", "val", "outEnd"); @@ -301,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor) CPPUNIT_ASSERT(aAny >>= nLabelFillColor); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:spPr/a:solidFill/a:srgbClr", "val", "F79646"); } @@ -310,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX) { loadFromURL(u"xlsx/chart_title.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", "0"); } @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX) { loadFromURL(u"xlsx/bar_chart_simple.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", "0"); } @@ -328,7 +328,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX) { loadFromURL(u"xlsx/bubble_chart_simple.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[1]/c:bubble3D", "val", "0"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[2]/c:bubble3D", "val", "0"); @@ -339,7 +339,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX) { loadFromURL(u"xlsx/no_marker.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:marker/c:symbol", "val", "none"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:marker/c:symbol", "val", "none"); @@ -350,7 +350,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX) { loadFromURL(u"xlsx/title_manual_layout.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:layoutTarget", 0); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:xMode", "val", "edge"); @@ -374,7 +374,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX) { loadFromURL(u"xlsx/plot_area_manual_layout.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", "val", "inner"); @@ -408,7 +408,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testLegendManualLayoutXLSX) { loadFromURL(u"xlsx/legend_manual_layout.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", 0); @@ -445,7 +445,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle) { loadFromURL(u"ods/testChartSubTitle.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test properties of subtitle assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", "1100"); @@ -460,7 +460,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle) { loadFromURL(u"ods/testChartMainWithSubTitle.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // test properties of title assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", "1300"); @@ -476,7 +476,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted) { loadFromURL(u"xlsx/testAutoTitleDeleted.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "1"); } @@ -485,7 +485,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX) { loadFromURL(u"xlsx/testChartTitlePropertiesColorFill.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1); @@ -495,7 +495,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX { loadFromURL(u"xlsx/testChartTitlePropertiesGradientFill.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "cccccc"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "666666"); @@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX) { loadFromURL(u"xlsx/testChartTitlePropertiesBitmapFill.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", "rId1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1); @@ -516,7 +516,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX) { loadFromURL(u"xlsx/testBarChartDataPointPropXLSX.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -594,7 +594,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) { loadFromURL(u"xlsx/axis_character_properties.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1000"); @@ -612,7 +612,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX) { loadFromURL(u"xlsx/title_character_properties.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", "2400"); @@ -626,7 +626,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX) { loadFromURL(u"xlsx/hidden_cells.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly", "val", "0"); @@ -636,7 +636,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX) { loadFromURL(u"xlsx/tdf90876.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -646,7 +646,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf96161) { loadFromURL(u"ods/tdf96161.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors", "val", "0"); @@ -676,7 +676,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) { loadFromURL(u"ods/multiple_axis.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart", 2); @@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX) { loadFromURL(u"ods/secondary_axis.ods"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2); @@ -709,7 +709,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartSecondaryAxisXLSX) { loadFromURL(u"xlsx/testSecondaryAxis.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on primary Axis OUString XValueIdOf1Barchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart[1]/c:axId[1]", "val"); diff --git a/chart2/qa/extras/chart2geometry.cxx b/chart2/qa/extras/chart2geometry.cxx index 2cd09b333a3b..4dcdfa0f3125 100644 --- a/chart2/qa/extras/chart2geometry.cxx +++ b/chart2/qa/extras/chart2geometry.cxx @@ -144,7 +144,7 @@ void Chart2GeometryTest::testTdf135184RoundLineCap3() // It tests chart area, data series line and regression-curve line. loadFromURL(u"xlsx/tdf135184RoundLineCap.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); const OString sDash("/c:spPr/a:ln/a:prstDash"); @@ -162,7 +162,7 @@ void Chart2GeometryTest::testTdf135184RoundLineCap4() // It tests legend, data series sector and title. loadFromURL(u"xlsx/tdf135184RoundLineCap2.xlsx"); save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); const OString sChartStart("/c:chartSpace/c:chart"); @@ -181,7 +181,7 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_export() // Make sure the chart area has a transparency in gradient stops in saved pptx file. save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); OString sPathStart("//c:chartSpace/c:spPr/a:gradFill"); @@ -236,7 +236,7 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_export() // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); OString sPathStart("//c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"); @@ -288,7 +288,7 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_export() // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. save("Impress MS PowerPoint 2007 XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1.xml"); CPPUNIT_ASSERT(pXmlDoc); OString sPathStart("//c:chartSpace/c:chart/c:legend/c:spPr/a:gradFill"); diff --git a/chart2/qa/extras/data/docx/MSO_axis_position.docx b/chart2/qa/extras/data/docx/MSO_axis_position.docx Binary files differindex a316cfee9319..a9955b7b1ad7 100644 --- a/chart2/qa/extras/data/docx/MSO_axis_position.docx +++ b/chart2/qa/extras/data/docx/MSO_axis_position.docx diff --git a/chart2/qa/extras/data/docx/MSO_axis_position_2.docx b/chart2/qa/extras/data/docx/MSO_axis_position_2.docx Binary files differdeleted file mode 100644 index 85fd3077c12e..000000000000 --- a/chart2/qa/extras/data/docx/MSO_axis_position_2.docx +++ /dev/null diff --git a/chart2/qa/extras/data/docx/testExternalData.docx b/chart2/qa/extras/data/docx/testExternalData.docx Binary files differdeleted file mode 100644 index 20ae7e3d1f53..000000000000 --- a/chart2/qa/extras/data/docx/testExternalData.docx +++ /dev/null diff --git a/chart2/qa/extras/data/docx/testMultipleChart.docx b/chart2/qa/extras/data/docx/testMultipleChart.docx Binary files differnew file mode 100644 index 000000000000..28d8bbcfe143 --- /dev/null +++ b/chart2/qa/extras/data/docx/testMultipleChart.docx diff --git a/test/source/unoapixml_test.cxx b/test/source/unoapixml_test.cxx index c80ceb616665..23dc826cbc97 100644 --- a/test/source/unoapixml_test.cxx +++ b/test/source/unoapixml_test.cxx @@ -11,13 +11,9 @@ #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XStorable.hpp> -#include <com/sun/star/packages/zip/ZipFileAccess.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> -#include <o3tl/string_view.hxx> -#include <unotools/ucbstreamhelper.hxx> - #include <sfx2/app.hxx> #include <sfx2/objsh.hxx> #include <utility> @@ -32,46 +28,9 @@ UnoApiXmlTest::UnoApiXmlTest(OUString path) xmlDocUniquePtr UnoApiXmlTest::parseExport(OUString const& rStreamName) { - if (rStreamName.indexOf("chart") == -1) - { - std::unique_ptr<SvStream> const pStream( - parseExportStream(maTempFile.GetURL(), rStreamName)); - xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get()); - return pXmlDoc; - } - else - { - // we have a static counter that increments chart export file names. So - // only the first exported file gets the file name chart1.xml and all the - // following charts are incremented by one even if they are in a different file. - OUString aStreamName(rStreamName); - uno::Reference<packages::zip::XZipFileAccess2> xNameAccess - = packages::zip::ZipFileAccess::createWithURL( - comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); - const uno::Sequence<OUString> aNames = xNameAccess->getElementNames(); - - if (aStreamName.endsWith(".xml")) - // remove "1.xml" - aStreamName = aStreamName.copy(0, aStreamName.getLength() - 5); - - uno::Reference<io::XInputStream> xInputStream; - - int nCount = 0; - for (const auto& rElementName : aNames) - { - if (o3tl::starts_with(rElementName, aStreamName)) - { - xInputStream.set(xNameAccess->getByName(rElementName), uno::UNO_QUERY); - ++nCount; - assert(nCount == 1 && "Only use one chart per document"); - } - } - - CPPUNIT_ASSERT(xInputStream.is()); - std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); - - return parseXmlStream(pStream.get()); - } + std::unique_ptr<SvStream> const pStream(parseExportStream(maTempFile.GetURL(), rStreamName)); + xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get()); + return pXmlDoc; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |