diff options
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 107 | ||||
-rw-r--r-- | chart2/qa/extras/chart2export2.cxx | 166 | ||||
-rw-r--r-- | chart2/qa/extras/chart2export3.cxx | 129 | ||||
-rw-r--r-- | chart2/qa/extras/chart2geometry.cxx | 45 | ||||
-rw-r--r-- | chart2/qa/extras/charttest.hxx | 60 | ||||
-rw-r--r-- | chart2/qa/extras/data/docx/MSO_axis_position.docx | bin | 41444 -> 28027 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/MSO_axis_position_2.docx | bin | 0 -> 26074 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/testExternalData.docx | bin | 0 -> 24082 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/docx/testMultipleChart.docx | bin | 47534 -> 0 bytes | |||
-rw-r--r-- | chart2/qa/extras/data/xlsx/chart_pie2007.xlsx | bin | 11299 -> 9091 bytes |
10 files changed, 298 insertions, 209 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index a5ccc4b7e65a..1f0c110b9f0f 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -231,7 +231,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarPropXLSX) { loadFromURL(u"xlsx/testErrorBarProp.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // test y error bars property @@ -313,7 +314,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart) */ loadFromURL(u"docx/testStockChart.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1"); @@ -327,7 +329,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChart) { loadFromURL(u"docx/testBarChart.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir", "val", "col"); @@ -338,14 +341,16 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses) // test crosses val="autoZero" with DOCX { loadFromURL(u"docx/Bar_horizontal_cone.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero"); } // tdf#142351: test crossesAt val="-50" with XLSX { loadFromURL(u"xlsx/tdf142351.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crossesAt", "val", "-50"); @@ -394,7 +399,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterChartTextXValues) CPPUNIT_ASSERT_EQUAL(5.0, aYValues[2][3]); // Test the export. - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -404,7 +410,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisValues) { loadFromURL(u"odt/tdf114657.odt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:ptCount", "val", "5"); @@ -418,7 +425,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisCategories) { loadFromURL(u"odt/tdf131143.odt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -429,7 +437,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable) { loadFromURL(u"docx/testChartDataTable.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -438,9 +447,10 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartExternalData) { - loadFromURL(u"docx/testMultipleChart.docx"); + loadFromURL(u"docx/testExternalData.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:externalData"); } @@ -491,7 +501,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAreaChartLoad) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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); @@ -501,7 +512,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars) { /* load("/chart2/qa/extras/data/docx/", "UpDownBars.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars"); */ @@ -510,7 +522,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart) { loadFromURL(u"docx/doughnutChart.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart"); @@ -519,7 +532,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits) { loadFromURL(u"docx/DisplayUnits.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + 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:dispUnits/c:builtInUnit", "val", "billions"); @@ -528,7 +542,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill) { loadFromURL(u"docx/fdo74115_WallGradientFill.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"); @@ -537,7 +552,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallBitmapFill) { loadFromURL(u"docx/fdo74115_WallBitmapFill.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"); } @@ -549,7 +565,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle) // FIXME: validation error in OOXML export: Errors: 9 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill"); } @@ -559,7 +576,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX) { loadFromURL(u"docx/fdo78290_Line_Chart_Marker_x.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -570,7 +588,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX) { loadFromURL(u"docx/fdo78290_Scatter_Chart_Marker_x.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -582,7 +601,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290CombinationChartMarkerX) { loadFromURL(u"docx/fdo78290_Combination_Chart_Marker_x.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -592,7 +612,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTdf126115IndividualMarker) { // Check individual marker properties. loadFromURL(u"xlsx/tdf126115.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -835,7 +856,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabel3DChartDOCX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for 3D bar charts. The @@ -851,7 +873,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBarChartDOCX) Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos", "val", "ctr"); @@ -869,7 +892,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelClusteredBarChartDOCX) // FIXME: validation error in OOXML export: Errors: 9 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // This was "t", should be one of the allowed values. @@ -883,7 +907,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelRadarChartDOCX) Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for radar charts. @@ -901,7 +926,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDoughnutChartDOCX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for doughnut charts. @@ -919,7 +945,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelAreaChartDOCX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for area charts. @@ -957,7 +984,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -968,7 +996,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChartRotation) { loadFromURL(u"docx/barChartRotation.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", "30"); @@ -987,7 +1016,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testShapeFollowedByChart) // FIXME: validation error in OOXML export: Errors: 5 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/document", "Office Open XML Text" ); + save("Office Open XML Text" ); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); OUString aValueOfFirstDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing[1]/wp:inline[1]/wp:docPr[1]", "id"); @@ -1003,7 +1033,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels) // FIXME: validation error in OOXML export: Errors: 19 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); } @@ -1011,7 +1042,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSeriesIdxOrder) { loadFromURL(u"docx/testSeriesIdxOrder.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -1081,14 +1113,16 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarDataRangeODS) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash) { loadFromURL(u"docx/FDO75975.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); } CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartRotation) { loadFromURL(u"docx/pieChartRotation.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -1191,7 +1225,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testGapWidthXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSmoothedLines) { loadFromURL(u"ods/smoothedLines.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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 f56a0782feca..6ae3361df201 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -182,7 +182,8 @@ void Chart2ExportTest2::testSetSeriesToSecondaryAxisXLSX() // Attach the second series to the secondary axis. (The third series is already attached.) xPropSet->setPropertyValue("AttachedAxisIndex", uno::Any(AxisIndex)); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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); @@ -192,7 +193,8 @@ void Chart2ExportTest2::testCombinedChartSecondaryAxisXLSX() { // Original file was created with MS Office loadFromURL(u"xlsx/combined_chart_secondary_axis.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis OUString XValueIdOfBarchart @@ -219,7 +221,8 @@ void Chart2ExportTest2::testCombinedChartSecondaryAxisODS() { // Original file was created with LibreOffice loadFromURL(u"ods/combined_chart_secondary_axis.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis OUString XValueIdOfBarchart @@ -252,14 +255,16 @@ void Chart2ExportTest2::testCrossBetweenXLSX() // Original files were created with MS Office { loadFromURL(u"xlsx/tdf127777.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); } { loadFromURL(u"xlsx/tdf132076.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -270,7 +275,8 @@ void Chart2ExportTest2::testCrossBetweenWithDeletedAxis() { // Original file was created with MS Office (the category axis is deleted in the file) loadFromURL(u"xlsx/tdf128633.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -280,7 +286,8 @@ void Chart2ExportTest2::testCrossBetweenODS() { // Original file was created with LibreOffice loadFromURL(u"ods/test_CrossBetween.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); @@ -289,7 +296,8 @@ void Chart2ExportTest2::testCrossBetweenODS() void Chart2ExportTest2::testAxisTitleRotationXLSX() { loadFromURL(u"xlsx/axis_title_rotation.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:tx/c:rich/a:bodyPr", @@ -299,7 +307,8 @@ void Chart2ExportTest2::testAxisTitleRotationXLSX() void Chart2ExportTest2::testAxisTitlePositionDOCX() { loadFromURL(u"docx/testAxisTitlePosition.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // test X Axis title position @@ -335,14 +344,16 @@ void Chart2ExportTest2::testAxisCrossBetweenDOCX() // FIXME: validation error in OOXML export: Errors: 3 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", "midCat"); } void Chart2ExportTest2::testPieChartDataPointExplosionXLSX() { loadFromURL(u"xlsx/pie_chart_datapoint_explosion.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dPt/c:explosion", @@ -460,7 +471,8 @@ void Chart2ExportTest2::testCustomDataLabel() aFields[1]->getFieldType()); CPPUNIT_ASSERT_EQUAL(OUString(" <CELLREF"), aFields[1]->getString()); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Check the data labels font color for the complete data series assertXPath(pXmlDoc, @@ -508,7 +520,8 @@ void Chart2ExportTest2::testCustomPositionofDataLabel() loadFromURL(u"xlsx/testCustomPosDataLabels.xlsx"); { - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // test custom position of data label (xlsx) @@ -532,7 +545,8 @@ void Chart2ExportTest2::testCustomPositionofDataLabel() loadFromURL(u"docx/testTdf108110.docx"); { - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // test custom position of data label (docx) @@ -643,7 +657,8 @@ void Chart2ExportTest2::testLeaderLines() loadFromURL(u"xlsx/testTdf90749.xlsx"); { - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/" @@ -656,7 +671,8 @@ void Chart2ExportTest2::testLeaderLines() } loadFromURL(u"docx/MSO_Custom_Leader_Line.docx"); { - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // tdf#134571: Check the leader line is switch off. assertXPath(pXmlDoc, @@ -669,7 +685,8 @@ void Chart2ExportTest2::testLeaderLines() void Chart2ExportTest2::testNumberFormatExportPPTX() { loadFromURL(u"pptx/tdf115859.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt", @@ -685,7 +702,8 @@ void Chart2ExportTest2::testLabelSeparatorExportDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // The text separator should be a new line @@ -702,7 +720,8 @@ void Chart2ExportTest2::testLabelSeparatorExportDOCX() void Chart2ExportTest2::testChartTitlePropertiesColorFillPPTX() { loadFromURL(u"pptx/testChartTitlePropertiesColorFill.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", "ff0000"); @@ -712,7 +731,8 @@ void Chart2ExportTest2::testChartTitlePropertiesColorFillPPTX() void Chart2ExportTest2::testChartTitlePropertiesGradientFillPPTX() { loadFromURL(u"pptx/testChartTitlePropertiesGradientFill.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", @@ -726,7 +746,8 @@ void Chart2ExportTest2::testChartTitlePropertiesGradientFillPPTX() void Chart2ExportTest2::testChartTitlePropertiesBitmapFillPPTX() { loadFromURL(u"pptx/testChartTitlePropertiesBitmapFill.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); 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); @@ -735,7 +756,8 @@ void Chart2ExportTest2::testChartTitlePropertiesBitmapFillPPTX() void Chart2ExportTest2::testxAxisLabelsRotation() { loadFromURL(u"xlsx/xAxisLabelsRotation.xlsx"); - xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc1); // Chart1 xAxis labels should be 45 degree @@ -746,7 +768,8 @@ void Chart2ExportTest2::testxAxisLabelsRotation() void Chart2ExportTest2::testMultipleCategoryAxisLablesXLSX() { loadFromURL(u"ods/multilevelcat.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level assertXPath(pXmlDoc, @@ -778,7 +801,8 @@ void Chart2ExportTest2::testMultipleCategoryAxisLablesXLSX() void Chart2ExportTest2::testMultipleCategoryAxisLablesDOCX() { loadFromURL(u"odt/multilevelcat.odt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level assertXPath(pXmlDoc, @@ -810,7 +834,8 @@ void Chart2ExportTest2::testMultipleCategoryAxisLablesDOCX() void Chart2ExportTest2::testTdf116163() { loadFromURL(u"pptx/tdf116163.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", @@ -820,7 +845,8 @@ void Chart2ExportTest2::testTdf116163() void Chart2ExportTest2::testTdf111824() { loadFromURL(u"xlsx/tdf111824.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Collect 3D barchart Z axID @@ -834,7 +860,8 @@ void Chart2ExportTest2::testTdf111824() void Chart2ExportTest2::test3DAreaChartZAxis() { loadFromURL(u"xlsx/test3DAreaChartZAxis.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Collect 3D area chart Z axID @@ -849,7 +876,8 @@ void Chart2ExportTest2::testTdf119029() { loadFromURL(u"odp/tdf119029.odp"); // Only use "chart", without number, because the number depends on the previous tests - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -872,7 +900,8 @@ void Chart2ExportTest2::testTdf108022() void Chart2ExportTest2::testTdf121744() { loadFromURL(u"docx/tdf121744.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); OUString XValueId @@ -905,7 +934,8 @@ void Chart2ExportTest2::testTdf122031() // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", @@ -924,7 +954,8 @@ void Chart2ExportTest2::testTdf122031() void Chart2ExportTest2::testTdf115012() { loadFromURL(u"xlsx/tdf115012.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -937,7 +968,8 @@ void Chart2ExportTest2::testTdf134118() // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -953,7 +985,8 @@ void Chart2ExportTest2::testTdf123206_customLabelText() // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, @@ -972,7 +1005,8 @@ void Chart2ExportTest2::testCustomLabelText() // FIXME: validation error in OOXML export: Errors: 3 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -1042,7 +1076,8 @@ void Chart2ExportTest2::testDeletedLegendEntries() void Chart2ExportTest2::testTdf60316() { loadFromURL(u"pptx/tdf60316.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Without the fix in place, the shape would have had a solidFill background @@ -1068,7 +1103,8 @@ void Chart2ExportTest2::testTdf130225() void Chart2ExportTest2::testTdf59857() { loadFromURL(u"ods/tdf59857.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:ln/a:noFill", 1); @@ -1082,7 +1118,8 @@ void Chart2ExportTest2::testTdf59857() void Chart2ExportTest2::testTdf126076() { loadFromURL(u"xlsx/auto_marker_excel10.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // This was 12: all series exported with square markers @@ -1120,15 +1157,19 @@ void Chart2ExportTest2::testTdf75330() void Chart2ExportTest2::testTdf127792() { - loadFromURL(u"docx/MSO_axis_position.docx"); { - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text"); + 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"); } + { - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart2", "Office Open XML Text"); + 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"); @@ -1177,7 +1218,8 @@ void Chart2ExportTest2::testTdf132076() { loadFromURL(u"ods/tdf132076.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "formatCode", "dd"); @@ -1186,7 +1228,8 @@ void Chart2ExportTest2::testTdf132076() } { loadFromURL(u"xlsx/tdf132076.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "formatCode", "dd"); @@ -1198,7 +1241,8 @@ void Chart2ExportTest2::testTdf132076() void Chart2ExportTest2::testTdf125812() { loadFromURL(u"odp/ellipticalGradientFill.odp"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path", "path", "circle"); @@ -1219,7 +1263,8 @@ void Chart2ExportTest2::testTdf133190() // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Test word wrap of data point label @@ -1240,7 +1285,8 @@ void Chart2ExportTest2::testTdf133191() // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Test rotation of data point label @@ -1253,7 +1299,8 @@ void Chart2ExportTest2::testTdf133191() void Chart2ExportTest2::testTdf132594() { loadFromURL(u"xlsx/chart_pie2007.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1); @@ -1277,7 +1324,8 @@ void Chart2ExportTest2::testTdf134255() skipValidation(); // export test - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -1306,7 +1354,8 @@ void Chart2ExportTest2::testTdf134977() skipValidation(); //export test - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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/" @@ -1317,7 +1366,8 @@ void Chart2ExportTest2::testTdf134977() void Chart2ExportTest2::testTdf123647() { loadFromURL(u"xlsx/empty_chart.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart", 1); @@ -1330,7 +1380,8 @@ void Chart2ExportTest2::testTdf136267() // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent( @@ -1362,7 +1413,8 @@ void Chart2ExportTest2::testTdf137917() // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:baseTimeUnit", "val", "days"); @@ -1431,7 +1483,8 @@ void Chart2ExportTest2::testTdf138204() // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // Check the first data label field type @@ -1575,7 +1628,8 @@ void Chart2ExportTest2::testGraphicBlipXLSX() void Chart2ExportTest2::testNameRangeXLSX() { loadFromURL(u"xlsx/chart_with_name_range.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); // test the syntax of local range name on the local sheet. assertXPathContent(pXmlDoc, @@ -1623,7 +1677,8 @@ void Chart2ExportTest2::testTdf143942() // FIXME: validation error in OOXML export: Errors: 4 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[1]/c:extLst/c:ext", @@ -1662,7 +1717,8 @@ void Chart2ExportTest2::testDateCategoriesPPTX() // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress Office Open XML"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); constexpr size_t nCats = 16; diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx index bdbef4bff2dd..fd888c43d54e 100644 --- a/chart2/qa/extras/chart2export3.cxx +++ b/chart2/qa/extras/chart2export3.cxx @@ -43,7 +43,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -53,7 +54,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139) { loadFromURL(u"xlsx/tdf114139.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart", 1); @@ -65,7 +67,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224) { loadFromURL(u"ods/tdf64224.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); //no fill @@ -76,7 +79,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX) { loadFromURL(u"docx/testChartTitlePropertiesColorFill.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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); @@ -85,7 +89,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX) { loadFromURL(u"docx/testChartTitlePropertiesGradientFill.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -95,7 +100,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillDOCX) { loadFromURL(u"docx/testChartTitlePropertiesBitmapFill.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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); @@ -106,7 +112,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyDOCX) { // Test color gradient (two color) with gradient transparency loadFromURL(u"docx/testColorGradientWithTransparency.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -118,7 +125,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyODS) { // Test color gradient (two color) with simple transparency loadFromURL(u"ods/testColorGradientWithTransparency.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -130,7 +138,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX) { // Test color gradient (two color) stop of the first color loadFromURL(u"xlsx/tdf128619.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -141,7 +150,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX) { loadFromURL(u"docx/tdf128794.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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); @@ -152,7 +162,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropDOCX) { loadFromURL(u"docx/testBarChartDataPointPropDOCX.docx"); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -174,7 +185,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + save("Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart"); 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"); @@ -185,7 +197,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX) { loadFromURL(u"xlsx/autotitledel_2007.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "0"); } @@ -193,7 +206,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX) { loadFromURL(u"xlsx/dispBlanksAs_2007.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap"); } @@ -201,7 +215,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX) { loadFromURL(u"xlsx/markerColor.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); } @@ -209,7 +224,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX) { loadFromURL(u"xlsx/markerColor.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners", "val", "0"); } @@ -217,7 +233,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisNumberFormatXLSX) { loadFromURL(u"ods/axis_number_format.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -234,7 +251,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) loadFromURL(u"ods/tdf123774.ods"); { - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -245,7 +263,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) loadFromURL(u"xlsx/tdf130986.xlsx"); { - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -264,7 +283,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelDefaultValuesXLSX) CPPUNIT_ASSERT(aAny >>= aLabel); CPPUNIT_ASSERT(aLabel.ShowNumber); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -280,7 +300,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor) sal_Int32 nLabelFillColor; CPPUNIT_ASSERT(aAny >>= nLabelFillColor); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); } @@ -288,7 +309,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX) { loadFromURL(u"xlsx/chart_title.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", "0"); } @@ -296,7 +318,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX) { loadFromURL(u"xlsx/bar_chart_simple.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", "0"); } @@ -304,7 +327,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX) { loadFromURL(u"xlsx/bubble_chart_simple.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -314,7 +338,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX) { loadFromURL(u"xlsx/no_marker.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -324,7 +349,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX) { loadFromURL(u"xlsx/title_manual_layout.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -347,7 +373,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX) { loadFromURL(u"xlsx/plot_area_manual_layout.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", "val", "inner"); @@ -380,7 +407,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testLegendManualLayoutXLSX) { loadFromURL(u"xlsx/legend_manual_layout.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", 0); @@ -416,7 +444,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testLegendManualLayoutXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle) { loadFromURL(u"ods/testChartSubTitle.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -430,7 +459,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle) { loadFromURL(u"ods/testChartMainWithSubTitle.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -445,7 +475,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted) { loadFromURL(u"xlsx/testAutoTitleDeleted.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "1"); } @@ -453,7 +484,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX) { loadFromURL(u"xlsx/testChartTitlePropertiesColorFill.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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); @@ -462,7 +494,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX) { loadFromURL(u"xlsx/testChartTitlePropertiesGradientFill.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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"); @@ -472,7 +505,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX) { loadFromURL(u"xlsx/testChartTitlePropertiesBitmapFill.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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); @@ -481,7 +515,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX) { loadFromURL(u"xlsx/testBarChartDataPointPropXLSX.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -558,7 +593,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataseriesOverlapStackedChartXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) { loadFromURL(u"xlsx/axis_character_properties.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1000"); @@ -575,7 +611,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX) { loadFromURL(u"xlsx/title_character_properties.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", "2400"); @@ -588,7 +625,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX) { loadFromURL(u"xlsx/hidden_cells.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly", "val", "0"); @@ -597,7 +635,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX) { loadFromURL(u"xlsx/tdf90876.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -606,7 +645,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf96161) { loadFromURL(u"ods/tdf96161.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors", "val", "0"); @@ -635,7 +675,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTableOnPage3) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) { loadFromURL(u"ods/multiple_axis.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart", 2); @@ -650,7 +691,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX) { loadFromURL(u"ods/secondary_axis.ods"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2); @@ -666,7 +708,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartSecondaryAxisXLSX) { loadFromURL(u"xlsx/testSecondaryAxis.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); 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 bab696a15e9b..2cd09b333a3b 100644 --- a/chart2/qa/extras/chart2geometry.cxx +++ b/chart2/qa/extras/chart2geometry.cxx @@ -85,7 +85,8 @@ void Chart2GeometryTest::testTdf135184RoundLineCap() { // It tests chart area, data series line and regression-curve line. loadFromURL(u"xlsx/tdf135184RoundLineCap.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "calc8"); + save("calc8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); const OString sStyleStart("/office:document-content/office:automatic-styles"); @@ -112,7 +113,8 @@ void Chart2GeometryTest::testTdf135184RoundLineCap2() { // It tests legend, data series sector and title. loadFromURL(u"xlsx/tdf135184RoundLineCap2.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "calc8"); + save("calc8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); const OString sStyleStart("/office:document-content/office:automatic-styles"); @@ -141,7 +143,8 @@ void Chart2GeometryTest::testTdf135184RoundLineCap3() { // It tests chart area, data series line and regression-curve line. loadFromURL(u"xlsx/tdf135184RoundLineCap.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); const OString sDash("/c:spPr/a:ln/a:prstDash"); @@ -158,7 +161,8 @@ void Chart2GeometryTest::testTdf135184RoundLineCap4() { // It tests legend, data series sector and title. loadFromURL(u"xlsx/tdf135184RoundLineCap2.xlsx"); - xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); const OString sChartStart("/c:chartSpace/c:chart"); @@ -176,7 +180,8 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_export() loadFromURL(u"odp/tdf128345_ChartArea_CG_TS.odp"); // Make sure the chart area has a transparency in gradient stops in saved pptx file. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); OString sPathStart("//c:chartSpace/c:spPr/a:gradFill"); @@ -195,7 +200,8 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import() loadFromURL(u"pptx/tdf128345_ChartArea_CG_TS.pptx"); // Find transparency gradient name - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); const OUString sOUChartStyleName = getXPathContent( pXmlDoc, @@ -209,7 +215,8 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import() = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); // Verify the content of the opacity definition - xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml"); CPPUNIT_ASSERT(pXmlDoc2); const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute); @@ -228,7 +235,8 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_export() loadFromURL(u"odp/tdf128345_ChartWall_CS_TG.odp"); // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); OString sPathStart("//c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"); @@ -246,7 +254,8 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_import() loadFromURL(u"pptx/tdf128345_ChartWall_CS_TG.pptx"); // Find transparency gradient name - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); const OUString sOUChartStyleName = getXPathContent(pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/" @@ -260,7 +269,8 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_import() = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); // Verify content of the opacity definition - xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml"); CPPUNIT_ASSERT(pXmlDoc2); const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute); @@ -277,7 +287,8 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_export() loadFromURL(u"odp/tdf128345_Legend_CS_TG_axial.odp"); // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + save("Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart"); CPPUNIT_ASSERT(pXmlDoc); OString sPathStart("//c:chartSpace/c:chart/c:legend/c:spPr/a:gradFill"); @@ -297,7 +308,8 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() loadFromURL(u"pptx/tdf128345_Legend_CS_TG_axial.pptx"); // Find transparency gradient name - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); const OUString sOUChartStyleName = getXPathContent(pXmlDoc, "//office:document-content/office:body/office:chart/chart:chart/" @@ -311,7 +323,8 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); // Verify content of the opacity definition - xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc2 = parseExport("Object 1/styles.xml"); CPPUNIT_ASSERT(pXmlDoc2); const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); const OString sStart("//office:document-styles/office:styles/draw:opacity[" + sAttribute); @@ -415,7 +428,8 @@ void Chart2GeometryTest::testTdf135366LabelExport() // FIXME: Error: unexpected attribute "loext:label-stroke-color" skipValidation(); - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "writer8"); + save("writer8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); // Find label style @@ -442,7 +456,8 @@ void Chart2GeometryTest::testTdf135366_CustomLabelText() const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion(GetODFDefaultVersion()); SetODFDefaultVersion(SvtSaveOptions::ODFVER_012); loadFromURL(u"pptx/tdf135366_CustomLabelText.pptx"); - xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml", "impress8"); + save("impress8"); + xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml"); CPPUNIT_ASSERT(pXmlDoc); // Find custom text. As of version 7.0 it is in a <text:span> element. diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx index ade5011b2b4b..06fda08fe46f 100644 --- a/chart2/qa/extras/charttest.hxx +++ b/chart2/qa/extras/charttest.hxx @@ -26,7 +26,6 @@ #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XStorable.hpp> -#include <com/sun/star/packages/zip/ZipFileAccess.hpp> #include <o3tl/string_view.hxx> #include <unotools/tempfile.hxx> @@ -65,8 +64,6 @@ #include <com/sun/star/embed/XVisualObject.hpp> #include <com/sun/star/chart2/RelativeSize.hpp> -#include <unotools/ucbstreamhelper.hxx> - using namespace css; using namespace css::uno; @@ -75,40 +72,6 @@ namespace com::sun::star::chart2 { class XDiagram; } namespace com::sun::star::table { class XTableCharts; } namespace com::sun::star::table { class XTablePivotCharts; } -namespace { - -struct CheckForChartName -{ -private: - OUString aDir; - -public: - explicit CheckForChartName( const OUString& rDir ): - aDir(rDir) {} - - bool operator()(std::u16string_view rName) - { - if(!o3tl::starts_with(rName, aDir)) - return false; - - if(!o3tl::ends_with(rName, u".xml")) - return false; - - return true; - } -}; - -OUString findChartFile(const OUString& rDir, uno::Reference< container::XNameAccess > const & xNames ) -{ - const uno::Sequence<OUString> aNames = xNames->getElementNames(); - const OUString* pElement = std::find_if(aNames.begin(), aNames.end(), CheckForChartName(rDir)); - - CPPUNIT_ASSERT(pElement != aNames.end()); - return *pElement; -} - -} - class ChartTest : public UnoApiXmlTest { public: @@ -129,16 +92,6 @@ public: Sequence< OUString > getFormattedDateCategories( const Reference<chart2::XChartDocument>& xChartDoc ); awt::Size getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ); awt::Size getSize(css::uno::Reference<chart2::XDiagram> xDiagram, const awt::Size& rPageSize); - -protected: - - /** - * Given that some problem doesn't affect the result in the importer, we - * test the resulting file directly, by opening the zip file, parsing an - * xml stream, and asserting an XPath expression. This method returns the - * xml stream, so that you can do the asserting. - */ - xmlDocUniquePtr parseExport(const OUString& rDir, const OUString& rFilterFormat); }; Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, sal_Int32 nChart, uno::Reference< lang::XComponent > const & xComponent ) @@ -668,17 +621,4 @@ getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString& return uno::Reference<drawing::XShape>(); } -xmlDocUniquePtr ChartTest::parseExport(const OUString& rDir, const OUString& rFilterFormat) -{ - save(rFilterFormat); - - // Read the XML stream we're interested in. - uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); - uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(findChartFile(rDir, xNameAccess)), uno::UNO_QUERY); - CPPUNIT_ASSERT(xInputStream.is()); - std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); - - return parseXmlStream(pStream.get()); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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 a9955b7b1ad7..a316cfee9319 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 differnew file mode 100644 index 000000000000..85fd3077c12e --- /dev/null +++ b/chart2/qa/extras/data/docx/MSO_axis_position_2.docx diff --git a/chart2/qa/extras/data/docx/testExternalData.docx b/chart2/qa/extras/data/docx/testExternalData.docx Binary files differnew file mode 100644 index 000000000000..20ae7e3d1f53 --- /dev/null +++ b/chart2/qa/extras/data/docx/testExternalData.docx diff --git a/chart2/qa/extras/data/docx/testMultipleChart.docx b/chart2/qa/extras/data/docx/testMultipleChart.docx Binary files differdeleted file mode 100644 index 28d8bbcfe143..000000000000 --- a/chart2/qa/extras/data/docx/testMultipleChart.docx +++ /dev/null diff --git a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx Binary files differindex b122680257c0..583c6720a4da 100644 --- a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx +++ b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx |