diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-05 19:10:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-07 09:52:27 +0200 |
commit | ec6eaa58addf0d8823f8c56d4ec168ff389da8c5 (patch) | |
tree | adb44639fc6bdecad5f576aa5e1aa90f3c9d64b3 /chart2 | |
parent | c437948f6c0d602bb200fc92e80cb73ae8ae5109 (diff) |
fix memory leak of xmlDoc objects
in unit tests
Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 228 | ||||
-rw-r--r-- | chart2/qa/extras/xshape/chart2xshape.cxx | 10 |
2 files changed, 119 insertions, 119 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 91fad970586e..571a0da80132 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -305,7 +305,7 @@ protected: * xml stream, and asserting an XPath expression. This method returns the * xml stream, so that you can do the asserting. */ - xmlDocPtr parseExport(const OUString& rDir, const OUString& rFilterFormat); + xmlDocUniquePtr parseExport(const OUString& rDir, const OUString& rFilterFormat); }; @@ -343,7 +343,7 @@ OUString findChartFile(const OUString& rDir, uno::Reference< container::XNameAcc } -xmlDocPtr Chart2ExportTest::parseExport(const OUString& rDir, const OUString& rFilterFormat) +xmlDocUniquePtr Chart2ExportTest::parseExport(const OUString& rDir, const OUString& rFilterFormat) { std::shared_ptr<utl::TempFile> pTempFile = save(rFilterFormat); @@ -578,7 +578,7 @@ void Chart2ExportTest::testErrorBarXLSX() void Chart2ExportTest::testErrorBarPropXLSX() { load("/chart2/qa/extras/data/xlsx/", "testErrorBarProp.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // test y error bars property @@ -631,7 +631,7 @@ void Chart2ExportTest::testStockChart() */ load("/chart2/qa/extras/data/docx/", "testStockChart.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); if (!pXmlDoc) return; @@ -646,7 +646,7 @@ void Chart2ExportTest::testStockChart() void Chart2ExportTest::testBarChart() { load("/chart2/qa/extras/data/docx/", "testBarChart.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); if (!pXmlDoc) return; @@ -656,7 +656,7 @@ void Chart2ExportTest::testBarChart() void Chart2ExportTest::testCrosses() { load("/chart2/qa/extras/data/docx/", "Bar_horizontal_cone.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero"); } @@ -703,7 +703,7 @@ void Chart2ExportTest::testScatterChartTextXValues() CPPUNIT_ASSERT_EQUAL(5.0, aYValues[2][3]); // Test the export. - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); if (!pXmlDoc) return; @@ -714,7 +714,7 @@ void Chart2ExportTest::testScatterXAxisValues() { load("/chart2/qa/extras/data/odt/", "tdf114657.odt"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:ptCount", "val", "5"); @@ -728,7 +728,7 @@ void Chart2ExportTest::testScatterXAxisCategories() { load("/chart2/qa/extras/data/odt/", "tdf131143.odt"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -739,7 +739,7 @@ void Chart2ExportTest::testChartDataTable() { load("/chart2/qa/extras/data/docx/", "testChartDataTable.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -750,7 +750,7 @@ void Chart2ExportTest::testChartExternalData() { load("/chart2/qa/extras/data/docx/", "testMultipleChart.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); xmlXPathObjectPtr pXmlPathObj = getXPathNode(pXmlDoc, "/c:chartSpace/c:externalData"); xmlNodeSetPtr pXmlNodes = pXmlPathObj->nodesetval; @@ -799,7 +799,7 @@ void Chart2ExportTest::testEmbeddingsGrabBag() void Chart2ExportTest::testAreaChartLoad() { load ("/chart2/qa/extras/data/docx/", "testAreaChartLoad.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); 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); @@ -809,7 +809,7 @@ void Chart2ExportTest::testUpDownBars() { /* load("/chart2/qa/extras/data/docx/", "UpDownBars.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars"); */ @@ -818,7 +818,7 @@ void Chart2ExportTest::testUpDownBars() void Chart2ExportTest::testDoughnutChart() { load("/chart2/qa/extras/data/docx/", "doughnutChart.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart"); @@ -827,7 +827,7 @@ void Chart2ExportTest::testDoughnutChart() void Chart2ExportTest::testDisplayUnits() { load("/chart2/qa/extras/data/docx/", "DisplayUnits.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:dispUnits/c:builtInUnit", "val", "billions"); @@ -836,7 +836,7 @@ void Chart2ExportTest::testDisplayUnits() // void Chart2ExportTest::testFdo74115WallGradientFill() // { // load("/chart2/qa/extras/data/docx/", "fdo74115_WallGradientFill.docx"); -// xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); +// xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); // CPPUNIT_ASSERT(pXmlDoc); // // assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill"); @@ -845,7 +845,7 @@ void Chart2ExportTest::testDisplayUnits() void Chart2ExportTest::testFdo74115WallBitmapFill() { load("/chart2/qa/extras/data/docx/", "fdo74115_WallBitmapFill.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"); } @@ -853,7 +853,7 @@ void Chart2ExportTest::testFdo74115WallBitmapFill() void Chart2ExportTest::testPieChartWallLineStyle() { load("/chart2/qa/extras/data/odt/", "testPieChartWallLineStyle.odt"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill"); } @@ -863,7 +863,7 @@ void Chart2ExportTest::testPieChartWallLineStyle() void Chart2ExportTest::testFdo78290LineChartMarkerX() { load("/chart2/qa/extras/data/docx/", "fdo78290_Line_Chart_Marker_x.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -874,7 +874,7 @@ void Chart2ExportTest::testFdo78290LineChartMarkerX() void Chart2ExportTest::testFdo78290ScatterChartMarkerX() { load("/chart2/qa/extras/data/docx/", "fdo78290_Scatter_Chart_Marker_x.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -886,7 +886,7 @@ void Chart2ExportTest::testFdo78290ScatterChartMarkerX() void Chart2ExportTest::testFdo78290CombinationChartMarkerX() { load("/chart2/qa/extras/data/docx/", "fdo78290_Combination_Chart_Marker_x.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -896,7 +896,7 @@ void Chart2ExportTest::testTdf126115IndividualMarker() { // Check individual marker properties. load("/chart2/qa/extras/data/xlsx/", "tdf126115.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1133,7 +1133,7 @@ void Chart2ExportTest::testDataLabel3DChartDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for 3D bar charts. The @@ -1149,7 +1149,7 @@ void Chart2ExportTest::testDataLabelBarChartDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLblPos", "val", "ctr"); @@ -1164,7 +1164,7 @@ void Chart2ExportTest::testDataLabelClusteredBarChartDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // This was "t", should be one of the allowed values. @@ -1178,7 +1178,7 @@ void Chart2ExportTest::testDataLabelRadarChartDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for radar charts. @@ -1193,7 +1193,7 @@ void Chart2ExportTest::testDataLabelDoughnutChartDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for doughnut charts. @@ -1208,7 +1208,7 @@ void Chart2ExportTest::testDataLabelAreaChartDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // We must not export label position attributes for area charts. @@ -1242,7 +1242,7 @@ void Chart2ExportTest::testDataLabelDefaultLineChartDOCX() void Chart2ExportTest::testIndividualDataLabelProps() { load("/chart2/qa/extras/data/xlsx/", "tdf122915.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open 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"); @@ -1253,7 +1253,7 @@ void Chart2ExportTest::testIndividualDataLabelProps() void Chart2ExportTest::testTdf108107() { load("/chart2/qa/extras/data/xlsx/", "tdf108107.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1263,7 +1263,7 @@ void Chart2ExportTest::testTdf108107() void Chart2ExportTest::testTdf114139() { load("/chart2/qa/extras/data/xlsx/", "tdf114139.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart", 1); @@ -1275,7 +1275,7 @@ void Chart2ExportTest::testTdf114139() void Chart2ExportTest::testTdf64224() { load("/chart2/qa/extras/data/ods/", "tdf64224.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); //no fill @@ -1286,7 +1286,7 @@ void Chart2ExportTest::testTdf64224() void Chart2ExportTest::testChartTitlePropertiesColorFillDOCX() { load("/chart2/qa/extras/data/docx/", "testChartTitlePropertiesColorFill.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); 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); @@ -1295,7 +1295,7 @@ void Chart2ExportTest::testChartTitlePropertiesColorFillDOCX() void Chart2ExportTest::testChartTitlePropertiesGradientFillDOCX() { load("/chart2/qa/extras/data/docx/", "testChartTitlePropertiesGradientFill.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); 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"); @@ -1305,7 +1305,7 @@ void Chart2ExportTest::testChartTitlePropertiesGradientFillDOCX() void Chart2ExportTest::testChartTitlePropertiesBitmapFillDOCX() { load("/chart2/qa/extras/data/docx/", "testChartTitlePropertiesBitmapFill.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); 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); @@ -1315,7 +1315,7 @@ void Chart2ExportTest::testColorGradientWithTransparancyDOCX() { // Test color gradient (two color) with gradient transparency load("/chart2/qa/extras/data/docx/", "testColorGradientWithTransparancy.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -1327,7 +1327,7 @@ void Chart2ExportTest::testColorGradientWithTransparancyODS() { // Test color gradient (two color) with simple transparency load("/chart2/qa/extras/data/ods/", "testColorGradientWithTransparancy.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1339,7 +1339,7 @@ void Chart2ExportTest::testColorGradientStopXLSX() { // Test color gradient (two color) stop of the first color load("/chart2/qa/extras/data/xlsx/", "tdf128619.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1350,7 +1350,7 @@ void Chart2ExportTest::testColorGradientStopXLSX() void Chart2ExportTest::testBarChartDataPointPropDOCX() { load("/chart2/qa/extras/data/docx/", "testBarChartDataPointPropDOCX.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -1368,7 +1368,7 @@ void Chart2ExportTest::testBarChartDataPointPropDOCX() void Chart2ExportTest::testBarChartRotation() { load ("/chart2/qa/extras/data/docx/", "barChartRotation.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", "30"); @@ -1383,7 +1383,7 @@ void Chart2ExportTest::testShapeFollowedByChart() docPr Id should be unique, ensuring the same here. */ load("/chart2/qa/extras/data/docx/", "FDO74430.docx"); - xmlDocPtr pXmlDoc = parseExport("word/document", "Office Open XML Text" ); + xmlDocUniquePtr pXmlDoc = parseExport("word/document", "Office Open XML Text" ); 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"); @@ -1395,7 +1395,7 @@ void Chart2ExportTest::testShapeFollowedByChart() void Chart2ExportTest::testPieChartDataLabels() { load("/chart2/qa/extras/data/docx/", "PieChartDataLabels.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", "bestFit"); } @@ -1403,7 +1403,7 @@ void Chart2ExportTest::testPieChartDataLabels() void Chart2ExportTest::testSeriesIdxOrder() { load("/chart2/qa/extras/data/docx/", "testSeriesIdxOrder.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); 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"); @@ -1473,14 +1473,14 @@ void Chart2ExportTest::testErrorBarDataRangeODS() void Chart2ExportTest::testChartCrash() { load("/chart2/qa/extras/data/docx/", "FDO75975.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); } void Chart2ExportTest::testPieChartRotation() { load ("/chart2/qa/extras/data/docx/", "pieChartRotation.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); 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"); @@ -1583,7 +1583,7 @@ void Chart2ExportTest::testGapWidthXLSX() void Chart2ExportTest::testSmoothedLines() { load("/chart2/qa/extras/data/ods/", "smoothedLines.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:smooth", "val", "0"); } @@ -1613,7 +1613,7 @@ void Chart2ExportTest::testLabelStringODS() void Chart2ExportTest::testFdo83058dlblPos() { load ("/chart2/qa/extras/data/docx/", "fdo83058_dlblPos.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); 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"); @@ -1624,7 +1624,7 @@ void Chart2ExportTest::testFdo83058dlblPos() void Chart2ExportTest::testAutoTitleDelXLSX() { load("/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "0"); } @@ -1632,7 +1632,7 @@ void Chart2ExportTest::testAutoTitleDelXLSX() void Chart2ExportTest::testDispBlanksAsXLSX() { load("/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2007.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap"); } @@ -1640,7 +1640,7 @@ void Chart2ExportTest::testDispBlanksAsXLSX() void Chart2ExportTest::testMarkerColorXLSX() { load("/chart2/qa/extras/data/xlsx/", "markerColor.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); } @@ -1648,7 +1648,7 @@ void Chart2ExportTest::testMarkerColorXLSX() void Chart2ExportTest::testRoundedCornersXLSX() { load("/chart2/qa/extras/data/xlsx/", "markerColor.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners", "val", "0"); } @@ -1656,7 +1656,7 @@ void Chart2ExportTest::testRoundedCornersXLSX() void Chart2ExportTest::testAxisNumberFormatXLSX() { load("/chart2/qa/extras/data/ods/", "axis_number_format.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1670,7 +1670,7 @@ void Chart2ExportTest::testDataPointLabelNumberFormatXLSX() { load("/chart2/qa/extras/data/ods/", "tdf123774.ods"); { - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1681,7 +1681,7 @@ void Chart2ExportTest::testDataPointLabelNumberFormatXLSX() load("/chart2/qa/extras/data/xlsx/", "tdf130986.xlsx"); { - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1700,7 +1700,7 @@ void Chart2ExportTest::testDataLabelDefaultValuesXLSX() CPPUNIT_ASSERT(aAny >>= aLabel); CPPUNIT_ASSERT(aLabel.ShowNumber); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1709,7 +1709,7 @@ void Chart2ExportTest::testDataLabelDefaultValuesXLSX() void Chart2ExportTest::testTitleOverlayXLSX() { load("/chart2/qa/extras/data/xlsx/", "chart_title.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", "0"); } @@ -1717,7 +1717,7 @@ void Chart2ExportTest::testTitleOverlayXLSX() void Chart2ExportTest::testInvertIfNegativeXLSX() { load("/chart2/qa/extras/data/xlsx/", "bar_chart_simple.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", "0"); } @@ -1725,7 +1725,7 @@ void Chart2ExportTest::testInvertIfNegativeXLSX() void Chart2ExportTest::testBubble3DXLSX() { load("/chart2/qa/extras/data/xlsx/", "bubble_chart_simple.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1735,7 +1735,7 @@ void Chart2ExportTest::testBubble3DXLSX() void Chart2ExportTest::testNoMarkerXLSX() { load("/chart2/qa/extras/data/xlsx/", "no_marker.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1745,7 +1745,7 @@ void Chart2ExportTest::testNoMarkerXLSX() void Chart2ExportTest::testTitleManualLayoutXLSX() { load("/chart2/qa/extras/data/xlsx/", "title_manual_layout.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1766,7 +1766,7 @@ void Chart2ExportTest::testTitleManualLayoutXLSX() void Chart2ExportTest::testPlotAreaManualLayoutXLSX() { load("/chart2/qa/extras/data/xlsx/", "plot_area_manual_layout.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", "val", "inner"); @@ -1795,7 +1795,7 @@ void Chart2ExportTest::testPlotAreaManualLayoutXLSX() void Chart2ExportTest::testLegendManualLayoutXLSX() { load("/chart2/qa/extras/data/xlsx/", "legend_manual_layout.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:layout/c:manualLayout/c:layoutTarget", 0); @@ -1827,7 +1827,7 @@ void Chart2ExportTest::testLegendManualLayoutXLSX() void Chart2ExportTest::testChartSubTitle() { load("/chart2/qa/extras/data/ods/", "testChartSubTitle.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1841,7 +1841,7 @@ void Chart2ExportTest::testChartSubTitle() void Chart2ExportTest::testChartMainWithSubTitle() { load("/chart2/qa/extras/data/ods/", "testChartMainWithSubTitle.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1856,7 +1856,7 @@ void Chart2ExportTest::testChartMainWithSubTitle() void Chart2ExportTest::testAutoTitleDeleted() { load("/chart2/qa/extras/data/xlsx/", "testAutoTitleDeleted.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", "1"); } @@ -1864,7 +1864,7 @@ void Chart2ExportTest::testAutoTitleDeleted() void Chart2ExportTest::testChartTitlePropertiesColorFillXLSX() { load("/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesColorFill.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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); @@ -1873,7 +1873,7 @@ void Chart2ExportTest::testChartTitlePropertiesColorFillXLSX() void Chart2ExportTest::testChartTitlePropertiesGradientFillXLSX() { load("/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesGradientFill.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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"); @@ -1883,7 +1883,7 @@ void Chart2ExportTest::testChartTitlePropertiesGradientFillXLSX() void Chart2ExportTest::testChartTitlePropertiesBitmapFillXLSX() { load("/chart2/qa/extras/data/xlsx/", "testChartTitlePropertiesBitmapFill.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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); @@ -1892,7 +1892,7 @@ void Chart2ExportTest::testChartTitlePropertiesBitmapFillXLSX() void Chart2ExportTest::testBarChartDataPointPropXLSX() { load("/chart2/qa/extras/data/xlsx/", "testBarChartDataPointPropXLSX.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -1931,7 +1931,7 @@ void Chart2ExportTest::testDataseriesOverlapStackedChartXLSX() void Chart2ExportTest::testAxisCharacterPropertiesXLSX() { load("/chart2/qa/extras/data/xlsx/", "axis_character_properties.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1000"); @@ -1948,7 +1948,7 @@ void Chart2ExportTest::testAxisCharacterPropertiesXLSX() void Chart2ExportTest::testTitleCharacterPropertiesXLSX() { load("/chart2/qa/extras/data/xlsx/", "title_character_properties.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr", "sz", "2400"); @@ -1961,7 +1961,7 @@ void Chart2ExportTest::testTitleCharacterPropertiesXLSX() void Chart2ExportTest::testPlotVisOnlyXLSX() { load("/chart2/qa/extras/data/xlsx/", "hidden_cells.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly", "val", "0"); @@ -1970,7 +1970,7 @@ void Chart2ExportTest::testPlotVisOnlyXLSX() void Chart2ExportTest::testBarChartVaryColorsXLSX() { load("/chart2/qa/extras/data/xlsx/", "tdf90876.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:varyColors", "val", "0"); @@ -1979,7 +1979,7 @@ void Chart2ExportTest::testBarChartVaryColorsXLSX() void Chart2ExportTest::testMultipleAxisXLSX() { load("/chart2/qa/extras/data/ods/", "multiple_axis.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart", 2); @@ -1994,7 +1994,7 @@ void Chart2ExportTest::testMultipleAxisXLSX() void Chart2ExportTest::testSecondaryAxisXLSX() { load("/chart2/qa/extras/data/ods/", "secondary_axis.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2); @@ -2020,7 +2020,7 @@ void Chart2ExportTest::testSetSeriesToSecondaryAxisXLSX() // Attach the second series to the secondary axis. (The third series is already attached.) xPropSet->setPropertyValue("AttachedAxisIndex", uno::Any(AxisIndex)); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 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); @@ -2030,7 +2030,7 @@ void Chart2ExportTest::testCombinedChartSecondaryAxisXLSX() { // Original file was created with MS Office load("/chart2/qa/extras/data/xlsx/", "combined_chart_secondary_axis.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis OUString XValueIdOfBarchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[1]", "val"); @@ -2049,7 +2049,7 @@ void Chart2ExportTest::testCombinedChartSecondaryAxisODS() { // Original file was created with LibreOffice load("/chart2/qa/extras/data/ods/", "combined_chart_secondary_axis.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis OUString XValueIdOfBarchart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[1]", "val"); @@ -2071,13 +2071,13 @@ void Chart2ExportTest::testCrossBetweenXLSX() // Original files were created with MS Office { load("/chart2/qa/extras/data/xlsx/", "tdf127777.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); } { load("/chart2/qa/extras/data/xlsx/", "tdf132076.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); } @@ -2087,7 +2087,7 @@ void Chart2ExportTest::testCrossBetweenWithDeletedAxis() { // Original file was created with MS Office (the category axis is deleted in the file) load("/chart2/qa/extras/data/xlsx/", "tdf128633.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); } @@ -2096,7 +2096,7 @@ void Chart2ExportTest::testCrossBetweenODS() { // Original file was created with LibreOffice load("/chart2/qa/extras/data/ods/", "test_CrossBetween.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); } @@ -2104,7 +2104,7 @@ void Chart2ExportTest::testCrossBetweenODS() void Chart2ExportTest::testAxisTitleRotationXLSX() { load("/chart2/qa/extras/data/xlsx/", "axis_title_rotation.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:tx/c:rich/a:bodyPr", "rot", "0"); @@ -2113,7 +2113,7 @@ void Chart2ExportTest::testAxisTitleRotationXLSX() void Chart2ExportTest::testAxisTitlePositionDOCX() { load("/chart2/qa/extras/data/docx/", "testAxisTitlePosition.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // test X Axis title position @@ -2137,14 +2137,14 @@ void Chart2ExportTest::testAxisTitlePositionDOCX() void Chart2ExportTest::testAxisCrossBetweenDOCX() { load("/chart2/qa/extras/data/odt/", "axis-position.odt"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", "midCat"); } void Chart2ExportTest::testPieChartDataPointExplosionXLSX() { load("/chart2/qa/extras/data/xlsx/", "pie_chart_datapoint_explosion.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dPt/c:explosion", "val", "28"); @@ -2153,7 +2153,7 @@ void Chart2ExportTest::testPieChartDataPointExplosionXLSX() void Chart2ExportTest::testCustomDataLabel() { load("/chart2/qa/extras/data/pptx/", "tdf115107.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart1", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart1", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); // Check the data labels font color for the complete data series assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "404040"); @@ -2252,7 +2252,7 @@ void Chart2ExportTest::testCustomPositionofDataLabel() { load("/chart2/qa/extras/data/xlsx/", "testCustomPosDataLabels.xlsx"); { - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // test custom position of data label (xlsx) @@ -2268,7 +2268,7 @@ void Chart2ExportTest::testCustomPositionofDataLabel() load("/chart2/qa/extras/data/docx/", "testTdf108110.docx"); { - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // test custom position of data label (docx) @@ -2286,7 +2286,7 @@ void Chart2ExportTest::testCustomPositionofDataLabel() void Chart2ExportTest::testCustomDataLabelMultipleSeries() { load("/chart2/qa/extras/data/pptx/", "tdf115107-2.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart2", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart2", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); @@ -2343,7 +2343,7 @@ void Chart2ExportTest::testCustomDataLabelMultipleSeries() void Chart2ExportTest::testLeaderLines() { load("/chart2/qa/extras/data/xlsx/", "testTdf90749.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "1"); @@ -2352,7 +2352,7 @@ void Chart2ExportTest::testLeaderLines() void Chart2ExportTest::testNumberFormatExportPPTX() { load("/chart2/qa/extras/data/pptx/", "tdf115859.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt", "formatCode", "#,##0.00,\\K"); @@ -2366,7 +2366,7 @@ void Chart2ExportTest::testLabelSeparatorExportDOCX() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // The text separator should be a new line @@ -2380,7 +2380,7 @@ void Chart2ExportTest::testLabelSeparatorExportDOCX() void Chart2ExportTest::testChartTitlePropertiesColorFillPPTX() { load("/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesColorFill.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 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); @@ -2389,7 +2389,7 @@ void Chart2ExportTest::testChartTitlePropertiesColorFillPPTX() void Chart2ExportTest::testChartTitlePropertiesGradientFillPPTX() { load("/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesGradientFill.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "f6f8fc"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", "c7d5ed"); @@ -2399,7 +2399,7 @@ void Chart2ExportTest::testChartTitlePropertiesGradientFillPPTX() void Chart2ExportTest::testChartTitlePropertiesBitmapFillPPTX() { load("/chart2/qa/extras/data/pptx/", "testChartTitlePropertiesBitmapFill.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 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); @@ -2408,7 +2408,7 @@ void Chart2ExportTest::testChartTitlePropertiesBitmapFillPPTX() void Chart2ExportTest::testxAxisLabelsRotation() { load ("/chart2/qa/extras/data/xlsx/", "xAxisLabelsRotation.xlsx"); - xmlDocPtr pXmlDoc1 = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc1 = parseExport("xl/charts/chart","Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc1); // Chart1 xAxis labels should be 45 degree @@ -2418,7 +2418,7 @@ void Chart2ExportTest::testxAxisLabelsRotation() void Chart2ExportTest::testMultipleCategoryAxisLablesXLSX() { load("/chart2/qa/extras/data/ods/", "multilevelcat.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:ptCount", "val", "6"); @@ -2435,7 +2435,7 @@ void Chart2ExportTest::testMultipleCategoryAxisLablesXLSX() void Chart2ExportTest::testMultipleCategoryAxisLablesDOCX() { load("/chart2/qa/extras/data/odt/", "multilevelcat.odt"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:ptCount", "val", "4"); @@ -2452,7 +2452,7 @@ void Chart2ExportTest::testMultipleCategoryAxisLablesDOCX() void Chart2ExportTest::testTdf116163() { load("/chart2/qa/extras/data/pptx/", "tdf116163.pptx"); - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", "-5400000"); @@ -2461,7 +2461,7 @@ void Chart2ExportTest::testTdf116163() void Chart2ExportTest::testTdf111824() { load("/chart2/qa/extras/data/xlsx/", "tdf111824.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // Collect 3D barchart Z axID @@ -2473,7 +2473,7 @@ void Chart2ExportTest::testTdf111824() void Chart2ExportTest::test3DAreaChartZAxis() { load("/chart2/qa/extras/data/xlsx/", "test3DAreaChartZAxis.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // Collect 3D area chart Z axID @@ -2486,7 +2486,7 @@ void Chart2ExportTest::testTdf119029() { load("/chart2/qa/extras/data/odp/", "tdf119029.odp"); // Only use "chart", without number, because the number depends on the previous tests - xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 2007 XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -2509,7 +2509,7 @@ void Chart2ExportTest::testTdf108022() void Chart2ExportTest::testTdf121744() { load("/chart2/qa/extras/data/docx/", "tdf121744.docx"); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); OUString XValueId = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:axId[1]", "val"); @@ -2524,7 +2524,7 @@ void Chart2ExportTest::testTdf122031() //Checks pie chart data label format. load("/chart2/qa/extras/data/xlsx/", "tdf122031.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "formatCode", "0.000%"); @@ -2536,7 +2536,7 @@ void Chart2ExportTest::testTdf122031() void Chart2ExportTest::testTdf115012() { load("/chart2/qa/extras/data/xlsx/", "tdf115012.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open 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"); @@ -2549,7 +2549,7 @@ void Chart2ExportTest::testTdf123206_customLabelText() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart","Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:tx/c:rich/a:p/a:r/a:t", "kiscica"); @@ -2562,7 +2562,7 @@ void Chart2ExportTest::testCustomLabelText() Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val", "2"); @@ -2629,7 +2629,7 @@ void Chart2ExportTest::testTdf130225() void Chart2ExportTest::testTdf59857() { load("/chart2/qa/extras/data/ods/", "tdf59857.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:floor/c:spPr/a:ln/a:noFill", 1); @@ -2641,7 +2641,7 @@ void Chart2ExportTest::testTdf59857() void Chart2ExportTest::testTdf126076() { load("/chart2/qa/extras/data/xlsx/", "auto_marker_excel10.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); // This was 12: all series exported with square markers @@ -2679,12 +2679,12 @@ void Chart2ExportTest::testTdf127792() { load("/chart2/qa/extras/data/docx/", "MSO_axis_position.docx"); { - xmlDocPtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between"); } { - xmlDocPtr pXmlDoc = parseExport("word/charts/chart2", "Office Open XML Text"); + xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart2", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "midCat"); } @@ -2725,14 +2725,14 @@ void Chart2ExportTest::testTdf132076() { { load("/chart2/qa/extras/data/ods/", "tdf132076.ods"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "formatCode", "dd"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "sourceLinked", "0"); } { load("/chart2/qa/extras/data/xlsx/", "tdf132076.xlsx"); - xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "formatCode", "dd"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "sourceLinked", "0"); diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx index e68deadc2294..a4f24e666691 100644 --- a/chart2/qa/extras/xshape/chart2xshape.cxx +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -48,7 +48,7 @@ private: void compareAgainstReference(const OUString& rReferenceFile, bool bCreateReference = false); OUString getXShapeDumpString(); - xmlDocPtr getXShapeDumpXmlDoc(); + xmlDocUniquePtr getXShapeDumpXmlDoc(); }; namespace { @@ -73,11 +73,11 @@ OUString Chart2XShapeTest::getXShapeDumpString() return xDumper->dump(); } -xmlDocPtr Chart2XShapeTest::getXShapeDumpXmlDoc() +xmlDocUniquePtr Chart2XShapeTest::getXShapeDumpXmlDoc() { OUString rDump = getXShapeDumpString(); OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); - return xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr())); + return xmlDocUniquePtr(xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr()))); } void Chart2XShapeTest::compareAgainstReference(const OUString& rReferenceFile, bool bCreateReference) @@ -173,7 +173,7 @@ void Chart2XShapeTest::testTdf76649TrendLineBug() load("chart2/qa/extras/xshape/data/ods/", "tdf76649_TrendLineBug.ods"); - xmlDocPtr pXmlDoc = getXShapeDumpXmlDoc(); + xmlDocUniquePtr pXmlDoc = getXShapeDumpXmlDoc(); // Check if the regression curve exists (which means a XShape with a certain // name should exist in the dump) @@ -187,7 +187,7 @@ void Chart2XShapeTest::testTdf88154LabelRotatedLayout() uno::Reference< qa::XDumper > xDumper( xChartDoc, UNO_QUERY_THROW ); OUString rDump = xDumper->dump(); OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); - xmlDocPtr pXmlDoc = xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr())); + xmlDocUniquePtr pXmlDoc(xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr()))); { OString aPath( "//XShape[@text='Oct-12']/Transformation" ); |