diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx index 30cd8c656526..d20660e331ad 100644 --- a/chart2/qa/extras/PivotChartTest.cxx +++ b/chart2/qa/extras/PivotChartTest.cxx @@ -351,7 +351,7 @@ void PivotChartTest::testRoundtrip() CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, xLabelDataSequence->getData()[0].get()); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); xChartDoc = getPivotChartDocFromSheet(1 ); CPPUNIT_ASSERT(xChartDoc.is()); diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 032cfaf47e69..4e8b149af20c 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -208,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarXLSX) testErrorBar(xErrorBarYProps); } - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -228,7 +228,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarPropXLSX) { loadFromFile(u"xlsx/testErrorBarProp.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendline) skipValidation(); loadFromFile(u"ods/trendline.ods"); checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 )); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 )); } @@ -260,7 +260,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendlineOOXML) { loadFromFile(u"ods/trendline.ods"); checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 )); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 )); } @@ -268,14 +268,14 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTrendlineXLS) { loadFromFile(u"ods/trendline.ods"); checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 )); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); checkTrendlinesInChart(getDataSeriesFromDoc( getChartDocFromSheet( 0), 0 )); } CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testMovingAverage) { loadFromFile(u"ods/moving-type.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0); CPPUNIT_ASSERT(xChartDoc.is()); @@ -311,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart) */ loadFromFile(u"docx/testStockChart.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -326,7 +326,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStockChart) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChart) { loadFromFile(u"docx/testBarChart.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -338,7 +338,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses) // test crosses val="autoZero" with DOCX { loadFromFile(u"docx/Bar_horizontal_cone.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", u"autoZero"); @@ -346,7 +346,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testCrosses) // tdf#142351: test crossesAt val="-50" with XLSX { loadFromFile(u"xlsx/tdf142351.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -396,7 +396,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterChartTextXValues) CPPUNIT_ASSERT_EQUAL(5.0, aYValues[2][3]); // Test the export. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -407,7 +407,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisValues) { loadFromFile(u"odt/tdf114657.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -422,7 +422,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterXAxisCategories) { loadFromFile(u"odt/tdf131143.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:ptCount", "val", u"4"); @@ -434,7 +434,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartDataTable) { loadFromFile(u"docx/testChartDataTable.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", u"1"); @@ -446,7 +446,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartExternalData) { loadFromFile(u"docx/testMultipleChart.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:externalData"); @@ -498,7 +498,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAreaChartLoad) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:areaChart/c:ser/c:dLbls/c:showVal", "val", u"1"); @@ -508,7 +508,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAreaChartLoad) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars) { loadFromFile(u"docx/UpDownBars.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:upDownBars", 0); @@ -517,7 +517,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testUpDownBars) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart) { loadFromFile(u"docx/doughnutChart.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -527,7 +527,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieChart) { loadFromFile(u"xlsx/pieOfPieChart.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -538,7 +538,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieChart) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieChart) { loadFromFile(u"xlsx/barOfPieChart.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -549,7 +549,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieChart) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieSplitPos) { loadFromFile(u"xlsx/pieOfPieChart2.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -560,7 +560,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieSplitPos) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieSplitPos) { loadFromFile(u"xlsx/barOfPieChart2.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -571,7 +571,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieSplitPos) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits) { loadFromFile(u"docx/DisplayUnits.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -581,7 +581,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill) { loadFromFile(u"docx/fdo74115_WallGradientFill.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -591,7 +591,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallGradientFill) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo74115WallBitmapFill) { loadFromFile(u"docx/fdo74115_WallBitmapFill.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"); @@ -604,7 +604,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle) // FIXME: validation error in OOXML export: Errors: 9 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill"); @@ -615,7 +615,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartWallLineStyle) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX) { loadFromFile(u"docx/fdo78290_Line_Chart_Marker_x.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); 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",u"x"); @@ -627,7 +627,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290LineChartMarkerX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX) { loadFromFile(u"docx/fdo78290_Scatter_Chart_Marker_x.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); 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",u"x"); @@ -640,7 +640,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290ScatterChartMarkerX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testFdo78290CombinationChartMarkerX) { loadFromFile(u"docx/fdo78290_Combination_Chart_Marker_x.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); 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",u"x"); @@ -651,7 +651,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testTdf126115IndividualMarker) { // Check individual marker properties. loadFromFile(u"xlsx/tdf126115.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // 1. series @@ -703,7 +703,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAxisNumberFormatODS) verify(xChartDoc); // Reload the document and make sure everything remains intact. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); xChartDoc = getChartDocFromSheet(0); verify(xChartDoc); } @@ -752,7 +752,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testAxisNumberFormatXLS) xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny ); // Write the document(xls) with changes made close it, load it and check if changes are intact - saveAndReload( u"MS Excel 97"_ustr ); + saveAndReload(TestFilter::XLS); xChartDoc = getChartDocFromSheet( 0 ); verify( xChartDoc, false, util::NumberFormat::NUMBER ); } @@ -837,7 +837,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBordersDOCX) // FIXME: validation error in OOXML export: Errors: 3 skipValidation(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY); verify(xChartDoc , 0); @@ -855,7 +855,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabel3DChartDOCX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelBarChartDOCX) Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -891,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelClusteredBarChartDOCX) // FIXME: validation error in OOXML export: Errors: 9 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -906,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelRadarChartDOCX) Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -925,7 +925,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDoughnutChartDOCX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -944,7 +944,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelAreaChartDOCX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -964,7 +964,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataLabelDefaultLineChartDOCX) Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY); Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); @@ -983,7 +983,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); 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", u"1"); @@ -995,7 +995,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testIndividualDataLabelProps) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarChartRotation) { loadFromFile(u"docx/barChartRotation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1015,7 +1015,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testShapeFollowedByChart) // FIXME: validation error in OOXML export: Errors: 5 skipValidation(); - save(u"Office Open XML Text"_ustr ); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1032,7 +1032,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels) // FIXME: validation error in OOXML export: Errors: 19 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", u"outEnd"); @@ -1041,7 +1041,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartDataLabels) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSeriesIdxOrder) { loadFromFile(u"docx/testSeriesIdxOrder.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:idx[1]", "val", u"1"); @@ -1065,7 +1065,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterPlotLabels) CPPUNIT_ASSERT_EQUAL(u"c"_ustr, aLabels[2][0].get()); // Reload the doc and check again. The labels should not change. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xChartDoc.set(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1083,7 +1083,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testScatterPlotLabels) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarDataRangeODS) { loadFromFile(u"ods/ErrorBarRange.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1112,7 +1112,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testErrorBarDataRangeODS) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_barOfPie) { loadFromFile(u"ods/tdf50934_barOfPie.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1135,7 +1135,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_barOfPie) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_pieOfPie) { loadFromFile(u"ods/tdf50934_pieOfPie.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1158,7 +1158,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_pieOfPie) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_barOfPie_split_pos) { loadFromFile(u"ods/tdf161800_barOfPie_split_pos.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1178,7 +1178,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_barOfPie_split_pos) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_pieOfPie_split_pos) { loadFromFile(u"ods/tdf161800_pieOfPie_split_pos.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0 ); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1201,7 +1201,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf161800_pieOfPie_split_pos) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash) { loadFromFile(u"docx/FDO75975.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); } @@ -1209,7 +1209,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieChartRotation) { loadFromFile(u"docx/pieChartRotation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:view3D/c:rotX", "val", u"40"); @@ -1295,7 +1295,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testGapWidthXLSX) xChartDoc = getChartDocFromSheet( 1 ); checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 50, 30); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); xChartDoc = getChartDocFromSheet( 0 ); checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 120, -60); @@ -1316,7 +1316,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataseriesOverlapStackedChartXLSX) xChartDoc = getChartDocFromSheet( 1); checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 100, 35); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); xChartDoc = getChartDocFromSheet( 0); checkSheetForGapWidthAndOverlap(getChartTypeFromDoc( xChartDoc, 0 ), 100, 100); @@ -1328,7 +1328,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDataseriesOverlapStackedChartXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testSmoothedLines) { loadFromFile(u"ods/smoothedLines.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:smooth", "val", u"0"); @@ -1346,7 +1346,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testLabelStringODS) OUString aLabelString = xLabelSeq->getSourceRangeRepresentation(); CPPUNIT_ASSERT_EQUAL(u"\"LabelName\""_ustr, aLabelString); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); xChartDoc = getChartDocFromSheet( 0 ); xLabelSeq = getLabelDataSequenceFromDoc(xChartDoc); @@ -1403,7 +1403,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testStyleImportExport) // Test that this value round-trips successfully. loadFromFile(std::u16string_view(u"xlsx/column-style.xlsx")); - save("Calc Office Open XML"); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/style1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/cs:chartStyle"); diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index e6253342dcce..8295da0c19b2 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -42,7 +42,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testSetSeriesToSecondaryAxisXLSX) // Attach the second series to the secondary axis. (The third series is already attached.) xPropSet->setPropertyValue(u"AttachedAxisIndex"_ustr, uno::Any(AxisIndex)); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Check there are only two tag in the XML, one for the primary and one for the secondary axis. @@ -53,7 +53,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisXLSX) { // Original file was created with MS Office loadFromFile(u"xlsx/combined_chart_secondary_axis.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis @@ -81,7 +81,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCombinedChartSecondaryAxisODS) { // Original file was created with LibreOffice loadFromFile(u"ods/combined_chart_secondary_axis.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on secondary Axis @@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenXLSX) // Original files were created with MS Office { loadFromFile(u"xlsx/tdf127777.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", @@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenXLSX) } { loadFromFile(u"xlsx/tdf132076.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", @@ -135,7 +135,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenWithDeletedAxis) { // Original file was created with MS Office (the category axis is deleted in the file) loadFromFile(u"xlsx/tdf128633.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", @@ -146,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenODS) { // Original file was created with LibreOffice loadFromFile(u"ods/test_CrossBetween.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenODS) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexTitleXLSX) { loadFromFile(u"xlsx/funnel1.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexTitleXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexPPTX) { loadFromFile(u"pptx/funnel-pp1.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chartEx1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -185,7 +185,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexPPTX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitleRotationXLSX) { loadFromFile(u"xlsx/axis_title_rotation.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -196,7 +196,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitleRotationXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisTitlePositionDOCX) { loadFromFile(u"docx/testAxisTitlePosition.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -233,7 +233,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisCrossBetweenDOCX) // FIXME: validation error in OOXML export: Errors: 3 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); assertXPath(pXmlDoc, "(//c:crossBetween)[1]", "val", u"midCat"); } @@ -241,7 +241,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testAxisCrossBetweenDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testPieChartDataPointExplosionXLSX) { loadFromFile(u"xlsx/pie_chart_datapoint_explosion.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -360,7 +360,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel) aFields[1]->getFieldType()); CPPUNIT_ASSERT_EQUAL(u" getString()); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Check the data labels font color for the complete data series @@ -377,7 +377,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataSeriesName) // ODF { loadFromFile(u"ods/ser_labels.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference xChartDoc = getChartDocFromSheet(0); uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); CPPUNIT_ASSERT(xDataSeries.is()); @@ -391,7 +391,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataSeriesName) // OOXML { loadFromFile(u"xlsx/ser_labels.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); uno::Reference xChartDoc = getChartDocFromSheet(0); uno::Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); CPPUNIT_ASSERT(xDataSeries.is()); @@ -410,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel) loadFromFile(u"xlsx/testCustomPosDataLabels.xlsx"); { - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -435,7 +435,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel) loadFromFile(u"docx/testTdf108110.docx"); { - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -460,7 +460,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomPositionofDataLabel) loadFromFile(u"ods/tdf136024.ods"); { - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // tdf#136024: test custom position of pie chart data label after an ods export Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); @@ -484,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf161571PiechartCustomPosDataLabels skipValidation(); loadFromFile(u"xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -576,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines) loadFromFile(u"xlsx/testTdf90749.xlsx"); { - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines) } loadFromFile(u"docx/MSO_Custom_Leader_Line.docx"); { - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // tdf#134571: Check the leader line is switch off. @@ -607,7 +607,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf161607PieChartLeaderLinesColorWid skipValidation(); loadFromFile(u"xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -631,7 +631,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf161607PieChartLeaderLinesColorWid CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNumberFormatExportPPTX) { loadFromFile(u"pptx/tdf115859.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -648,7 +648,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLabelSeparatorExportDOCX) Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -666,7 +666,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLabelSeparatorExportDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesColorFillPPTX) { loadFromFile(u"pptx/testChartTitlePropertiesColorFill.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", @@ -677,7 +677,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesColorFillPPTX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesGradientFillPPTX) { loadFromFile(u"pptx/testChartTitlePropertiesGradientFill.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive( @@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesGradientFillPPTX CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesBitmapFillPPTX) { loadFromFile(u"pptx/testChartTitlePropertiesBitmapFill.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", @@ -703,7 +703,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartTitlePropertiesBitmapFillPPTX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testxAxisLabelsRotation) { loadFromFile(u"xlsx/xAxisLabelsRotation.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc1); @@ -715,7 +715,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testxAxisLabelsRotation) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesXLSX) { loadFromFile(u"ods/multilevelcat.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level @@ -748,7 +748,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesDOCX) { loadFromFile(u"odt/multilevelcat.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // check category axis labels number of first level @@ -781,7 +781,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testMultipleCategoryAxisLablesDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf116163) { loadFromFile(u"pptx/tdf116163.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf116163) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf111824) { loadFromFile(u"xlsx/tdf111824.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -807,7 +807,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf111824) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, test3DAreaChartZAxis) { loadFromFile(u"xlsx/test3DAreaChartZAxis.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf119029) { loadFromFile(u"odp/tdf119029.odp"); // Only use "chart", without number, because the number depends on the previous tests - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf119029) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf108022) { loadFromFile(u"odt/tdf108022.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // assert we really have two charts Reference xChartDoc1(getChartDocFromWriter(0), uno::UNO_QUERY); @@ -847,7 +847,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf108022) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121744) { loadFromFile(u"docx/tdf121744.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -863,7 +863,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121744) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf121189) { loadFromFile(u"odp/tdf121189.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), @@ -881,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf122031) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -901,7 +901,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf122031) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf115012) { loadFromFile(u"xlsx/tdf115012.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // workaround: use-zero instead of leave-gap to show the original line chart @@ -915,7 +915,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134118) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // workaround: use leave-gap instead of zero to show the original line chart @@ -932,7 +932,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123206_customLabelText) // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -946,7 +946,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, test_style) { loadFromFile(u"xlsx/column-style.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // workaround: use leave-gap instead of zero to show the original line chart @@ -963,7 +963,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomLabelText) // FIXME: validation error in OOXML export: Errors: 3 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -996,7 +996,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDeletedLegendEntries) { loadFromFile(u"xlsx/deleted_legend_entry.xlsx"); { - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 1)); @@ -1010,7 +1010,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDeletedLegendEntries) loadFromFile(u"xlsx/deleted_legend_entry2.xlsx"); { - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); @@ -1036,7 +1036,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDeletedLegendEntries) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf60316) { loadFromFile(u"pptx/tdf60316.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1048,7 +1048,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf60316) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf130225) { loadFromFile(u"docx/piechart_deleted_legend_entry.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); @@ -1063,7 +1063,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf130225) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf59857) { loadFromFile(u"ods/tdf59857.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1079,7 +1079,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf59857) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf126076) { loadFromFile(u"xlsx/auto_marker_excel10.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1094,7 +1094,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf126076) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf75330) { loadFromFile(u"ods/legend_overlay.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { uno::Reference xChart2Doc = getChartDocFromSheet(0); uno::Reference xChartDoc(xChart2Doc, uno::UNO_QUERY); @@ -1104,7 +1104,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf75330) CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Overlay"_ustr) >>= bOverlay); CPPUNIT_ASSERT(bOverlay); } - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { uno::Reference xChart2Doc = getChartDocFromSheet(0); uno::Reference xChartDoc(xChart2Doc, uno::UNO_QUERY); @@ -1119,7 +1119,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf75330) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf127792) { loadFromFile(u"docx/MSO_axis_position.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", @@ -1135,7 +1135,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf131979) { loadFromFile(u"ods/tdf131115.ods"); { - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); @@ -1151,7 +1151,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf131979) loadFromFile(u"ods/tdf131979.ods"); { - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); @@ -1173,7 +1173,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076) { loadFromFile(u"ods/tdf132076.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "formatCode", @@ -1183,7 +1183,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076) } { loadFromFile(u"xlsx/tdf132076.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "formatCode", @@ -1196,7 +1196,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132076) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf125812) { loadFromFile(u"odp/ellipticalGradientFill.odp"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path", "path", @@ -1218,7 +1218,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133190) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1240,7 +1240,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133191) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1254,7 +1254,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf133191) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf132594) { loadFromFile(u"xlsx/chart_pie2007.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1279,7 +1279,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134255) skipValidation(); // export test - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1309,7 +1309,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134977) skipValidation(); //export test - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, @@ -1321,7 +1321,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf134977) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123647) { loadFromFile(u"xlsx/empty_chart.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1335,7 +1335,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf136267) // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1348,7 +1348,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf136267) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataLabelPlacementPieChart) { loadFromFile(u"xlsx/tdf134978.xlsx"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference xChartDoc(getChartCompFromSheet(0, 0), UNO_QUERY_THROW); // test the placement of the manually positioned label Reference xDataPointPropSet( @@ -1367,7 +1367,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf137917) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1438,7 +1438,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138204) // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1482,7 +1482,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf138181) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomShapeText) { loadFromFile(u"ods/tdf72776.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); Reference xChartDoc(getChartDocFromSheet(0), UNO_QUERY_THROW); // test that the text of custom shape exists inside the chart Reference xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); @@ -1497,7 +1497,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomShapeText) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesXLSX) { loadFromFile(u"xlsx/tdf128621.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1525,7 +1525,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesDOCX) { loadFromFile(u"docx/tdf143130.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1553,7 +1553,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testuserShapesDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testGraphicBlipXLSX) { loadFromFile(u"xlsx/tdf143127.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1581,7 +1581,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testGraphicBlipXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNameRangeXLSX) { loadFromFile(u"xlsx/chart_with_name_range.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // test the syntax of local range name on the local sheet. @@ -1630,7 +1630,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf143942) // FIXME: validation error in OOXML export: Errors: 4 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1670,7 +1670,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDateCategoriesPPTX) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1730,7 +1730,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testDataTableImportExport) CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Keys"_ustr) >>= bKeys); CPPUNIT_ASSERT_EQUAL(false, bKeys); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { uno::Reference xChartDoc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc.is()); @@ -1760,7 +1760,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf166249) loadFromFile(u"xlsx/tdf166249.xlsx"); // FIXME: validation error in OOXML export skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx index f8655e99a3fe..31d407cbe787 100644 --- a/chart2/qa/extras/chart2export3.cxx +++ b/chart2/qa/extras/chart2export3.cxx @@ -31,7 +31,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val", u"1"); @@ -42,7 +42,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf108107) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139) { loadFromFile(u"xlsx/tdf114139.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf114139) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224) { loadFromFile(u"ods/tdf64224.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -67,7 +67,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf64224) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX) { loadFromFile(u"docx/testChartTitlePropertiesColorFill.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000"); @@ -77,7 +77,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX) { loadFromFile(u"docx/testChartTitlePropertiesGradientFill.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", u"cccccc"); @@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillDOCX CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillDOCX) { loadFromFile(u"docx/testChartTitlePropertiesBitmapFill.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", u"rId1"); @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyDOCX) { // Test color gradient (two color) with gradient transparency loadFromFile(u"docx/testColorGradientWithTransparency.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Test the transparency of the first color @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientWithTransparencyODS) { // Test color gradient (two color) with simple transparency loadFromFile(u"ods/testColorGradientWithTransparency.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Test the transparency of the first color @@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX) { // Test color gradient (two color) stop of the first color loadFromFile(u"xlsx/tdf128619.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Test the position of the first color @@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testColorGradientStopXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX) { loadFromFile(u"docx/tdf128794.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Test the gradient style (if there is no 'a:path' attribute, it is a linear gradient) @@ -154,7 +154,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRadialColorGradientDOCX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropDOCX) { loadFromFile(u"docx/testBarChartDataPointPropDOCX.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -177,7 +177,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos) // FIXME: validation error in OOXML export: Errors: 1 skipValidation(); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); 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", u"outEnd"); @@ -189,7 +189,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFdo83058dlblPos) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX) { loadFromFile(u"xlsx/autotitledel_2007.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", u"0"); @@ -198,7 +198,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDelXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX) { loadFromFile(u"xlsx/dispBlanksAs_2007.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", u"gap"); @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDispBlanksAsXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX) { loadFromFile(u"xlsx/markerColor.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:spPr/a:solidFill/a:srgbClr", "val", u"92d050"); @@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMarkerColorXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX) { loadFromFile(u"xlsx/markerColor.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:roundedCorners", "val", u"0"); @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testRoundedCornersXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisNumberFormatXLSX) { loadFromFile(u"ods/axis_number_format.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx", 2); @@ -243,7 +243,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) loadFromFile(u"ods/tdf123774.ods"); { - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", "formatCode", u"[$-40E]0.00%"); @@ -255,7 +255,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataPointLabelNumberFormatXLSX) loadFromFile(u"xlsx/tdf130986.xlsx"); { - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl/c:idx", "val", u"1"); @@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelDefaultValuesXLSX) CPPUNIT_ASSERT(aAny >>= aLabel); CPPUNIT_ASSERT(aLabel.ShowNumber); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:showVal", "val", u"1"); @@ -292,7 +292,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor) sal_Int32 nLabelFillColor; CPPUNIT_ASSERT(aAny >>= nLabelFillColor); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:spPr/a:solidFill/a:srgbClr", "val", u"f79646"); @@ -301,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testDataLabelFillColor) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX) { loadFromFile(u"xlsx/chart_title.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", u"0"); @@ -310,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleOverlayXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX) { loadFromFile(u"xlsx/bar_chart_simple.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", u"0"); @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testInvertIfNegativeXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX) { loadFromFile(u"xlsx/bubble_chart_simple.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[1]/c:bubble3D", "val", u"0"); @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBubble3DXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX) { loadFromFile(u"xlsx/no_marker.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:marker/c:symbol", "val", u"none"); @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testNoMarkerXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX) { loadFromFile(u"xlsx/title_manual_layout.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:layout/c:manualLayout/c:layoutTarget", 0); @@ -365,7 +365,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleManualLayoutXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX) { loadFromFile(u"xlsx/plot_area_manual_layout.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -399,7 +399,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotAreaManualLayoutXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testLegendManualLayoutXLSX) { loadFromFile(u"xlsx/legend_manual_layout.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -436,7 +436,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testLegendManualLayoutXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle) { loadFromFile(u"ods/testChartSubTitle.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // test properties of subtitle @@ -457,7 +457,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle) { loadFromFile(u"ods/testChartMainWithSubTitle.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // test properties of title @@ -480,7 +480,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartMainWithSubTitle) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted) { loadFromFile(u"xlsx/testAutoTitleDeleted.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:autoTitleDeleted", "val", u"1"); @@ -489,7 +489,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAutoTitleDeleted) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX) { loadFromFile(u"xlsx/testChartTitlePropertiesColorFill.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr", "val", u"ff0000"); @@ -499,7 +499,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesColorFillXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX) { loadFromFile(u"xlsx/testChartTitlePropertiesGradientFill.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", u"cccccc"); @@ -510,7 +510,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesGradientFillXLSX CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX) { loadFromFile(u"xlsx/testChartTitlePropertiesBitmapFill.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:blipFill/a:blip", "embed", u"rId1"); @@ -520,7 +520,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartTitlePropertiesBitmapFillXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX) { loadFromFile(u"xlsx/testBarChartDataPointPropXLSX.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -539,7 +539,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) { loadFromFile(u"xlsx/axis_character_properties.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -557,7 +557,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX) { loadFromFile(u"xlsx/title_character_properties.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -571,7 +571,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTitleCharacterPropertiesXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX) { loadFromFile(u"xlsx/hidden_cells.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -581,7 +581,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testPlotVisOnlyXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX) { loadFromFile(u"xlsx/tdf90876.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -591,7 +591,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartVaryColorsXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf96161) { loadFromFile(u"ods/tdf96161.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -605,7 +605,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTableOnPage3) // FIXME: validation error in OOXML export: Errors: 2 skipValidation(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); @@ -622,7 +622,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, tdf137691) { // given a doc where the banana negative data formats as ($123) and the pineapple data as $(123) loadFromFile(u"pptx/tdf137691_dataTable.pptx"); - saveAndReload(u"Impress MS PowerPoint 2007 XML"_ustr); + saveAndReload(TestFilter::PPTX_2007); Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); @@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, tdf137691) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) { loadFromFile(u"ods/multiple_axis.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -658,7 +658,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX) { loadFromFile(u"ods/secondary_axis.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -675,7 +675,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testSecondaryAxisXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartSecondaryAxisXLSX) { loadFromFile(u"xlsx/testSecondaryAxis.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Collect barchart axID on primary Axis @@ -694,7 +694,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartSecondaryAxisXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testEmptyCharts) { loadFromFile(u"odt/testEmptyCharts.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Make sure each chart exists in the respective XML xmlDocUniquePtr pXmlDoc = parseExport(u"word/charts/chart1.xml"_ustr); @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148142) xAxis->setScaleData(aScaleData); // Check the X axis position after export. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); Reference xChartDoc2 = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChartDoc2.is()); Reference xAxis2 = getAxisFromDoc(xChartDoc2, 0, 0, 0); @@ -741,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148142) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFormattedChartTitles) { loadFromFile(u"xlsx/tdf39052.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -896,7 +896,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testODSFormattedChartTitles) // The document contains a line chart with "Between tick marks" X axis position. loadFromFile(u"ods/tdf39052.ods"); // Check formatted strings after export. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); Reference xChart2Doc = getChartDocFromSheet(0); CPPUNIT_ASSERT(xChart2Doc.is()); @@ -911,7 +911,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testODSFormattedChartTitles) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148117) { loadFromFile(u"pptx/tdf148117.pptx"); - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); assertXPath(pXmlDoc, "/c:chartSpace/c:date1904", "val", u"0"); @@ -920,7 +920,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148117) CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, test1904NullDate) { loadFromFile(u"pptx/1904NullDate.pptx"); - saveAndReload(u"Impress MS PowerPoint 2007 XML"_ustr); + saveAndReload(TestFilter::PPTX_2007); Reference xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); Reference xPropSet(xChartDoc, uno::UNO_QUERY); diff --git a/chart2/qa/extras/chart2geometry.cxx b/chart2/qa/extras/chart2geometry.cxx index da871c776e6f..ade614b77386 100644 --- a/chart2/qa/extras/chart2geometry.cxx +++ b/chart2/qa/extras/chart2geometry.cxx @@ -74,7 +74,7 @@ void Chart2GeometryTest::testTdf135184RoundLineCap() { // It tests chart area, data series line and regression-curve line. loadFromFile(u"xlsx/tdf135184RoundLineCap.xlsx"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -103,7 +103,7 @@ void Chart2GeometryTest::testTdf135184RoundLineCap2() { // It tests legend, data series sector and title. loadFromFile(u"xlsx/tdf135184RoundLineCap2.xlsx"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -134,7 +134,7 @@ void Chart2GeometryTest::testTdf135184RoundLineCap3() { // It tests chart area, data series line and regression-curve line. loadFromFile(u"xlsx/tdf135184RoundLineCap.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -152,7 +152,7 @@ void Chart2GeometryTest::testTdf135184RoundLineCap4() { // It tests legend, data series sector and title. loadFromFile(u"xlsx/tdf135184RoundLineCap2.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -177,7 +177,7 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_export() // ODF im/export for MCGR is integrated // Make sure the chart area has a transparency in gradient stops in saved pptx file. - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -203,7 +203,7 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import() loadFromFile(u"pptx/tdf128345_ChartArea_CG_TS.pptx"); // Find transparency gradient name - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); const OUString sOUChartStyleName = getXPathContent( @@ -218,7 +218,7 @@ void Chart2GeometryTest::testTdf128345ChartArea_CG_TS_import() = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); // Verify the content of the opacity definition - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc2 = parseExport(u"Object 1/styles.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc2); const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); @@ -238,7 +238,7 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_export() loadFromFile(u"odp/tdf128345_ChartWall_CS_TG.odp"); // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -257,7 +257,7 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_import() loadFromFile(u"pptx/tdf128345_ChartWall_CS_TG.pptx"); // Find transparency gradient name - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); const OUString sOUChartStyleName @@ -272,7 +272,7 @@ void Chart2GeometryTest::testTdf128345ChartWall_CS_TG_import() = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); // Verify content of the opacity definition - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc2 = parseExport(u"Object 1/styles.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc2); const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); @@ -290,7 +290,7 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_export() loadFromFile(u"odp/tdf128345_Legend_CS_TG_axial.odp"); // Make sure the chart has a gradient with transparency in gradient stops in saved pptx file. - save(u"Impress MS PowerPoint 2007 XML"_ustr); + save(TestFilter::PPTX_2007); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -319,7 +319,7 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() loadFromFile(u"pptx/tdf128345_Legend_CS_TG_axial.pptx"); // Find transparency gradient name - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); const OUString sOUChartStyleName @@ -334,7 +334,7 @@ void Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() = getXPathContent(pXmlDoc, sStylePath + "/style:graphic-properties/@draw:opacity-name"); // Verify content of the opacity definition - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc2 = parseExport(u"Object 1/styles.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc2); const OString sAttribute("@draw:name='" + OU2O(sOUOpacityName) + "'"); @@ -439,7 +439,7 @@ void Chart2GeometryTest::testTdf135366LabelExport() // FIXME: Error: unexpected attribute "loext:label-stroke-color" skipValidation(); - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -468,7 +468,7 @@ void Chart2GeometryTest::testTdf135366_CustomLabelText() // although the used element exists since ODF 1.2. SetODFDefaultVersion(SvtSaveOptions::ODFVER_012); loadFromFile(u"pptx/tdf135366_CustomLabelText.pptx"); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx index c20efb0f6835..159884c12268 100644 --- a/chart2/qa/extras/chart2import2.cxx +++ b/chart2/qa/extras/chart2import2.cxx @@ -942,7 +942,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf166428) // The attribute table:cell-range-address does not exist in ODF 1.4. and therefore may not be // be written. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/content.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:chart/chart:chart/" diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx index 4fab96055822..3d8c3a23e015 100644 --- a/filter/qa/unit/svg.cxx +++ b/filter/qa/unit/svg.cxx @@ -79,7 +79,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentLine) loadFromFile(u"semi-transparent-line.odg"); // Export it to SVG. - save(u"draw_svg_Export"_ustr); + save(TestFilter::SVG_DRAW); // Get the style of the group around the actual element. xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -99,7 +99,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentFillWithTransparentLine) loadFromFile(u"semi-transparent-fill.odg"); // Export it to SVG. - save(u"draw_svg_Export"_ustr); + save(TestFilter::SVG_DRAW); // Get the style of the group around the actual element. xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -128,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentText) loadFromFile(u"TransparentText.odg"); // Export to SVG. - save(u"draw_svg_Export"_ustr); + save(TestFilter::SVG_DRAW); xmlDocUniquePtr pXmlDoc = parseExportedFile(); // We expect 2 groups of class "TextShape" that @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentMultiParaText) xShapeProps->setPropertyValue(u"CharTransparence"_ustr, uno::Any(static_cast(20))); // When exporting to SVG: - save(u"draw_svg_Export"_ustr); + save(TestFilter::SVG_DRAW); // Then make sure that the two semi-transparent paragraphs have the same X position: xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -215,7 +215,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testCustomBullet) loadFromFile(u"custom-bullet.fodp"); // When exporting that to SVG: - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); // Then make sure the bullet glyph is not lost: xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -235,7 +235,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, attributeRedefinedTest) loadFromFile(u"attributeRedefinedTest.odp"); // Export to SVG. - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr pXmlDoc = parseExportedFile(); // We expect four paragraph @@ -279,7 +279,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testTab) xShapeText->setString(u"A\tB"_ustr); // When exporting that document to SVG: - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); // Then make sure the tab is not lost: xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -296,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, textInImage) loadFromFile(u"text-in-image.odp"); // Export to SVG. - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -314,7 +314,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentTextBullet) loadFromFile(u"semi-transparent-text-bullet.odg"); // When exporting to SVG: - save(u"draw_svg_Export"_ustr); + save(TestFilter::SVG_DRAW); // Then make sure the result is correct: xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -342,7 +342,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testMapModeText) loadFromFile(u"YAxis.odg"); // Export to SVG. - save(u"draw_svg_Export"_ustr); + save(TestFilter::SVG_DRAW); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -370,7 +370,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testTdf91315) // Load a presentation containing RTL text loadFromFile(u"tdf91315.fodp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -385,7 +385,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testTdf166789) // A fit-to-size text loadFromFile(u"fit-to-size-text.fodg"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr pXmlDoc = parseExportedFile(); diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index a7b12bc10263..f5b3e62d48b3 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -23,6 +23,94 @@ #include #include +enum class TestFilter +{ + NONE, + CSV, + DOC, + DOCBOOK, + DOCM, + DOCX, + DOCX_2007, + DOTX, + FODG, + FODS, + FODT, + HTML_CALC, + HTML_IMPRESS, + HTML_WRITER, + MD, + MML, + ODB, + ODG, + ODM, + ODP, + ODS, + ODT, + OTT, + PDF_WRITER, + POTX, + PPT, + PPTM, + PPTX, + PPTX_2007, + RTF, + SVG_DRAW, + SVG_IMPRESS, + TEXT, + TEXT_ENCODED, + XHTML_CALC, + XHTML_DRAW, + XHTML_WRITER, + XLS, + XLSM, + XLST, + XLSX, +}; + +const std::unordered_map TestFilterNames{ + { TestFilter::CSV, u"Text - txt - csv (StarCalc)"_ustr }, + { TestFilter::DOC, u"MS Word 97"_ustr }, + { TestFilter::DOCBOOK, u"DocBook File"_ustr }, + { TestFilter::DOCM, u"MS Word 2007 XML VBA"_ustr }, + { TestFilter::DOCX, u"Office Open XML Text"_ustr }, + { TestFilter::DOCX_2007, u"MS Word 2007 XML"_ustr }, + { TestFilter::DOTX, u"MS Word 2007 XML Template"_ustr }, + { TestFilter::FODG, u"OpenDocument Drawing Flat XML"_ustr }, + { TestFilter::FODS, u"OpenDocument Spreadsheet Flat XML"_ustr }, + { TestFilter::FODT, u"OpenDocument Text Flat XML"_ustr }, + { TestFilter::HTML_CALC, u"HTML (StarCalc)"_ustr }, + { TestFilter::HTML_IMPRESS, u"impress_html_Export"_ustr }, + { TestFilter::HTML_WRITER, u"HTML (StarWriter)"_ustr }, + { TestFilter::MD, u"Markdown"_ustr }, + { TestFilter::MML, u"MathML XML (Math)"_ustr }, + { TestFilter::ODB, u"StarOffice XML (Base)"_ustr }, + { TestFilter::ODG, u"draw8"_ustr }, + { TestFilter::ODM, u"writerglobal8_writer"_ustr }, + { TestFilter::ODP, u"impress8"_ustr }, + { TestFilter::ODS, u"calc8"_ustr }, + { TestFilter::ODT, u"writer8"_ustr }, + { TestFilter::OTT, u"writer8_template"_ustr }, + { TestFilter::PDF_WRITER, u"writer_pdf_Export"_ustr }, + { TestFilter::POTX, u"Impress Office Open XML Template"_ustr }, + { TestFilter::PPT, u"MS PowerPoint 97"_ustr }, + { TestFilter::PPTM, u"Impress MS PowerPoint 2007 XML VBA"_ustr }, + { TestFilter::PPTX, u"Impress Office Open XML"_ustr }, + { TestFilter::PPTX_2007, u"Impress MS PowerPoint 2007 XML"_ustr }, + { TestFilter::RTF, u"Rich Text Format"_ustr }, + { TestFilter::SVG_DRAW, u"draw_svg_Export"_ustr }, + { TestFilter::SVG_IMPRESS, u"impress_svg_Export"_ustr }, + { TestFilter::TEXT, u"Text"_ustr }, + { TestFilter::TEXT_ENCODED, u"Text (encoded)"_ustr }, + { TestFilter::XHTML_CALC, u"XHTML Calc File"_ustr }, + { TestFilter::XHTML_DRAW, u"XHTML Draw File"_ustr }, + { TestFilter::XHTML_WRITER, u"XHTML Writer File"_ustr }, + { TestFilter::XLS, u"MS Excel 97"_ustr }, + { TestFilter::XLSM, u"Calc MS Excel 2007 VBA XML"_ustr }, + { TestFilter::XLST, u"Calc MS Excel 2007 XML Template"_ustr }, + { TestFilter::XLSX, u"Calc Office Open XML"_ustr }, +}; + // basic uno api test class class OOO_DLLPUBLIC_TEST UnoApiTest : public test::BootstrapFixture, public unotest::MacrosTest @@ -43,9 +131,9 @@ public: css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence& rParams = {}); - void save(const OUString& rFilter, const char* pPassword = nullptr); + void save(TestFilter eFilter, const char* pPassword = nullptr); void saveWithParams(const css::uno::Sequence& rParams); - void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); + void saveAndReload(TestFilter eFilter, const char* pPassword = nullptr); std::unique_ptr parsePDFExport(const OString& rPassword = OString()); diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index 2c38faff9285..e9e67c8c62b3 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -74,7 +74,7 @@ public: CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTransparentText) { loadFromFile(u"transparent-text.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), @@ -98,7 +98,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTransparentText) CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf131082) { loadFromFile(u"tdf131082.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), @@ -314,7 +314,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow) // was lost on import. verify(mxComponent); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // Without the accompanying fix in place, this test would have failed, because shadow on a table // was lost on export. @@ -343,7 +343,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf142605_CurveSize) // rectangle of the shape. Error was, that the export uses a path size which included the // control points. loadFromFile(u"tdf142605_CurveSize.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); auto xPage = xDrawPagesSupplier->getDrawPages()->getByIndex(0); diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index 30273cd2acf2..33c8d1d29736 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -31,7 +31,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPolylineConnectorPosition) // Given a document with a group shape and therein a polyline and a connector. loadFromFile(u"tdf141786_PolylineConnectorInGroup.odt"); // When saving that to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure polyline and connector have the correct position. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -60,7 +60,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRotatedShapePosition) skipValidation(); // When saving that to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the rotated child shape has the correct position. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -80,7 +80,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlOdt) dispatchCommand(mxComponent, u".uno:TrackChanges"_ustr, {}); dispatchCommand(mxComponent, u".uno:InsertCheckboxContentControl"_ustr, {}); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // validate(maTempFile.GetFileName(), test::OOXML); // Enable when unrelated errors are fixed. } @@ -93,7 +93,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlDocx) // when exporting to docx. dispatchCommand(mxComponent, u".uno:InsertCheckboxContentControl"_ustr, {}); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // validate(maTempFile.GetFileName(), test::OOXML); // Enable when unrelated errors are fixed. } @@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlDocx) dispatchCommand(mxComponent, u".uno:InsertCheckboxContentControl"_ustr, {}); // Loading should not show the "corrupted" dialog, which would assert. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Now that we loaded it successfully, delete the controls, // still with change-tracking enabled, and save. @@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlDocx) dispatchCommand(mxComponent, u".uno:Delete"_ustr, {}); // Loading should not show the "corrupted" dialog, which would assert. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // validate(maTempFile.GetFileName(), test::OOXML); // Enable when unrelated errors are fixed. } } @@ -137,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapePolygon) skipValidation(); // When saving that to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the group shape, the group shape's child size and the child shape's size // match: @@ -158,7 +158,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport) skipValidation(); // When saving that to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then the shapes should retain their correct control values. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -344,7 +344,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCameraRevolutionGrabBag) loadFromFile(u"camera-rotation-revolution-nonwps.pptx"); // When saving that document: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the revolution is exported without a problem: @@ -369,7 +369,7 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) loadFromFile(u"refer-to-theme.pptx"); // When saving that document: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the shape text color is a scheme color: @@ -410,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeColor_ShapeFill) loadFromFile(u"ReferenceShapeFill.fodp"); // When saving that document: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Then make sure the shape fill color is a scheme color. // Note that this was already working from PPTX files via grab-bags, @@ -426,7 +426,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSi loadFromFile(u"endParaRPr-newline-textsize.pptx"); // When saving that document: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Make sure the text size is exported correctly: @@ -445,7 +445,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_endsubpath) loadFromFile(u"tdf147978_endsubpath.odp"); // When saving that document: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the pathLst has two child elements, @@ -462,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandA) loadFromFile(u"tdf147978_enhancedPath_commandA.odp"); // When saving that document: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the path has a child element arcTo. Prior to the fix that part of the curve was @@ -483,7 +483,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandT) loadFromFile(u"tdf147978_enhancedPath_commandT.odp"); // Export to pptx had only exported the command M and has used a wrong path size - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandXY) loadFromFile(u"tdf147978_enhancedPath_commandXY.odp"); // Export to pptx had dropped commands X and Y. - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -546,7 +546,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandHIJK) loadFromFile(u"tdf147978_enhancedPath_commandHIJK.odp"); // Export to pptx had dropped commands X and Y. - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -568,7 +568,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_subpath) loadFromFile(u"tdf147978_enhancedPath_subpath.pptx"); // Export to pptx had dropped the subpaths. - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -588,7 +588,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100391TextAreaRect) // The document has a custom shape of type "non-primitive" to trigger the custGeom export loadFromFile(u"tdf100391_TextAreaRect.odp"); // When saving to PPTX the textarea rect was set to default instead of using the actual area - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. Without fix the values were l="l", t="t", r="r", b="b" xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -613,7 +613,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109169_OctagonBevel) skipValidation(); // Export to docx had not written a:fill or a:stroke attributes at all. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Verify the markup: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -634,7 +634,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFaultyPathCommandsAWT) // instead of the normally used lnTo. If a lnTo is written, MS Office shows nothing of the shape. loadFromFile(u"FaultyPathStart.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -652,7 +652,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148784StretchXY) // When saving to PPTX the attributes stretchpoint-x and stretchpoint-y were not considered. The // line at right and bottom edge were positioned inside as if the shape had a square size. loadFromFile(u"tdf148784_StretchXY.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -688,7 +688,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148784StretchCommandQ) // When saving to PPTX the attributes stretchpoint-x and stretchpoint-y were not considered. // That results in wrong arcs on the right or bottom side of the shape. loadFromFile(u"tdf148784_StretchCommandQ.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -727,7 +727,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148784StretchCommandVW) // When saving to PPTX the attributes stretchpoint-x and stretchpoint-y were not considered. // That results in circles instead of ellipses. loadFromFile(u"tdf148784_StretchCommandVW.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -761,7 +761,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551VertPadding) // has paddings lIns="720000"=2cm, tIns="360000"=1cm, rIns="0" and bIns="0". // After load and save the paddings were rotated and a 90deg text rotation was added. loadFromFile(u"tdf149551_vert_and_padding.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. The values must be the same as in the original file. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -783,7 +783,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149538upright) // attribute but no 'rot' attribute. Without the fix the 'rot' attribute with values from // the emulation was written out. loadFromFile(u"tdf149538_upright.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. The values must be the same as in the original file. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -794,7 +794,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149538upright) CPPUNIT_TEST_FIXTURE(Test, testTdf151008VertAnchor) { loadFromFile(u"tdf151008_eaVertAnchor.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // The order of the shapes in the file is by name "Right", "Center", "Left", "RightMiddle", // "CenterMiddle" and "LeftMiddle". I access the shapes here by index, because the XPath is @@ -830,7 +830,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkBitmapFill) skipValidation(); // Saving that to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Make sure it is exported to VML and has no txbxContent but a textpath element. Without fix it // was exported as DML 'abc transform', but that is not able to use bitmap fill in Word. @@ -861,7 +861,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkFontProperties) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Make sure the style attribute of the textpath element has the needed items. Without fix only // font-family and font-size were written. @@ -897,7 +897,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkSlantUp) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. I could identify the following two problems to hinder Word from // accepting the markup. There might exist more problems. @@ -924,7 +924,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkArchUp) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -946,7 +946,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLAdjustmentExport) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -974,7 +974,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkDirectColor) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1009,7 +1009,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1057,7 +1057,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkDistance) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1080,7 +1080,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkLinGradientRGBColor) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1127,7 +1127,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkAxialGradientTransparency) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1177,7 +1177,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkRadialGradient) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1219,7 +1219,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkEllipticalGradient) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1263,7 +1263,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkSquareGradient) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1305,7 +1305,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkRectGradient) skipValidation(); // Save to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Examine the saved markup. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1351,7 +1351,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeColorTransparency) // Without fix the transparency was not written to file. loadFromFile(u"tdf139618_ThemeColorTransparency.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Make sure a:alpha is written for line color and for fill color. @@ -1377,7 +1377,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeFontTypeface) loadFromFile(u"tdf155412_typeface.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/theme/theme1.xml"_ustr); // Make sure typeface is written. @@ -1392,7 +1392,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157289CircularArrowExport) // the ellipse bounding box is defined by bottom-right vertex first and then top-left vertex. // When saving to PPTX this had resulted in negative radii for the ellipse. loadFromFile(u"tdf157289_circularArrow_export.fodp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Verify the markup. Both wR and hR must be positive. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1406,7 +1406,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) // which is similar. If autoGrowWidth and autoGrowHeight are set in the document, // then they are exported to pptx as TextWordWrap = "none". loadFromFile(u"tdf134401_ExportAutoGrowToTextWordWrap.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // There are 2 shapes in the test file. // The 1. shape is without autoGrowWidth/Height. @@ -1420,7 +1420,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) CPPUNIT_TEST_FIXTURE(Test, testTdf163803_ImageFill) { loadFromFile(u"tdf163803_image_with_fill.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Check that the fill color is saved: @@ -1439,7 +1439,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPPTXExportOutlinerListStyle) loadFromFile(u"outliner-list-style.odp"); // When saving to PPTX: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Then make sure that the list style of the outliner shape on the master page is written: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slideMasters/slideMaster1.xml"_ustr); diff --git a/oox/qa/unit/mcgr.cxx b/oox/qa/unit/mcgr.cxx index b327c710585e..150be70ce862 100644 --- a/oox/qa/unit/mcgr.cxx +++ b/oox/qa/unit/mcgr.cxx @@ -28,7 +28,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradient) // Given a document with three-color gradient on a Fontwork. loadFromFile(u"MCGR_FontworkColorGradient.fodp"); // Save it to PPTX - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // And make sure a multi-color gradient fill is exported. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // linear gradient with 30deg angle @@ -51,7 +51,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradientWord) // Given a document with three-color gradient on a Fontwork. loadFromFile(u"MCGR_FontworkColorGradient.fodt"); // Save it to DOCX - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // And make sure a multi-color gradient fill is exported. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // linear gradient with 30deg angle @@ -75,7 +75,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testTdf155825_SourcOffsetRangeDifferent) // Save it to PPTX // Without fix, a debug-build would have crashed in oox/source/export/drawingml.cxx from // assert(false && "oox::WriteGradientFill: non-synchronized gradients (!)"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); } CPPUNIT_TEST_FIXTURE(TestMCGR, testStepCount) @@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testStepCount) // Given a document with two-color gradient with StepCount 4. loadFromFile(u"tdf155852_MCGR_StepCount4.fodp"); // Save it to PPTX - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Without the fix the colors in the sections were wrong. And when opening a file with StepCount @@ -109,7 +109,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testAxialColorLinearTrans) // two-stop linear transparency gradient from start 80% to end 0%. loadFromFile(u"tdf155827_MCGR_AxialColorLinearTrans.fodp"); // Save it to PPTX - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // OOXML has transparency together with color. Transparency is stored as opacity. // Expected: pos 0 #00ffff 20000, pos 50000 #ff0000 60000, pos 100000 #00ffff 100000. // Because of conversion through gray color the opacity values are not exact. If rounding diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx index da66f8f9c4f5..d83496885a33 100644 --- a/oox/qa/unit/testscene3d.cxx +++ b/oox/qa/unit/testscene3d.cxx @@ -535,7 +535,7 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_material_wireframe) uno::Reference xShape(getShape(0, 0)); // Make sure the export to ODF has the corresponding attributes. - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, @@ -631,7 +631,7 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_shape_rotation) uno::Reference xShape(getShape(0, 0)); // Make sure that the immediate export to pptx has the same shape rotation - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "//p:spPr/a:xfrm", "rot", u"300000"); } diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx index 01847301a1d8..2eecdd93fab2 100644 --- a/oox/qa/unit/vml.cxx +++ b/oox/qa/unit/vml.cxx @@ -212,7 +212,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testWriterFontworkTrimTrue) // FIXME: tdf#153183 validation error in OOXML export: Errors: 1 // Attribute 'ID' is not allowed to appear in element 'v:shape'. skipValidation(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xShape(xDrawPageSupplier->getDrawPage()->getByIndex(0), diff --git a/sc/qa/extras/htmlexporttest.cxx b/sc/qa/extras/htmlexporttest.cxx index fba86ddf3cbd..24bfe60c024b 100644 --- a/sc/qa/extras/htmlexporttest.cxx +++ b/sc/qa/extras/htmlexporttest.cxx @@ -22,7 +22,7 @@ public: void testHtmlSkipImage() { loadFromFile(u"BaseForHTMLExport.ods"); - save(u"HTML (StarCalc)"_ustr); + save(TestFilter::HTML_CALC); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT (pDoc); @@ -30,7 +30,7 @@ public: assertXPath(pDoc, "/html/body/table/tr/td/img", 1); setFilterOptions(u"SkipImages"_ustr); - save(u"HTML (StarCalc)"_ustr); + save(TestFilter::HTML_CALC); pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT (pDoc); @@ -41,7 +41,7 @@ public: void testTdf155244() { loadFromFile(u"default-styles.ods"); - save(u"XHTML Calc File"_ustr); + save(TestFilter::XHTML_CALC); xmlDocUniquePtr pXmlDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pXmlDoc); diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 0973796d20ec..7a3f514b659e 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf146742) createScDoc("tdf146742.ods"); // Export to ODS and reload the file - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"1"_ustr, pDoc->GetString(ScAddress(0,0,0))); @@ -164,7 +164,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testMacroButtonFormControlXlsxExport) createScDoc("macro-button-form-control.xlsm"); // When exporting to XLSM: - save(u"Calc MS Excel 2007 VBA XML"_ustr); + save(TestFilter::XLSM); // Then make sure that the macro is associated with the control: xmlDocUniquePtr pSheetDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); @@ -188,7 +188,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf104902) executeMacro(u"vnd.sun.Star.script:Standard.Module1.display_bug?language=Basic&location=document"_ustr); // Export to ODS - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); @@ -231,7 +231,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf142033) executeMacro(u"vnd.sun.Star.script:Standard.Module1.display_bug?language=Basic&location=document"_ustr); // Export to ODS - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"string no newlines"_ustr, pDoc->GetString(ScAddress(0,0,0))); @@ -253,7 +253,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf89920) "location=document"_ustr); // Export to ODS - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pContentXml); @@ -301,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedUnicodeString) CPPUNIT_ASSERT(xLC->isLibraryLoaded(sLibName)); // Now check that saving stores Unicode data correctly in image's string pool - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { Any aRet = executeMacro(sMacroURL); @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedArrayInUserType) CPPUNIT_ASSERT(xLC->isLibraryLoaded(sLibName)); // Now check that saving stores array bounds correctly - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { Any aRet = executeMacro(sMacroURL); @@ -469,7 +469,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf71271) xProps->setPropertyValue(u"CodeName"_ustr, uno::Any(u"NewCodeName"_ustr)); } - saveAndReload(u""_ustr); + saveAndReload(TestFilter::ODS); { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); @@ -507,7 +507,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf75263) CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); } - saveAndReload(u"Calc MS Excel 2007 VBA XML"_ustr); + saveAndReload(TestFilter::XLSM); { ScDocument* pDoc = getScDoc(); diff --git a/sc/qa/extras/scsolverobj.cxx b/sc/qa/extras/scsolverobj.cxx index 0537b6e4f4ff..2572fcc070c8 100644 --- a/sc/qa/extras/scsolverobj.cxx +++ b/sc/qa/extras/scsolverobj.cxx @@ -160,7 +160,7 @@ void ScSolverSettingsObj::testXSolverSettings() CPPUNIT_ASSERT_EQUAL(uno::Any(static_cast(10)), aEngProps[5].Value); // Save file and reload to check if solver settings are still there - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference xDoc2(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xIndex2(xDoc2->getSheets(), uno::UNO_QUERY_THROW); uno::Reference xSheet2(xIndex2->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/unit/PivotTableFormatsImportExport.cxx b/sc/qa/unit/PivotTableFormatsImportExport.cxx index bbe3c251e22a..ca58c0f8002d 100644 --- a/sc/qa/unit/PivotTableFormatsImportExport.cxx +++ b/sc/qa/unit/PivotTableFormatsImportExport.cxx @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_1_DataFieldInRow_RowLabelColor.xlsx"); assertDataFieldInRow_RowLabelColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertDataFieldInRow_RowLabelColor(*getScDoc()); } @@ -122,7 +122,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc( "xlsx/pivot-table/PivotTableCellFormatsTest_2_DataFieldInRow_ColumnLabelColor.xlsx"); assertDataFieldInRow_ColumnLabelColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertDataFieldInRow_ColumnLabelColor(*getScDoc()); } @@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc( "xlsx/pivot-table/PivotTableCellFormatsTest_3_DataFieldInColumn_ColumnLabelColor.xlsx"); assertDataFieldInColumn_ColumnLabelColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertDataFieldInColumn_ColumnLabelColor(*getScDoc()); } @@ -166,7 +166,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_4_DataFieldInColumn_DataColor.xlsx"); assertDataFieldInColumn_DataColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertDataFieldInColumn_DataColor(*getScDoc()); } @@ -193,7 +193,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc("xlsx/pivot-table//" "PivotTableCellFormatsTest_5_DataFieldInColumnAndTwoRowFields_DataColor.xlsx"); assertDataFieldInColumnAndTwoRowFields_DataColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertDataFieldInColumnAndTwoRowFields_DataColor(*getScDoc()); } @@ -209,7 +209,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc( "xlsx/pivot-table//PivotTableCellFormatsTest_6_SingleDataFieldInColumn_DataColor.xlsx"); assertSingleDataFieldInColumn_DataColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertSingleDataFieldInColumn_DataColor(*getScDoc()); } @@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc( "xlsx/pivot-table//PivotTableCellFormatsTest_7_TwoRowTwoColumnFields_DataColor.xlsx"); assertTwoRowTwoColumnFields_DataColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertTwoRowTwoColumnFields_DataColor(*getScDoc()); } @@ -251,7 +251,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_8_DataFieldInRow_DataColor.xlsx"); assertDataFieldInRow_DataColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertDataFieldInRow_DataColor(*getScDoc()); } @@ -267,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx"); assertMultipleSelections(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertMultipleSelections(*getScDoc()); } @@ -315,7 +315,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_11_WholeDataColumnSelected.xlsx"); assertWholeDataColumnSelected(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertWholeDataColumnSelected(*getScDoc()); } @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_12_WholeLabelColumnSelected.xlsx"); assertWholeLabelColumnSelected(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertWholeLabelColumnSelected(*getScDoc()); } @@ -363,7 +363,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, { createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_13_SelectionInLabelAndData.xlsx"); assertSelectionInLabelAndData(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertSelectionInLabelAndData(*getScDoc()); } @@ -390,7 +390,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc("xlsx/pivot-table/" "PivotTableCellFormatsTest_14_TwoRowsDataFieldInColumn_LabelColor.xlsx"); assertTwoRowsDataFieldInColumn_LabelColor(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertTwoRowsDataFieldInColumn_LabelColor(*getScDoc()); } @@ -418,7 +418,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, createScDoc("xlsx/pivot-table/" "PivotTableCellFormatsTest_15_TwoDataFieldColumns_WholeDataColumnSelected.xlsx"); assertTwoDataFieldColumns_WholeDataColumnSelected(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertTwoDataFieldColumns_WholeDataColumnSelected(*getScDoc()); } @@ -443,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, Pivot_Table_with_Cell_Prot { createScDoc("xlsx/pivot-table/Pivot_Table_with_Cell_Protection.xlsx"); assertFields_WithCellProtection(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); assertFields_WithCellProtection(*getScDoc()); } @@ -451,7 +451,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, Pivot_Table_with_No_Source { // We need to round-trip this document without crashing createScDoc("xlsx/pivot-table/PivotTableWithNoSourceData.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); } } // end anonymous namespace diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx index 3415ad7d6df5..44ae4918bcee 100644 --- a/sc/qa/unit/SparklineImportExportTest.cxx +++ b/sc/qa/unit/SparklineImportExportTest.cxx @@ -152,7 +152,7 @@ void SparklineImportExportTest::testSparklinesRoundtripXLSX() checkSparklines(*pModelObj->GetDocument()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); @@ -165,7 +165,7 @@ void SparklineImportExportTest::testSparklinesExportODS() loadFromFile(u"xlsx/Sparklines.xlsx"); // Save as ODS and check content.xml with XPath - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // We have 3 sparkline groups = 3 tables that contain sparklines @@ -216,7 +216,7 @@ void SparklineImportExportTest::testSparklinesRoundtripODS() checkSparklines(*pModelObj->GetDocument()); // Trigger export and import of sparklines - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); @@ -231,7 +231,7 @@ void SparklineImportExportTest::testNoSparklinesInDocumentXLSX() // Load the document containing NO sparklines loadFromFile(u"xlsx/empty.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -279,7 +279,7 @@ void SparklineImportExportTest::testSparklinesRoundtripThemeColorsODS() CPPUNIT_ASSERT(pModelObj); checkSparklineThemeColors(*pModelObj->GetDocument()); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); @@ -289,7 +289,7 @@ void SparklineImportExportTest::testSparklinesRoundtripThemeColorsODS() void SparklineImportExportTest::testSparklinesRoundtripThemeColorsOOXML() { loadFromFile(u"fods/Sparklines.fods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); diff --git a/sc/qa/unit/ThemeImportExportTest.cxx b/sc/qa/unit/ThemeImportExportTest.cxx index 82291c6a0bb9..ef91380650fd 100644 --- a/sc/qa/unit/ThemeImportExportTest.cxx +++ b/sc/qa/unit/ThemeImportExportTest.cxx @@ -73,7 +73,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportAndImport) CPPUNIT_ASSERT_EQUAL(u""_ustr, pTheme->getFormatScheme().getName()); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportOOXML) { loadFromFile(u"xlsx/CalcThemeTest.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); { xmlDocUniquePtr pXmlDoc = parseExport(u"xl/theme/theme1.xml"_ustr); @@ -220,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBackgroundThemeColorOOXML) { loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx"); checkCellBackgroundThemeColor(getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); checkCellBackgroundThemeColor(getScDoc()); } @@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBackgroundThemeColorODF) // Open the OOXML source loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx"); // Save as ODF and load again - checks import / export cycle - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Check the values and show that the document is unchanged and all the data preserved checkCellBackgroundThemeColor(getScDoc()); } @@ -291,7 +291,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellTextThemeColor) { loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx"); checkCellTextThemeColor(getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); checkCellTextThemeColor(getScDoc()); } @@ -300,7 +300,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellTextThemeColorODF) // Open the OOXML source loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx"); // Save as ODF and load again - checks import / export cycle - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Check the values and show that the document is unchanged and all the data preserved checkCellTextThemeColor(getScDoc()); } @@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBorderThemeColor) { loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx"); checkCellBorderThemeColor(getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); checkCellBorderThemeColor(getScDoc()); } @@ -429,7 +429,7 @@ CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testCellBorderThemeColorODF) // Open the OOXML source loadFromFile(u"xlsx/Test_ThemeColor_Text_Background_Border.xlsx"); // Save as ODF and load again - checks import / export cycle - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Check the values and show that the document is unchanged and all the data preserved checkCellBorderThemeColor(getScDoc()); } diff --git a/sc/qa/unit/cond_format.cxx b/sc/qa/unit/cond_format.cxx index 44d5b11ae782..031388fe2074 100644 --- a/sc/qa/unit/cond_format.cxx +++ b/sc/qa/unit/cond_format.cxx @@ -597,7 +597,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testColorScaleExportODS) { createScDoc("ods/colorscale.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); @@ -609,7 +609,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testColorScaleExportXLSX) { createScDoc("xlsx/colorscale.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); @@ -621,7 +621,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testDataBarExportODS) { createScDoc("ods/databar.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); @@ -632,7 +632,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testDataBarExportXLSX) { createScDoc("xlsx/databar.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); @@ -662,7 +662,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testComplexIconSetsXLSX) createScDoc("xlsx/complex_icon_set.xlsx"); verify(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); verify(); } @@ -684,12 +684,12 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testTdf162948) createScDoc("xlsx/tdf162948.xlsx"); verify(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); verify(); // FIXME: Error: tag name "calcext:icon-set" is not allowed. Possible tag names are: ,, skipValidation(); - saveAndReload(u"calc8"_ustr); // tdf#163337 + saveAndReload(TestFilter::ODS); // tdf#163337 verify(); } @@ -716,7 +716,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testTdf165383) createScDoc("ods/tdf165383.ods"); verify(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); verify(); } @@ -744,14 +744,14 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testTdf166669) createScDoc("ods/tdf166669.ods"); verify(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); verify(); } CPPUNIT_TEST_FIXTURE(CondFormatTest, testCondFormatExportCellIs) { createScDoc("xlsx/condFormat_cellis.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetCondFormList(0)->size()); @@ -784,7 +784,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatExportXLSX) { createScDoc("xlsx/new_cond_format_test_export.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); { OUString aCSVPath = createFilePath(u"contentCSV/new_cond_format_test_export.csv"); @@ -820,7 +820,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatExportODS) { createScDoc("ods/new_cond_format_test_export.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); OUString aCSVPath = createFilePath(u"contentCSV/new_cond_format_test_export.csv"); testCondFile(aCSVPath, pDoc, 0); @@ -842,7 +842,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatNumberInTextRule) pFormat->AddEntry(pEntry); pDocument->AddCondFormat(std::move(pFormat), 0); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDocument = getScDoc(); ScConditionalFormat* pCondFormat = pDocument->GetCondFormat(0, 0, 0); @@ -1045,7 +1045,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testCondFormatCfvoScaleValueXLSX) CPPUNIT_TEST_FIXTURE(CondFormatTest, testNumberFormatODS) { createScDoc("ods/testNumberFormats.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); sal_uInt32 nNumberFormat; const sal_Int32 nCountFormats = 18; @@ -1075,7 +1075,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testNumberFormatODS) CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatRangeListXLSX) { createScDoc("ods/conditionalformat_rangelist.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "//x:conditionalFormatting", "sqref", u"F4 F10"); @@ -1084,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatRangeListXLSX) CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatContainsTextXLSX) { createScDoc("ods/conditionalformat_containstext.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPathContent(pDoc, "//x:conditionalFormatting/x:cfRule/x:formula", @@ -1094,7 +1094,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatContainsTextXLSX) CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatPriorityCheckXLSX) { createScDoc("xlsx/conditional_fmt_checkpriority.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); constexpr bool bHighPriorityExtensionA1 @@ -1141,7 +1141,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatPriorityCheckXLSX) CPPUNIT_TEST_FIXTURE(CondFormatTest, testConditionalFormatOriginXLSX) { createScDoc("xlsx/conditional_fmt_origin.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); // tdf#124953 : The range-list is B3:C6 F1:G2, origin address in the formula should be B1, not B3. @@ -1160,7 +1160,7 @@ CPPUNIT_TEST_FIXTURE(CondFormatTest, testTdf79998) CPPUNIT_ASSERT_EQUAL(u"Utilities (FX Kurse, Kreditkarten etc)"_ustr, aTabNames1[1]); // check: saved XLSX document has truncated tab name - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); const std::vector aTabNames2 = pDoc->GetAllTableNames(); CPPUNIT_ASSERT_EQUAL(u"Utilities (FX Kurse, Kreditkart"_ustr, aTabNames2[1]); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 21fa1a74a098..96ce54695703 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -626,11 +626,11 @@ void ScModelTestBase::miscRowHeightsTest( TestParam const * aTestValues, unsigne for ( unsigned int index=0; indexGetValue(0, 0, 0)); } - saveAndReload(OUString::createFromAscii(format)); + saveAndReload(eFormat); { ScDocument* pDoc = getScDoc(); // Check again. @@ -116,7 +116,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeOds() CPPUNIT_ASSERT_EQUAL(u"=SUM(C:C)"_ustr, pDoc->GetFormula(1, 0, 0)); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"=SUM(2:2)"_ustr, pDoc->GetFormula(0, 0, 0)); @@ -137,7 +137,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeOds() void ScJumboSheetsTest::testRoundtripColumnRangeXlsx() { createScDoc("ods/sum-whole-column-row.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"=SUM(2:2)"_ustr, pDoc->GetFormula(0, 0, 0)); @@ -149,7 +149,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeXlsx() } } -void ScJumboSheetsTest::testRoundtripNamedRanges(const char* name, const char* format) +void ScJumboSheetsTest::testRoundtripNamedRanges(const char* name, TestFilter eFormat) { createScDoc(name); @@ -171,7 +171,7 @@ void ScJumboSheetsTest::testRoundtripNamedRanges(const char* name, const char* f } } - saveAndReload(OUString::createFromAscii(format)); + saveAndReload(eFormat); { ScDocument* pDoc = getScDoc(); for (const auto& range : ranges) @@ -185,12 +185,12 @@ void ScJumboSheetsTest::testRoundtripNamedRanges(const char* name, const char* f void ScJumboSheetsTest::testRoundtripNamedRangesOds() { - testRoundtripNamedRanges("ods/ranges-column-2000.ods", "calc8"); + testRoundtripNamedRanges("ods/ranges-column-2000.ods", TestFilter::ODS); } void ScJumboSheetsTest::testRoundtripNamedRangesXlsx() { - testRoundtripNamedRanges("ods/ranges-column-2000.ods", "Calc Office Open XML"); + testRoundtripNamedRanges("ods/ranges-column-2000.ods", TestFilter::XLSX); } void ScJumboSheetsTest::testNamedRangeNameConflict() diff --git a/sc/qa/unit/pivottable_filters_test.cxx b/sc/qa/unit/pivottable_filters_test.cxx index f3b0222c0572..9aaea68e8dc1 100644 --- a/sc/qa/unit/pivottable_filters_test.cxx +++ b/sc/qa/unit/pivottable_filters_test.cxx @@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBasicODS) CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123225PivotTableRowColItems) { createScDoc("ods/tdf123225_pivotTable_row_col_items.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -177,7 +177,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123225PivotTableRowColItems CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123225PivotTableNoColItems) { createScDoc("ods/tdf123225_pivotTable_no_col_items.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -235,7 +235,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123225PivotTableEmptyRowCol // this doc contains blank row/col items // (xl/pivotCache/pivotCacheDefinition1.xml) createScDoc("ods/tdf123225_pivotTable_empty_row_col_items.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -523,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedDateGroupXLSX) createScDoc("xlsx/pivot-table/shared-dategroup.xlsx"); testThis(*getScDoc()); // Now test round-trip of group fields - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); testThis(*getScDoc()); } @@ -566,7 +566,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableSharedNestedDateGrou createScDoc("xlsx/pivot-table/shared-nested-dategroup.xlsx"); testThis(*getScDoc()); // Now test round-trip of group fields - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); testThis(*getScDoc()); } @@ -702,7 +702,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableExportXLSX) createScDoc("xlsx/tdf89139_pivot_table.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -717,7 +717,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableExportXLSXSingleData { createScDoc("ods/tdf123421_1datafield.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -736,7 +736,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableExportXLSXMultipleDa { createScDoc("ods/tdf123421_2datafields.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -766,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotCacheExportXLSX) createScDoc("xlsx/pivot-table/with-strings-integers-and-dates.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pCacheDef = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pCacheDef); @@ -1130,7 +1130,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) bool bCheck = aTest.check(*pDoc); CPPUNIT_ASSERT_MESSAGE("Initial check failed.", bCheck); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); // Reload check. @@ -1251,7 +1251,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) bool bCheck = aTest.check(*pDoc); CPPUNIT_ASSERT_MESSAGE("Initial check failed.", bCheck); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); // Reload check. @@ -1264,7 +1264,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableMedianODS) createScDoc("ods/pivot-table-median.ods"); // Export the document and import again for a check - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Check sheet ScDocument* pDoc = getScDoc(); @@ -1327,7 +1327,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowHeaderXLS) } // Check also after a reload - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); // There should be exactly 2 pivot tables @@ -1367,7 +1367,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDoubleFieldFilter) CPPUNIT_ASSERT_EQUAL(static_cast(3), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(3), pDPs->GetCount()); @@ -1465,7 +1465,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableStringFieldFilter) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -1497,7 +1497,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDateFieldFilter) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -1584,7 +1584,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBoolFieldFilter) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -1616,7 +1616,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -1722,7 +1722,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableEmptyItem) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -1758,7 +1758,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTablePageFieldFilter) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -1857,7 +1857,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableFirstHeaderRowXLSX) // The documentation is not clear about what firstHeaderRow actually means, but MS Excel works on this way createScDoc("xlsx/pivot_table_first_header_row.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); assertXPath(pTable, "/x:pivotTableDefinition/x:location", "firstHeaderRow", u"1"); @@ -1879,7 +1879,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDoubleFieldFilterXLS CPPUNIT_ASSERT_EQUAL(static_cast(3), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(3), pDPs->GetCount()); @@ -1977,7 +1977,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableStringFieldFilterXLS CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2009,7 +2009,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDateFieldFilterXLSX) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2082,7 +2082,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableBoolFieldFilterXLSX) CPPUNIT_ASSERT_EQUAL(u"TRUE"_ustr, pDoc->GetString(ScAddress(0, 1, 0))); //A2 // Reload and check filtering of row dimensions - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2114,7 +2114,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableRowColPageFieldFilte CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check filtering of row dimensions - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2218,7 +2218,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableErrorItemFilterXLSX) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check whether filtering is preserved - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2266,7 +2266,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableErrorItem2FilterXLSX CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check whether filtering is preserved - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2286,7 +2286,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableOutlineModeXLSX) { createScDoc("xlsx/pivottable_outline_mode.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2302,7 +2302,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDuplicatedMemberFilt { createScDoc("xlsx/pivottable_duplicated_member_filter.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2317,7 +2317,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTabularModeXLSX) { createScDoc("xlsx/pivottable_tabular_mode.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2334,7 +2334,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableDuplicateFields) { createScDoc("ods/caseinsensitive-duplicate-fields.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pCacheDef = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pCacheDef); @@ -2360,7 +2360,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf112106) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); // Reload and check data layout dim - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); pDPs = pDoc->GetDPCollection(); CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount()); @@ -2383,7 +2383,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123923) createScDoc("ods/pivot-table-err-in-cache.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2397,7 +2397,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf123939) createScDoc("ods/pivot-table-str-and-err-in-data.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2418,7 +2418,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124651) { createScDoc("ods/tdf124651_simplePivotTable.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pDoc); // We have to export name attribute, even though it's optional according to ECMA-376 standard, @@ -2431,7 +2431,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124736) { createScDoc("xlsx/pivot-table/shared-dategroup.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2481,7 +2481,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124772NumFmt) { createScDoc("ods/pivot-table-num-fmt.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2504,7 +2504,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124810) // First, test that we roundtrip existing pivot table style information from XLSX. createScDoc("xlsx/pivot_dark1.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2529,7 +2529,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124810) // exporting better pivot table style information. createScDoc("ods/tdf124651_simplePivotTable.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2553,7 +2553,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf124883) { createScDoc("xlsx/pivot-table/two-data-fields.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pTable); @@ -2568,7 +2568,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125046) { createScDoc("xlsx/pivottable_long_text.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems", @@ -2579,7 +2579,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125055) { createScDoc("xlsx/pivottable_1s_difference.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -2614,7 +2614,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testTdf125086) { createScDoc("ods/pivottable_fieldInRowsAndData.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/pivotTables/pivotTable1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[2]", "axis", u"axisRow"); @@ -2721,10 +2721,10 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableCompactLayoutXLSX) createScDoc("xlsx/pivot-table/pivotcompact.xlsx"); testThis(*getScDoc()); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); testThis(*getScDoc()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); testThis(*getScDoc()); } @@ -2798,7 +2798,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testFirstHeaderRowZero) // Check that the text under the table is visible CPPUNIT_ASSERT_EQUAL(OUString("under"), getScDoc()->GetString(ScAddress(2, 6, 1))); - save("Calc Office Open XML"); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport("xl/pivotTables/pivotTable1.xml"); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:pivotTableDefinition/x:location", "firstHeaderRow", u"0"); diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx index 7431f13a9f1e..ad4ac04a0996 100644 --- a/sc/qa/unit/scshapetest.cxx +++ b/sc/qa/unit/scshapetest.cxx @@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf144242_OpenBezier_noSwapWH) tools::Rectangle aExpectRect(pObj->GetSnapRect()); // Save, reload and compare - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pObj = lcl_getSdrObjectWithAssert(*pDoc, 0); tools::Rectangle aSnapRect(pObj->GetSnapRect()); @@ -148,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf144242_Line_noSwapWH) tools::Rectangle aExpectRect(pObj->GetSnapRect()); // Save, reload and compare - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); pObj = lcl_getSdrObjectWithAssert(*pDoc, 0); tools::Rectangle aSnapRect(pObj->GetSnapRect()); @@ -346,7 +346,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137082_RTL_cell_anchored) CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectB, pObj->GetSnapRect(), 1); // Save and reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document pDoc = getScDoc(); @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137081_RTL_page_anchored) CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aTopLeft, pObjCS->GetLogicRect().TopLeft(), 1); // Save and reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document pDoc = getScDoc(); @@ -440,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf139583_Rotate180deg) pObj.clear(); // Save and reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and object pDoc = getScDoc(); @@ -467,7 +467,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137033_FlipHori_Resize) ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, 0 /*SCTAB*/, true /*bResizeWithCell*/); // Save and reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and shape pDoc = getScDoc(); @@ -513,7 +513,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137033_RotShear_ResizeHide) CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectRect, aSnapRect, 1); // Save and reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and shape pDoc = getScDoc(); @@ -547,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137033_RotShear_Hide) pDoc->SetDrawPageSize(0); // trigger recalcpos, otherwise shapes are not changed // Save and reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and shape pDoc = getScDoc(); @@ -595,7 +595,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf137576_LogicRectInDefaultMeasureline) Point aOldPos = pObj->GetRelativePos(); // Save and reload, get ScDocShell - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and object pDoc = getScDoc(); @@ -667,7 +667,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testMeasurelineHideColSave) CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(aEndPoint, pObj->GetPoint(1), 1); // save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and shape pDoc = getScDoc(); @@ -765,7 +765,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf138138_MoveCellWithRotatedShape) CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect, aSnapRect, 1); // Save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and shape pDoc = getScDoc(); @@ -817,7 +817,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf117948_CollapseBeforeShape) CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpectedRect1, aSnapRect1Collapse, 1); // Save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and objects pDoc = getScDoc(); @@ -915,7 +915,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf115655_HideDetail) CPPUNIT_ASSERT_MESSAGE("Collapse: Image should not be visible", !pObj->IsVisible()); // Save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Get document and image pDoc = getScDoc(); @@ -1005,7 +1005,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testLargeAnchorOffset) // Just to check that it imports correctly CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(9504, 9089), aOldPos, 1); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pObj = lcl_getSdrObjectWithAssert(*pDoc, 0); @@ -1211,7 +1211,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf154821_shape_in_group) pViewShell->GetViewData().SetCurY(1); pViewShell->GetViewData().GetDispatcher().Execute(SID_OUTLINE_HIDE); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Expand the lower group pViewShell = getViewShell(); @@ -1284,7 +1284,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160369_groupshape) tools::Rectangle aOrigRect = pObj->GetSnapRect(); // Save document but do not reload. Saving alone had already caused the error. - save(u"calc8"_ustr); + save(TestFilter::ODS); // Get geometry of the group again ScDrawObjData* pAfterObjData = ScDrawLayer::GetObjData(pObj); @@ -1307,7 +1307,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160369_groupshape) pDoc->SetColHidden(3, 3, 0, true); pDoc->SetDrawPageSize(0); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Verify geometry is same as before save pDoc = getScDoc(); @@ -1379,7 +1379,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf167450_copySheet) CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aRectSource, pObjTarget->GetLogicRect(), 1); // Compare positions after save and reload. Without fix the position was wrong after reload. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDocTarget = getScDoc(); pObjTarget = lcl_getSdrObjectWithAssert(*pDocTarget, 0, 1); CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aRectSource, pObjTarget->GetLogicRect(), 1); @@ -1412,7 +1412,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf140866) CPPUNIT_ASSERT_EQUAL(u"Test 1"_ustr, pNote->GetText()); // Save, reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // Check that we still have the comment on A1 after save&reload pNote = pDoc->GetNote(ScAddress(0, 0, 0)); diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx index 9601d4638e86..6cacb6923bc3 100644 --- a/sc/qa/unit/subsequent_export_test.cxx +++ b/sc/qa/unit/subsequent_export_test.cxx @@ -46,7 +46,7 @@ using namespace ::com::sun::star::uno; class ScExportTest : public ScModelTestBase { protected: - void testExcelCellBorders(const OUString& sFormatType); + void testExcelCellBorders(TestFilter eFormatType); public: ScExportTest() @@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testExport) pDoc->SetValue(0, 0, 0, 1.0); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); double aVal = pDoc->GetValue(0, 0, 0); @@ -80,7 +80,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testDefaultFontHeight) pPool->SetUserDefaultItem(SvxFontHeightItem(400, 100, ATTR_CJK_FONT_HEIGHT)); pPool->SetUserDefaultItem(SvxFontHeightItem(400, 100, ATTR_CTL_FONT_HEIGHT)); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pPool = pDoc->GetPool(); @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf139167) { createScDoc("xlsx/tdf139167.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFontColorWithMultipleAttributesDefined) createScDoc("xlsx/tdf113271.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -132,7 +132,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf139394) { createScDoc("xlsx/tdf139394.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testExtCondFormatXLSX) { createScDoc("xlsx/tdf139021.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -197,7 +197,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf90104) { createScDoc("xlsx/tdf90104.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf111876) createScDoc("xlsx/tdf111876.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/_rels/sheet1.xml.rels"_ustr); CPPUNIT_ASSERT(pDoc); OUString sTarget = getXPath(pDoc, "/rels:Relationships/rels:Relationship", "Target"); @@ -229,8 +229,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf111876) CPPUNIT_TEST_FIXTURE(ScExportTest, testPasswordExport) { - std::vector aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr, - u"Calc Office Open XML"_ustr }; + std::vector aFilterNames{ TestFilter::ODS, TestFilter::XLS, TestFilter::XLSX }; for (size_t i = 0; i < aFilterNames.size(); ++i) { @@ -258,7 +257,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf134332) ASSERT_DOUBLES_EQUAL(238.0, pDoc->GetValue(ScAddress(0, 10144, 0))); - saveAndReload(u"calc8"_ustr, /*pPassword*/ "test"); + saveAndReload(TestFilter::ODS, /*pPassword*/ "test"); // Without the fixes in place, it would have failed here pDoc = getScDoc(); @@ -271,7 +270,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf99856_dataValidationTest) { createScDoc("ods/tdf99856_dataValidationTest.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); const ScValidationData* pData = pDoc->GetValidationEntry(2); @@ -299,7 +298,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF16LErtlSHA1) // we can't assume that the user entered the password; check that we // round-trip the password as-is - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//office:spreadsheet[@table:structure-protected='true' and " @@ -326,7 +325,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF8SHA1) // we can't assume that the user entered the password; check that we // round-trip the password as-is - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//office:spreadsheet[@table:structure-protected='true' and " @@ -353,7 +352,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF8SHA256ODF12) // we can't assume that the user entered the password; check that we // round-trip the password as-is - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath( pXmlDoc, @@ -382,7 +381,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_UTF8SHA256W3C) // we can't assume that the user entered the password; check that we // round-trip the password as-is - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath( pXmlDoc, @@ -411,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testProtectionKeyODS_XL_SHA1) // we can't assume that the user entered the password; check that we // round-trip the password as-is - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath( pXmlDoc, @@ -433,7 +432,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFormatExportODS) { createScDoc("ods/formats.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); @@ -445,7 +444,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCommentExportXLSX) //tdf#104729 FILESAVE OpenOffice do not save author of the comment during export to .xlsx createScDoc("ods/comment.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pComments = parseExport(u"xl/comments1.xml"_ustr); CPPUNIT_ASSERT(pComments); @@ -486,7 +485,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCommentExportXLSX_2_XLSX) pNote->ShowCaption(aPosC9, true); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pComments = parseExport(u"xl/comments1.xml"_ustr); CPPUNIT_ASSERT(pComments); @@ -505,7 +504,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCustomColumnWidthExportXLSX) //tdf#100946 FILESAVE Excel on macOS ignored column widths in XLSX last saved by LO createScDoc("ods/custom_column_width.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -577,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testXfDefaultValuesXLSX) //tdf#70565 FORMATTING: User Defined Custom Formatting is not applied during importing XLSX documents createScDoc("xlsx/xf_default_values.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -629,7 +628,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13) // FIXME: Error: unexpected attribute "loext:scale-to-X" skipValidation(); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // check XML @@ -649,7 +648,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13) // export ODF 1.2 Extended SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_012_EXTENDED); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // check XML @@ -669,7 +668,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13) // export ODF 1.2 SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_012); - save(u"calc8"_ustr); + save(TestFilter::ODS); // check XML xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr); @@ -697,7 +696,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testColumnWidthResaveXLSX) // Test if after resave .xlsx file, columns width is identical with previous one createScDoc("xlsx/different-column-width-excel2010.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -763,7 +762,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testColumnWidthExportFromODStoXLSX) // Export to .xlsx and compare column width with the .ods // We expect that column width from .ods will be exactly the same as imported from .xlsx - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); @@ -796,7 +795,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testOutlineExportXLSX) //tdf#51524 FILESAVE .xlsx and.xls looses width information for hidden/collapsed grouped columns createScDoc("ods/outline.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -940,7 +939,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testAllRowsHiddenXLSX) { createScDoc("xlsx/tdf105840_allRowsHidden.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr", "zeroHeight", u"true"); @@ -952,7 +951,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testHiddenEmptyRowsXLSX) //tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX createScDoc("ods/hidden-empty-rows.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -968,7 +967,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testHiddenEmptyColsODS) //tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX createScDoc("ods/tdf128895_emptyHiddenCols.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pSheet = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pSheet); assertXPath(pSheet, "//table:table/table:table-column[2]"); @@ -980,7 +979,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testLandscapeOrientationXLSX) //tdf#48767 - Landscape page orientation is not loaded from .xlsx format with MS Excel, after export with Libre Office createScDoc("ods/hidden-empty-rows.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1013,7 +1012,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162963) // The error was, that the property "TotalsRow" was not written to ods at all. // With fix it is written as calcext:contains-footer. { - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); uno::Reference xDocPropSet(xDoc, UNO_QUERY_THROW); uno::Reference xNameAccess( @@ -1047,7 +1046,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162963_ODF) // Save to ODF 1.3 extended. // Adapt to a concrete version when attribute contains-footer is available in ODF strict. // Make sure attribute is written in calcext namespace - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:body/office:spreadsheet/" @@ -1056,7 +1055,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162963_ODF) // Save to ODF 1.3 strict. Make sure attribute is not written. // Adapt to ODF 1.4 strict, when it is available. SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); - save(u"calc8"_ustr); // this saves to .ods not to .fods + save(TestFilter::ODS); // this saves to .ods not to .fods pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:body/office:spreadsheet/" @@ -1078,7 +1077,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162177_EastersundayODF14) // Verify that saving to ODF1.3 produces ORG.OPENOFFICE.EASTERSUNDAY SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); - save(u"calc8"_ustr); // this saves to .ods not to .fods + save(TestFilter::ODS); // this saves to .ods not to .fods xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); const OString sPath = "/office:document-content/office:body/office:spreadsheet/table:table/" "table:table-row/table:table-cell"_ostr; @@ -1086,7 +1085,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162177_EastersundayODF14) // Verify that saving to ODF1.4 produces EASTERSUNDAY SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_014); - save(u"calc8"_ustr); // this saves to .ods not to .fods + save(TestFilter::ODS); // this saves to .ods not to .fods pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, sPath, "formula", u"of:=EASTERSUNDAY(2024)"); } @@ -1117,16 +1116,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testMiscRowHeightExport) // additionally there is effectively a default row height ( 5.29 mm ). So we test the // unset rows at the end of the document to ensure the effective xlsx default height // is set there too. - { u"xlsx/miscrowheights.xlsx", u"Calc Office Open XML"_ustr, SAL_N_ELEMENTS(DfltRowData), - DfltRowData }, + { u"xlsx/miscrowheights.xlsx", TestFilter::XLSX, SAL_N_ELEMENTS(DfltRowData), DfltRowData }, // Checks that some distributed ( non-empty ) heights remain set after export (to xls) - { u"xlsx/miscrowheights.xlsx", u"MS Excel 97"_ustr, SAL_N_ELEMENTS(DfltRowData), - DfltRowData }, + { u"xlsx/miscrowheights.xlsx", TestFilter::XLS, SAL_N_ELEMENTS(DfltRowData), DfltRowData }, // Checks that repeated rows ( of various heights ) remain set after export ( to xlsx ) - { u"ods/miscemptyrepeatedrowheights.ods", u"Calc Office Open XML"_ustr, + { u"ods/miscemptyrepeatedrowheights.ods", TestFilter::XLSX, SAL_N_ELEMENTS(EmptyRepeatRowData), EmptyRepeatRowData }, // Checks that repeated rows ( of various heights ) remain set after export ( to xls ) - { u"ods/miscemptyrepeatedrowheights.ods", u"MS Excel 97"_ustr, + { u"ods/miscemptyrepeatedrowheights.ods", TestFilter::XLS, SAL_N_ELEMENTS(EmptyRepeatRowData), EmptyRepeatRowData }, }; miscRowHeightsTest(aTestValues, SAL_N_ELEMENTS(aTestValues)); @@ -1220,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testNamedRangeBugfdo62729) pDoc->DeleteTab(0); //should be still a single named range CPPUNIT_ASSERT_EQUAL(size_t(1), pNames->size()); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); @@ -1234,7 +1231,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testBuiltinRangesXLSX) { createScDoc("xlsx/built-in_ranges.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1639,7 +1636,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS) } // Now, save and reload this document. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.", @@ -1659,7 +1656,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS) } // Reload the doc again, and check the content of B2 and B4. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { ScDocument* pDoc = getScDoc(); ScFieldEditEngine* pEE = &pDoc->GetEditEngine(); @@ -1725,7 +1722,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextExportODS) } // Reload the doc again, and check the content of B2, B4, B6 and B7. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); pEditText = pDoc->GetEditText(ScAddress(1, 1, 0)); @@ -1755,7 +1752,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testRichTextCellFormatXLSX) { createScDoc("xls/cellformat.xls"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1794,7 +1791,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFormulaRefSheetNameODS) pDoc->GetFormula(1, 1, 0)); } // Now, save and reload this document. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); pDoc->CalcAll(); @@ -1835,7 +1832,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellValuesExportODS) pDoc->SetString(ScAddress(0, 7, 0), u"=$A$6"_ustr); //A8 } // save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.", pDoc->GetTableCount() > 0); @@ -1890,7 +1887,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellNoteExportODS) CPPUNIT_ASSERT_MESSAGE("There should be a note at A2.", pDoc->HasNote(aPos)); } // save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); aPos.SetRow(0); // Move back to A1. @@ -1922,7 +1919,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellNoteExportXLS) CPPUNIT_ASSERT(pDoc->HasNote(ScAddress(0, 2, 2))); } // save and reload as XLS. - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); { ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL_MESSAGE("This document should have 3 sheets.", SCTAB(3), @@ -1972,7 +1969,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testInlineArrayXLS) { createScDoc("xls/inline-array.xls"); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); ScDocument* pDoc = getScDoc(); @@ -1990,7 +1987,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testEmbeddedChartODS) { createScDoc("xls/embedded-chart.xls"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -2005,7 +2002,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testEmbeddedChartXLS) { createScDoc("xls/embedded-chart.xls"); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); ScDocument* pDoc = getScDoc(); @@ -2030,7 +2027,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testCellAnchoredGroupXLS) { createScDoc("xls/cell-anchored-group.xls"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // the document contains a group anchored on the first cell, make sure it's there in the right place ScDocument* pDoc = getScDoc(); @@ -2053,7 +2050,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testFormulaReferenceXLS) { createScDoc("xls/formula-reference.xls"); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); ScDocument* pDoc = getScDoc(); @@ -2079,7 +2076,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testSheetProtectionXLSX) { createScDoc("xlsx/ProtecteSheet1234Pass.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); const ScTableProtection* pTabProtect = pDoc->GetTabProtection(0); @@ -2100,7 +2097,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testSheetProtectionXLSB) { createScDoc("xlsb/tdf108017_calcProtection.xlsb"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); const ScTableProtection* pTabProtect = pDoc->GetTabProtection(0); @@ -2136,7 +2133,7 @@ const char* toBorderName(SvxBorderLineStyle eStyle) } } -void ScExportTest::testExcelCellBorders(const OUString& sFormatType) +void ScExportTest::testExcelCellBorders(TestFilter eFormatType) { static const struct { @@ -2172,7 +2169,7 @@ void ScExportTest::testExcelCellBorders(const OUString& sFormatType) } } - saveAndReload(sFormatType); + saveAndReload(eFormatType); ScDocument* pDoc = getScDoc(); for (auto const[nRow, eStyle, nWidth] : aChecks) { @@ -2188,13 +2185,13 @@ void ScExportTest::testExcelCellBorders(const OUString& sFormatType) CPPUNIT_TEST_FIXTURE(ScExportTest, testCellBordersXLS) { createScDoc("xls/cell-borders.xls"); - testExcelCellBorders(u"MS Excel 97"_ustr); + testExcelCellBorders(TestFilter::XLS); } CPPUNIT_TEST_FIXTURE(ScExportTest, testCellBordersXLSX) { createScDoc("xlsx/cell-borders.xlsx"); - testExcelCellBorders(u"Calc Office Open XML"_ustr); + testExcelCellBorders(TestFilter::XLSX); } CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf155368) @@ -2205,7 +2202,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf155368) dispatchCommand(mxComponent, u".uno:WrapText"_ustr, {}); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pStyles); diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 956838656b28..b57602b20ea5 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -43,7 +43,7 @@ ScExportTest2::ScExportTest2() CPPUNIT_TEST_FIXTURE(ScExportTest2, testGroupShape) { createScDoc("xlsx/groupShape.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -57,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testFreezePaneStartCellXLSX) createScDoc("xlsx/freezePaneStartCell.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); OUString sFirstNonFrozenCell = getXPath(pDoc, "//x:sheetViews//x:pane", "topLeftCell"); @@ -70,7 +70,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testMatrixMultiplicationXLSX) { createScDoc("xlsx/matrix-multiplication.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringXLSX) createScDoc("xlsx/ref_string.xlsx"); //make sure ref syntax gets saved for MSO-produced docs - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); ScCalcConfig aCalcConfig = pDoc->GetCalcConfig(); @@ -103,7 +103,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringConfigXLSX) // this doc is configured with CalcA1 ref syntax createScDoc("xlsx/empty.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); ScCalcConfig aConfig = pDoc->GetCalcConfig(); @@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringConfigXLSX) aConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_XL_R1C1; pDoc->SetCalcConfig(aConfig); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); // ... and make sure it got saved pDoc = getScDoc(); @@ -148,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testRefStringUnspecified) // change formula syntax (i.e. not string ref syntax) to ExcelA1 pDoc->SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_A1); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // with string ref syntax at its default value, we should've saved ExcelA1 pDoc = getScDoc(); @@ -162,7 +162,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHeaderImageODS) { // Graphic as header background was lost on export. createScDoc("ods/header-image.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xStyleFamilies @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHeaderImageODS) CPPUNIT_TEST_FIXTURE(ScExportTest2, testHeaderFooterContentODS) { createScDoc("ods/header-footer-content.ods"); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xStyleFamilies @@ -213,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTextDirectionXLSX) { createScDoc("xlsx/writingMode.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -231,7 +231,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf121260) // change formula syntax (i.e. not string ref syntax) to ExcelA1 FormulaGrammarSwitch aFGSwitch(pDoc, formula::FormulaGrammar::GRAM_NATIVE_XL_A1); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pChart1 = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pChart1); @@ -250,7 +250,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf120168) { createScDoc("xlsx/tdf120168.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -269,7 +269,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf117266) { createScDoc("xlsm/tdf117266_macroButton.xlsm"); - save(u"Calc MS Excel 2007 VBA XML"_ustr); + save(TestFilter::XLSM); xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr); assertXPath(pVmlDrawing, "/xml/v:shape", "id", u"Button 1001"); @@ -287,7 +287,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf66668) // Would hang on exporting without the fix in place createScDoc("xlsx/tdf66668.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); } @@ -296,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf130108) { createScDoc("ods/tdf130108.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -312,7 +312,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf76949) { createScDoc("ods/tdf76949.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -324,7 +324,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf107586) { createScDoc("xlsx/tdf107586.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -337,7 +337,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf55417) { createScDoc("xlsx/tdf55417.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[1]/x:alignment", 1); @@ -348,7 +348,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf129985) { createScDoc("xlsx/tdf129985.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -359,7 +359,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf73063) { createScDoc("xlsx/tdf73063.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -372,7 +372,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_ods_to_xlsx) // Roundtripping sort options with user defined list to XLSX createScDoc("ods/tdf95640.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); assertXPath(pDoc, "//x:worksheet/x:autoFilter", "ref", u"A1:B4"); @@ -387,7 +387,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_ods_to_xlsx_with_standard_list) { // Roundtripping sort options with user defined list to XLSX createScDoc("ods/tdf95640_standard_list.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); assertXPath(pDoc, "//x:worksheet/x:autoFilter", "ref", u"A1:B4"); @@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf95640_xlsx_to_xlsx) // low, medium, high createScDoc("xlsx/tdf95640.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); assertXPath(pDoc, "//x:worksheet/x:autoFilter", "ref", u"A1:B4"); @@ -425,7 +425,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testSortConditionRef) // - In <>, attribute 'ref' of '//x:worksheet/x:autoFilter/x:sortState/x:sortCondition' incorrect value. createScDoc("xlsx/sortconditionref.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); assertXPath(pDoc, "//x:worksheet/x:autoFilter", "ref", u"B2"); @@ -439,7 +439,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testSortConditionRef2) //- Actual : J11:J300 //- In <>, attribute 'ref' of '//x:worksheet/x:autoFilter/x:sortState/x:sortCondition' incorrect value. createScDoc("xlsx/sortconditionref2.xlsx"); - save("Calc Office Open XML"); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml"); assertXPath(pDoc, "//x:worksheet/x:autoFilter/x:sortState/x:sortCondition", "ref", u"A11:A300"); @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testDateAutofilterXLSX) // XLSX Roundtripping autofilter with date list createScDoc("xlsx/dateAutofilter.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -474,7 +474,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testDateAutofilterODS) { createScDoc("ods/tdf142231.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -488,7 +488,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsODF) { createScDoc("ods/autofilter-colors.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsOOXML) { { createScDoc("xlsx/autofilter-colors.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable1 = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pTable1); sal_Int32 nDxfId @@ -543,7 +543,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColorsOOXML) { createScDoc("xlsx/autofilter-colors-fg.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pTable1 = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pTable1); sal_Int32 nDxfId @@ -563,7 +563,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterTop10XLSX) { createScDoc("xlsx/tdf143068_top10filter.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "//x:autoFilter/x:filterColumn", "colId", u"0"); @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testAutofilterColButton) // - In <>, XPath '//x:autoFilter/x:filterColumn' unexpected 'hiddenButton' attribute createScDoc("ods/autofilter-colbutton.ods"); - save("Calc Office Open XML"); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport("xl/worksheets/sheet1.xml"); CPPUNIT_ASSERT(pDoc); assertXPathNoAttribute(pDoc, "//x:autoFilter/x:filterColumn", "hiddenButton"); @@ -587,7 +587,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf88657ODS) { createScDoc("ods/tdf88657.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pDoc = parseExport(u"styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -598,7 +598,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf41722) { createScDoc("xlsx/tdf41722.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -611,7 +611,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf113621) { createScDoc("xlsx/tdf113621.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -622,7 +622,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testEscapeCharInNumberFormatXLSX) { createScDoc("xlsx/tdf81939.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -645,7 +645,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testNatNumInNumberFormatXLSX) { createScDoc("ods/tdf79398_NatNum5.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -656,9 +656,9 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testNatNumInNumberFormatXLSX) CPPUNIT_TEST_FIXTURE(ScExportTest2, testExponentWithoutSignFormatXLSX) { createScDoc("ods/tdf102370_ExponentWithoutSign.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); sal_uInt32 nNumberFormat = pDoc->GetNumberFormat(0, 0, 0); @@ -673,7 +673,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testExtendedLCIDXLSX) { createScDoc("ods/tdf36038_ExtendedLCID.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); xmlDocUniquePtr pDocXml = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pDocXml); // Check export @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHiddenRepeatedRowsODS) pDoc->SetRowHidden(0, 20, 0, true); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); SCROW nFirstRow = 0; SCROW nLastRow = 0; @@ -756,7 +756,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHyperlinkTargetFrameODS) OUString aTargetFrame = pURLData->GetTargetFrame(); CPPUNIT_ASSERT_EQUAL(u"_blank"_ustr, aTargetFrame); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pDocXml = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pDocXml); OUString aTargetFrameExport @@ -787,7 +787,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testKeepSettingsOfBlankRows) { createScDoc("xlsx/tdf41425.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -799,7 +799,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf133595) { createScDoc("xlsx/tdf133595.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -811,7 +811,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf134769) { createScDoc("xlsx/tdf134769.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -830,7 +830,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf106181) { createScDoc("ods/tdf106181.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -868,7 +868,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf145057) { createScDoc("xlsx/tdf145057.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -878,7 +878,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf145057) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf105272) { createScDoc("xlsx/tdf105272.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); //without the fix in place,it would fail //Expected: Table1[[#This Row],[Total]]/Table1[[#This Row],['# Athletes]] @@ -892,7 +892,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf105272) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf118990) { createScDoc("xlsx/tdf118990.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); // TODO: also test A1, which contains a UNC reference to \\localhost\share\lookupsource.xlsx, @@ -914,7 +914,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf118990) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf121612) { createScDoc("ods/tdf121612.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); @@ -931,7 +931,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112936) { createScDoc("xlsx/tdf112936.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/pivotCache/pivotCacheDefinition1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -945,7 +945,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testXltxExport) createScDoc(); // Export as template and check content type - save(u"Calc MS Excel 2007 XML Template"_ustr); + save(TestFilter::XLST); xmlDocUniquePtr pDoc = parseExport(u"[Content_Types].xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/ContentType:Types/ContentType:Override[@PartName='/xl/workbook.xml']", @@ -958,7 +958,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testPivotCacheAfterExportXLSX) createScDoc("ods/numgroup_example.ods"); // export only - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT(pDoc->HasPivotTable()); @@ -983,7 +983,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf114969XLSX) { createScDoc("ods/sheet_name_with_dots.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink[1]", "location", u"'1.1.1.1'!C1"); @@ -994,7 +994,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf115192XLSX) { createScDoc("xlsx/test_115192.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "TargetMode", @@ -1008,7 +1008,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf142764) { createScDoc("ods/tdf142764.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf142764) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91634XLSX) { createScDoc("xlsx/image_hyperlink.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1055,7 +1055,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testValidationCopyPaste) pDoc->CopyFromClip(aDstRange, aMark2, InsertDeleteFlags::ALL, nullptr, &aClipDoc); // save as XLSX - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); // check validation xmlDocUniquePtr pDocXml = parseExport(u"xl/worksheets/sheet1.xml"_ustr); @@ -1068,7 +1068,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf115159) { createScDoc("xlsx/tdf115159.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1090,7 +1090,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567) createScDoc("xlsx/tdf112567.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1107,11 +1107,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf75702) ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL_MESSAGE("load a1", sA1, pDoc->GetString(0, 0, 0)); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL_MESSAGE("reload a1", sA1, pDoc->GetString(0, 0, 0)); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pContent = parseExport(u"content.xml"_ustr); assertXPath(pContent, "//table:table-row[1]/table:table-cell/text:p", 2); } @@ -1128,7 +1128,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf103829) CPPUNIT_ASSERT_EQUAL_MESSAGE("load a1", sA1, pDoc->GetString(0, 0, 0)); CPPUNIT_ASSERT_EQUAL_MESSAGE("load a2", sA2, pDoc->GetString(0, 1, 0)); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL_MESSAGE("reload a1", sA1, pDoc->GetString(0, 0, 0)); CPPUNIT_ASSERT_EQUAL_MESSAGE("reload a2", sA2, pDoc->GetString(0, 1, 0)); @@ -1151,7 +1151,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf122191) ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"IGAZ"_ustr, pDoc->GetString(0, 0, 0)); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); // Without the fix in place, this test would have failed with @@ -1164,7 +1164,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf142881) { createScDoc("xlsx/tdf142881.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing1 = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing1); @@ -1194,7 +1194,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf161365) { createScDoc("xlsx/tdf161365.xlsx"); - save("Calc Office Open XML"); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet1 = parseExport("xl/worksheets/sheet1.xml"); CPPUNIT_ASSERT(pSheet1); @@ -1256,7 +1256,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567b) createScDoc("ods/tdf112567.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/workbook.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1271,7 +1271,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf112567b) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf123645XLSX) { createScDoc("xlsx/chart_hyperlink.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1307,7 +1307,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf123645XLSX) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf125173XLSX) { createScDoc("ods/text_box_hyperlink.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1324,7 +1324,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf125173XLSX) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf79972XLSX) { createScDoc("xlsx/tdf79972.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1340,7 +1340,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf79972XLSX) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf126024XLSX) { createScDoc("xlsx/hyperlink_formula.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1356,7 +1356,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf126024XLSX) CPPUNIT_TEST_FIXTURE(ScExportTest2, testEnhancedProtectionRangeShorthand) { createScDoc("xlsx/enhancedProtectionRangeShorthand.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); // the shorthand version was not recognized as a valid range on import @@ -1366,7 +1366,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testEnhancedProtectionRangeShorthand) CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91332) { createScDoc("xlsx/tdf91332.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), @@ -1387,7 +1387,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf137543XLSX) // LET function test createScDoc("xlsx/tdf137543.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); diff --git a/sc/qa/unit/subsequent_export_test3.cxx b/sc/qa/unit/subsequent_export_test3.cxx index ddcaf14cf6a7..a460c36275b0 100644 --- a/sc/qa/unit/subsequent_export_test3.cxx +++ b/sc/qa/unit/subsequent_export_test3.cxx @@ -45,8 +45,8 @@ public: } protected: - void testCeilingFloor(const OUString& sFormatType); - void testFunctionsExcel2010(const OUString& sFormatType); + void testCeilingFloor(TestFilter eFormatType); + void testFunctionsExcel2010(TestFilter eFormatType); }; CPPUNIT_TEST_FIXTURE(ScExportTest3, testBordersExchangeXLSX) @@ -221,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testBordersExchangeXLSX) createScDoc("ods/test_borders_export.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); for (size_t nCol = 0; nCol < nMaxCol; ++nCol) @@ -460,7 +460,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) bool bGood = aTest.check(*pDoc); CPPUNIT_ASSERT_MESSAGE("Initial check failed (xls).", bGood); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); bGood = aTest.check(*pDoc); CPPUNIT_ASSERT_MESSAGE("Check after reload failed (xls).", bGood); @@ -484,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) aTest.check(*pDoc); CPPUNIT_ASSERT_MESSAGE("Initial check failed (xlsx).", bGood); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); bGood = aTest.check(*pDoc); CPPUNIT_ASSERT_MESSAGE("Check after reload failed (xlsx).", bGood); @@ -548,7 +548,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTabColorsXLSX) CPPUNIT_ASSERT_MESSAGE("Failed on the initial content check.", bRes); } - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); bool bRes = aTest.checkContent(*pDoc); CPPUNIT_ASSERT_MESSAGE("Failed on the content check after reload.", bRes); @@ -558,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf133487) { createScDoc("fods/shapes_foreground_background.fods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -704,7 +704,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS) CPPUNIT_ASSERT_MESSAGE("Content check on the original document failed.", bRes); } - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); // Check the content of the reloaded. This should be identical. ScDocument* pDoc = getScDoc(); @@ -797,7 +797,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX) } // Save and reload, and check the content again. - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); pDoc->CalcAll(); // Recalculate to flush all cached results. @@ -865,7 +865,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaStringResultExportXLSX) CPPUNIT_ASSERT_MESSAGE("Content check on the initial recalculated document failed.", bRes); } // Reload and check again. - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); bool bRes = aTest.checkContent(*pDoc); @@ -952,7 +952,7 @@ void testCeilingFloor_Impl(ScDocument& rDoc) } } -void ScExportTest3::testFunctionsExcel2010(const OUString& sFormatType) +void ScExportTest3::testFunctionsExcel2010(TestFilter eFormatType) { createScDoc("xlsx/functions-excel-2010.xlsx"); @@ -961,7 +961,7 @@ void ScExportTest3::testFunctionsExcel2010(const OUString& sFormatType) testFunctionsExcel2010_Impl(*pDoc); - saveAndReload(sFormatType); + saveAndReload(eFormatType); pDoc = getScDoc(); pDoc->CalcAll(); // perform hard re-calculation. @@ -970,17 +970,20 @@ void ScExportTest3::testFunctionsExcel2010(const OUString& sFormatType) CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010XLSX) { - testFunctionsExcel2010(u"Calc Office Open XML"_ustr); + testFunctionsExcel2010(TestFilter::XLSX); } CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010XLS) { - testFunctionsExcel2010(u"MS Excel 97"_ustr); + testFunctionsExcel2010(TestFilter::XLS); } -CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010ODS) { testFunctionsExcel2010("calc8"); } +CPPUNIT_TEST_FIXTURE(ScExportTest3, testFunctionsExcel2010ODS) +{ + testFunctionsExcel2010(TestFilter::ODS); +} -void ScExportTest3::testCeilingFloor(const OUString& sFormatType) +void ScExportTest3::testCeilingFloor(TestFilter eFormatType) { createScDoc("xlsx/ceiling-floor.xlsx"); @@ -989,28 +992,25 @@ void ScExportTest3::testCeilingFloor(const OUString& sFormatType) testCeilingFloor_Impl(*pDoc); - saveAndReload(sFormatType); + saveAndReload(eFormatType); pDoc = getScDoc(); pDoc->CalcAll(); // perform hard re-calculation. testCeilingFloor_Impl(*pDoc); } -CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLSX) -{ - testCeilingFloor(u"Calc Office Open XML"_ustr); -} +CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLSX) { testCeilingFloor(TestFilter::XLSX); } -CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLS) { testCeilingFloor(u"MS Excel 97"_ustr); } +CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorXLS) { testCeilingFloor(TestFilter::XLS); } -CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODS) { testCeilingFloor(u"calc8"_ustr); } +CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODS) { testCeilingFloor(TestFilter::ODS); } CPPUNIT_TEST_FIXTURE(ScExportTest3, testCeilingFloorODSToXLSX) { // tdf#100011 - Cannot open sheet containing FLOOR/CEILING functions by MS Excel, after export to .xlsx createScDoc("ods/ceiling-floor.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/workbook.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1023,7 +1023,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testCustomXml) // Load document and export it to a temporary file createScDoc("xlsx/customxml.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"customXml/item1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); xmlDocUniquePtr pRelsDoc = parseExport(u"customXml/_rels/item1.xml.rels"_ustr); @@ -1058,7 +1058,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativePathsODS) { createScDoc("ods/fdo79305.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pDoc); OUString aURL = getXPath(pDoc, @@ -1103,7 +1103,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetProtectionODS) testSheetProtection_Impl(*pDoc); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); @@ -1112,8 +1112,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetProtectionODS) CPPUNIT_TEST_FIXTURE(ScExportTest3, testSwappedOutImageExport) { - std::vector aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr, - u"Calc Office Open XML"_ustr }; + std::vector aFilterNames{ TestFilter::ODS, TestFilter::XLS, TestFilter::XLSX }; for (size_t i = 0; i < aFilterNames.size(); ++i) { @@ -1121,7 +1120,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSwappedOutImageExport) createScDoc("ods/document_with_two_images.ods"); const OString sFailedMessage - = OString::Concat("Failed on filter: ") + aFilterNames[i].toUtf8(); + = OString::Concat("Failed on filter: ") + TestFilterNames.at(aFilterNames[i]).toUtf8(); // Export the document and import again for a check saveAndReload(aFilterNames[i]); @@ -1178,7 +1177,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSupBookVirtualPathXLS) { createScDoc("xls/external-ref.xls"); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); ScDocument* pDoc = getScDoc(); @@ -1195,15 +1194,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSupBookVirtualPathXLS) CPPUNIT_TEST_FIXTURE(ScExportTest3, testLinkedGraphicRT) { // Problem was with linked images - std::vector aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr, - u"Calc Office Open XML"_ustr }; + std::vector aFilterNames{ TestFilter::ODS, TestFilter::XLS, TestFilter::XLSX }; for (size_t i = 0; i < aFilterNames.size(); ++i) { // Load the original file with one image createScDoc("ods/document_with_linked_graphic.ods"); const OString sFailedMessage - = OString::Concat("Failed on filter: ") + aFilterNames[i].toUtf8(); + = OString::Concat("Failed on filter: ") + TestFilterNames.at(aFilterNames[i]).toUtf8(); // Export the document and import again for a check saveAndReload(aFilterNames[i]); @@ -1216,7 +1214,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLinkedGraphicRT) CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pPage != nullptr); SdrGrafObj* pObject = dynamic_cast(pPage->GetObj(0)); CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pObject != nullptr); - if (aFilterNames[i] == "Calc Office Open XML") + if (aFilterNames[i] == TestFilter::XLSX) { // FIXME: tdf#152036 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), !pObject->IsLinkedGraphic()); @@ -1234,15 +1232,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLinkedGraphicRT) CPPUNIT_TEST_FIXTURE(ScExportTest3, testImageWithSpecialID) { - std::vector aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr, - u"Calc Office Open XML"_ustr }; + std::vector aFilterNames{ TestFilter::ODS, TestFilter::XLS, TestFilter::XLSX }; for (size_t i = 0; i < aFilterNames.size(); ++i) { createScDoc("ods/images_with_special_IDs.ods"); const OString sFailedMessage - = OString::Concat("Failed on filter: ") + aFilterNames[i].toUtf8(); + = OString::Concat("Failed on filter: ") + TestFilterNames.at(aFilterNames[i]).toUtf8(); // Export the document and import again for a check saveAndReload(aFilterNames[i]); @@ -1304,7 +1301,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testAbsNamedRangeHTML) //reset import filter setImportFilterName(u"calc8"_ustr); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); @@ -1320,7 +1317,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf80149) createScDoc("csv/tdf80149.csv"); ScDocShell* pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); @@ -1346,7 +1343,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetLocalRangeNameXLS) createScDoc("xls/named-ranges-local.xls"); ScDocShell* pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); @@ -1368,7 +1365,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testRelativeNamedExpressionsXLS) createScDoc("ods/tdf113991_relativeNamedRanges.ods"); ScDocShell* pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); @@ -1398,7 +1395,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTextBoxHyperlinkXLSX) { createScDoc("xlsx/textbox-hyperlink.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1412,7 +1409,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testFontSizeXLSX) { createScDoc("xlsx/fontSize.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); OUString fontSize = getXPath( @@ -1425,9 +1422,9 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetCharacterKerningSpaceXLSX) { createScDoc("xlsx/textbox-CharKerningSpace.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1443,7 +1440,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetCondensedCharacterSpaceXLSX) { createScDoc("xlsx/textbox-CondensedCharacterSpace.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1459,7 +1456,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTextUnderlineColorXLSX) { createScDoc("xlsx/underlineColor.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); // Make sure the underline type is double line @@ -1491,7 +1488,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetRunParagraphPropertyXLSX) { createScDoc("xlsx/TextColor.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/sharedStrings.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1503,7 +1500,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testPreserveTextWhitespaceXLSX) { createScDoc("xlsx/preserve-whitespace.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/sharedStrings.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:sst/x:si/x:t", "space", u"preserve"); @@ -1513,7 +1510,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testPreserveTextWhitespace2XLSX) { createScDoc("xlsx/preserve_space.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/sharedStrings.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/x:sst/x:si[1]/x:t", "space", u"preserve"); @@ -1557,7 +1554,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testHiddenShapeXLSX) CPPUNIT_ASSERT_MESSAGE("Drawing object should not be visible.", !pObj->IsVisible()); CPPUNIT_ASSERT_MESSAGE("Drawing object should not be printable.", !pObj->IsPrintable()); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDocXml = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDocXml); assertXPath(pDocXml, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp[1]/xdr:nvSpPr/xdr:cNvPr", "hidden", @@ -1568,7 +1565,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testShapeAutofitXLSX) { createScDoc("xlsx/testShapeAutofit.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1582,7 +1579,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testHyperlinkXLSX) { createScDoc("xlsx/hyperlink.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/_rels/drawing1.xml.rels"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/rels:Relationships/rels:Relationship", "Target", u"#Sheet2!A1"); @@ -1656,7 +1653,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testMoveCellAnchoredShapesODS) aNDataEnd = pNData->maEnd; // Save the document and load again to check anchor persist - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // There are two cell-anchored objects on the first sheet. pDoc = getScDoc(); @@ -1721,7 +1718,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testMoveCellAnchoredShapesODS) aNDataEnd = pNData->maEnd; // Save the document and load again to check anchor persist - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // There are two cell-anchored objects on the first sheet. pDoc = getScDoc(); @@ -1805,7 +1802,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLegacyCellAnchoredRotatedShape) // test save and reload // for some reason having this test in subsequent_export-test.cxx causes // a core dump in editeng ( so moved to here ) - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor); } @@ -1830,7 +1827,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLegacyCellAnchoredRotatedShape) pDoc->SetDrawPageSize(0); // trigger recalcpos impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor); // test save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor); } @@ -1852,7 +1849,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testLegacyCellAnchoredRotatedShape) // test import impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor); // test save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); impl_testLegacyCellAnchoredRotatedShape(*pDoc, aRect, aAnchor); } @@ -1862,7 +1859,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf113646) { createScDoc("ods/tdf113646.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1874,7 +1871,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testDateStandardfilterXLSX) // XLSX Roundtripping standard filter with date createScDoc("ods/tdf142607.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1911,7 +1908,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf137576_Measureline) CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 5200), aEnd, 1); // Save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // Get shape @@ -1958,7 +1955,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf137044_CoverHiddenRows) pDoc->SetRowHidden(4, 5, 0, true); // Save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // Get shape @@ -1999,7 +1996,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf137020_FlipVertical) CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, aSnapRectFlip, 1); // Save and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // Get shape @@ -2019,7 +2016,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTdf82254_csv_bom) { setImportFilterName(SC_TEXT_CSV_FILTER_NAME); createScDoc("csv/testTdf82254-csv-bom.csv"); - saveAndReload(SC_TEXT_CSV_FILTER_NAME); + saveAndReload(TestFilter::CSV); ScDocShell* pDocSh = getScDocShell(); SvStream* pStream = pDocSh->GetMedium()->GetInStream(); diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 6d71550692b6..745ed2c1f4b4 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -76,7 +76,7 @@ ScExportTest4::ScExportTest4() CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf126177XLSX) { createScDoc("xlsx/hyperlink_export.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -94,7 +94,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextVAlignment) // Testing comment text alignments. createScDoc("ods/CommentTextVAlign.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr); CPPUNIT_ASSERT(pVmlDrawing); @@ -107,7 +107,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextHAlignment) // Testing comment text alignments. createScDoc("ods/CommentTextHAlign.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr); CPPUNIT_ASSERT(pVmlDrawing); @@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testRotatedImageODS) createScDoc("ods/tdf103092_RotatedImage.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -150,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf120177) // Error: unexpected attribute "form:input-required" skipValidation(); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -179,7 +179,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf85553) { createScDoc("ods/tdf85553.ods"); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); ScDocument* pDoc = getScDoc(); @@ -191,15 +191,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf85553) CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf151484) { - std::vector aFilterNames{ u"calc8"_ustr, u"MS Excel 97"_ustr, - u"Calc Office Open XML"_ustr }; + std::vector aFilterNames{ TestFilter::ODS, TestFilter::XLS, TestFilter::XLSX }; for (size_t i = 0; i < aFilterNames.size(); ++i) { createScDoc("ods/tdf151484.ods"); const OString sFailedMessage - = OString::Concat("Failed on filter: ") + aFilterNames[i].toUtf8(); + = OString::Concat("Failed on filter: ") + TestFilterNames.at(aFilterNames[i]).toUtf8(); saveAndReload(aFilterNames[i]); @@ -240,7 +239,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143979) CPPUNIT_ASSERT_EQUAL(u"2021-08Aug-30Mon"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); // Without the fix in place, this test would have failed with @@ -253,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf128976) { createScDoc("xls/tdf128976.xls"); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); ScDocument* pDoc = getScDoc(); @@ -277,7 +276,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf120502) const auto nOldWidth = pDoc->GetColWidth(nMaxCol, 0); pDoc->SetColWidth(nMaxCol, 0, nOldWidth + 100); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet1 = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet1); @@ -289,7 +288,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf131372) { createScDoc("ods/tdf131372.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -302,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf81470) createScDoc("xls/tdf81470.xls"); //without the fix in place, it would have crashed at export time - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); //also check revisions are exported xmlDocUniquePtr pHeaders = parseExport(u"xl/revisions/revisionHeaders.xml"_ustr); @@ -320,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf162262) { createScDoc("xlsx/subtotal-above.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -343,7 +342,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf162262_summarybelow) CPPUNIT_ASSERT(!aParam.bSummaryBelow); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pDBCollection = pDoc->GetDBCollection(); CPPUNIT_ASSERT(pDBCollection); @@ -360,7 +359,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf122331) { createScDoc("ods/tdf122331.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -375,7 +374,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf83779) // Roundtripping TRUE/FALSE constants (not functions) must convert them to functions createScDoc("xlsx/tdf83779.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pVmlDrawing = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pVmlDrawing); @@ -389,7 +388,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121715_FirstPageHeaderFooterXLSX) // Check if first page header and footer are exported properly createScDoc("xlsx/tdf121715.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -406,7 +405,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121716_ExportEvenHeaderFooterXLSX) createScDoc("ods/tdf121716_EvenHeaderFooter.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -434,7 +433,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf134459_HeaderFooterColorXLSX) // Colors in header and footer should be exported, and imported properly createScDoc("xlsx/tdf134459_HeaderFooterColor.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -449,7 +448,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf134817_HeaderFooterTextWith2SectionXL // Header/footer text with multiple selection should be exported, and imported properly createScDoc("xlsx/tdf134817_HeaderFooterTextWith2Section.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -464,7 +463,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf121718_UseFirstPageNumberXLSX) // If "First page number" is not checked then useFirstPageNumb, and firstPageNumber should not be exported. createScDoc("ods/tdf121718_UseFirstPageNumber.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -521,7 +520,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf154445_unused_pagestyles) pDoc->SetPageStyle(0, ScResId(STR_STYLENAME_STANDARD)); // Save and reload the document to check if the unused page styles are still present - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); // Without the accompanying fix in place, the unused page styles don't exist anymore @@ -538,7 +537,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf135828_Shape_Rect) // forth conversion between emu and hmm. createScDoc("xlsx/tdf135828_Shape_Rect.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing); @@ -621,7 +620,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf123353) { createScDoc("xlsx/tdf123353.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -633,7 +632,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf140098) { createScDoc("ods/tdf140098.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -646,7 +645,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf133688_precedents) // tdf#133688 Check that we do not export detective shapes. createScDoc("ods/tdf133688_dont_save_precedents_to_xlsx.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing); @@ -660,7 +659,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf91251_missingOverflowRoundtrip) // getting preserved after roundtrip createScDoc("xlsx/tdf91251_missingOverflowRoundtrip.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing); @@ -679,7 +678,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf137000_handle_upright) // of workaround 'rot'. createScDoc("xlsx/tdf137000_export_upright.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing); @@ -691,7 +690,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf126305_DataValidatyErrorAlert) { createScDoc("ods/tdf126305.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -762,7 +761,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf87973_externalLinkSkipUnuseds) pDoc->SetFormula(ScAddress(3, 2, 0), aFormula, formula::FormulaGrammar::GRAM_NATIVE_UI); // save and load back - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); // check if the new filename is present in the link (and not replaced by '[2]') pDoc = getScDoc(); @@ -789,7 +788,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf51022_lostPrintRange) pDoc->AddPrintRange(0, aRange2); // save and load back - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // check if the same print ranges are present pDoc = getScDoc(); @@ -808,7 +807,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148170_ExceedXlsPrintRange) ScDocument* pDoc = getScDoc(); pDoc->AddPrintRange(0, aCalcPrintRange); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); // Check if print range was shrunk to xls limitations pDoc = getScDoc(); @@ -823,7 +822,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138741_externalLinkSkipUnusedsCrash) createScDoc("xlsx/tdf138741_externalLinkSkipUnusedsCrash.xlsx"); //without the fix in place, it would have crashed at export time - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); } CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138824_linkToParentDirectory) @@ -847,7 +846,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf138824_linkToParentDirectory) aFormula = aFormula.replaceAt(nIdxOfFile, nIdxOfFilename - nIdxOfFile, aTempFilename); pDoc->SetFormula(ScAddress(3, 1, 0), aFormula, formula::FormulaGrammar::GRAM_NATIVE_UI); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDocXml = parseExport(u"xl/externalLinks/_rels/externalLink1.xml.rels"_ustr); CPPUNIT_ASSERT(pDocXml); @@ -860,7 +859,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf129969) { createScDoc("ods/external_hyperlink.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); ScAddress aPos(0, 0, 0); const EditTextObject* pEditText = pDoc->GetEditText(aPos); @@ -873,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf147088) { createScDoc("fods/tdf147088.fods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); @@ -887,7 +886,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf84874) { createScDoc("ods/tdf84874.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); @@ -913,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf136721_paper_size) { createScDoc("xlsx/tdf136721_letter_sized_paper.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -925,7 +924,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf139258_rotated_image) // Check that the topleft position of the image is correct. createScDoc("ods/tdf139258_rotated_image.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing); @@ -974,7 +973,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf151755_stylesLostOnXLSXExport) createScDoc("xlsx/tdf151755_stylesLostOnXLSXExport.xlsx"); // Resave the xlsx file without any modification. - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -991,7 +990,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152581_bordercolorNotExportedToXLSX) createScDoc("xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx"); // Resave the xlsx file without any modification. - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pStyles = parseExport(u"xl/styles.xml"_ustr); CPPUNIT_ASSERT(pStyles); @@ -1003,7 +1002,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf140431) { createScDoc("xlsx/129969-min.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocument* pDoc = getScDoc(); ScAddress aPos(0, 2, 0); const EditTextObject* pEditText = pDoc->GetEditText(aPos); @@ -1020,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCheckboxFormControlXlsxExport) createScDoc("xlsx/checkbox-form-control.xlsx"); // When exporting to XLSX: - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); // Then make sure its VML markup is written and it has a correct position + size: xmlDocUniquePtr pDoc = parseExport(u"xl/drawings/vmlDrawing1.vml"_ustr); @@ -1035,7 +1034,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testButtonFormControlXlsxExport) createScDoc("xlsx/button-form-control.xlsx"); // When exporting to XLSX: - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); // Then make sure its control markup is written and it has a correct position + size: xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); @@ -1060,7 +1059,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142929_filterLessThanXLSX) // Document contains a standard filter with '<' condition. createScDoc("xlsx/tdf142929.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "//x:customFilters/x:customFilter", "val", u"2"); @@ -1086,7 +1085,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testInvalidNamedRange) CPPUNIT_TEST_FIXTURE(ScExportTest4, testExternalDefinedNameXLSX) { createScDoc("xlsx/tdf144397.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScDocShell* pDocSh = getScDocShell(); pDocSh->ReloadAllLinks(); @@ -1122,7 +1121,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testExternalDefinedNameXLSX) CPPUNIT_ASSERT_EQUAL(u"June"_ustr, aRes.maString.getString()); } - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDocXml = parseExport(u"xl/externalLinks/externalLink1.xml"_ustr); CPPUNIT_ASSERT(pDocXml); @@ -1146,7 +1145,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testHyperlinkLocationXLSX) { createScDoc("ods/tdf143220.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pDoc); @@ -1174,7 +1173,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142264ManyChartsToXLSX) pBatch->commit(); createScDoc("ods/many_charts.ods"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); css::uno::Reference xSupplier(mxComponent, css::uno::UNO_QUERY_THROW); @@ -1264,7 +1263,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf143929MultiColumnToODS) xColProps->getPropertyValue(u"AutomaticDistance"_ustr)); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { css::uno::Reference xSupplier(mxComponent, css::uno::UNO_QUERY_THROW); @@ -1311,7 +1310,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf142578) { createScDoc("ods/tdf142578.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1346,7 +1345,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf145059) createScDoc("ods/tdf145059.ods"); // Export to xlsx. - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); xmlDocUniquePtr pStyle = parseExport(u"xl/styles.xml"_ustr); @@ -1370,7 +1369,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf130104_XLSXIndent) createScDoc("xlsx/tdf130104_indent.xlsx"); // Resave the xlsx file without any modification. - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); xmlDocUniquePtr pStyle = parseExport(u"xl/styles.xml"_ustr); @@ -1462,7 +1461,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testWholeRowBold) pDoc->ApplyPatternAreaTab(0, 1, pDoc->MaxCol(), 1, 0, boldAttr); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(SCCOL(INITIALCOLCOUNT), pDoc->GetAllocatedColumnsCount(0)); vcl::Font aFont; @@ -1470,7 +1469,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testWholeRowBold) CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeightMaybeAskConfig()); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(SCCOL(INITIALCOLCOUNT), pDoc->GetAllocatedColumnsCount(0)); pDoc->GetPattern(pDoc->MaxCol(), 1, 0)->fillFontOnly(aFont); @@ -1482,13 +1481,13 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testXlsxRowsOrder) { createScDoc("xlsx/tdf58243.xlsx"); // Make sure code in SheetDataBuffer doesn't assert columns/rows sorting. - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); } CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf91286) { createScDoc("ods/tdf91286.ods"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), @@ -1509,7 +1508,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf91286) CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148820) { createScDoc("xlsx/tdf148820.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -1569,15 +1568,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testBlankInExponent) createScDoc("ods/tdf156449-Blank-In-Exponent.ods"); // save to ODS and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); lcl_TestNumberFormat(*getScDoc(), u"0.00E+?0"_ustr); lcl_SetNumberFormat(*getScDoc(), u"0.00E+??"_ustr); // at least one '0' in exponent - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); lcl_TestNumberFormat(*getScDoc(), u"0.00E+?0"_ustr); // save to XLSX and reload - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); lcl_TestNumberFormat(*getScDoc(), u"0.00E+?0"_ustr); } @@ -1587,7 +1586,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testSecondsWithoutTruncateAndDecimals) lcl_TestNumberFormat(*getScDoc(), u"[SS].00"_ustr); // save to ODS and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); lcl_TestNumberFormat(*getScDoc(), u"[SS].00"_ustr); } @@ -1596,11 +1595,11 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testBlankWidthCharacter) createScDoc("ods/tdf152724-Blank-width-char.ods"); // save to ODS and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); lcl_TestNumberFormat(*getScDoc(), u"[>0]_-?0;[<0]-?0;_-?0;@"_ustr); // save to XLSX and reload - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); lcl_TestNumberFormat(*getScDoc(), u"_-?0;-?0;_-?0;@"_ustr); } @@ -1610,7 +1609,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testEmbeddedTextInDecimal) lcl_TestNumberFormat(*getScDoc(), u"#,##0.000\" \"###\" \"###"_ustr); // save to ODS and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); lcl_TestNumberFormat(*getScDoc(), u"#,##0.000\" \"###\" \"###"_ustr); } @@ -1619,19 +1618,19 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testLowercaseExponent) createScDoc("ods/tdf153993-Exponent-lower-case.ods"); // save to ODS and reload - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); lcl_TestNumberFormat(*getScDoc(), u"0.000\" \"000\" \"e+\" \"0"_ustr); // save to XLSX and reload // lower case not preserve in XLSX - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); lcl_TestNumberFormat(*getScDoc(), u"0.000 000 E+ 0"_ustr); } CPPUNIT_TEST_FIXTURE(ScExportTest4, testTotalsRowFunction) { createScDoc("xlsx/totalsRowFunction.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { xmlDocUniquePtr pDocXml = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pDocXml); @@ -1640,7 +1639,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTotalsRowFunction) } ScDocument* pDoc = getScDoc(); pDoc->InsertCol(ScRange(3, 0, 0, 3, pDoc->MaxRow(), 0)); // Insert col 4 - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { xmlDocUniquePtr pDocXml = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pDocXml); @@ -1654,7 +1653,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTotalsRowFunction) CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf167689_xmlMaps_and_xmlColumnPr) { createScDoc("xlsx/tdf167689_xmlMaps_and_xmlColumnPr.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); // xl/xmlMaps.xml xmlDocUniquePtr pDocXml = parseExport(u"xl/xmlMaps.xml"_ustr); @@ -1685,7 +1684,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf167689_xmlMaps_and_xmlColumnPr) CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf167689_tableType) { createScDoc("xlsx/tdf167689_tableType.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDocXmlTables = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pDocXmlTables); @@ -1702,7 +1701,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf167689_tableType) CPPUNIT_TEST_FIXTURE(ScExportTest4, testAutofilterHiddenButton) { createScDoc("xlsx/hiddenButton.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); xmlDocUniquePtr pDocXml = parseExport(u"xl/tables/table1.xml"_ustr); CPPUNIT_ASSERT(pDocXml); for (int i = 1; i <= 5; i++) @@ -1756,7 +1755,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testShapeStyles) ->setPropertyValue(u"Style"_ustr, Any(xStyle)); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { uno::Reference xDPS(mxComponent, uno::UNO_QUERY_THROW); @@ -1809,7 +1808,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles) pNote->ShowCaption(aPos, false); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { ScDocument aDoc; @@ -1827,7 +1826,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles) CPPUNIT_ASSERT_EQUAL(u"MyStyle1"_ustr, pCaption->GetStyleSheet()->GetName()); } - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { ScDocument* pDoc = getScDoc(); @@ -1848,7 +1847,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles) CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf119565) { createScDoc("xlsx/tdf119565.xlsx"); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), @@ -1876,7 +1875,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf152980) createScDoc("csv/tdf152980.csv"); ScDocShell* pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDocSh = getScDocShell(); pDocSh->DoHardRecalc(); @@ -1916,7 +1915,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf100034) dispatchCommand(mxComponent, u".uno:DeletePrintArea"_ustr, {}); // Save and load back - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); // Check if the same print ranges are present pDoc = getScDoc(); @@ -1930,7 +1929,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf157318) ScDocument* pDoc = getScDoc(); // Save as XLSX and load back - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); // Check if there is one global named range @@ -1951,7 +1950,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testChangesAuthorDate) officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1980,7 +1979,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testChangesAuthorDateXLSX) officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/revisions/revisionHeaders.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -2004,7 +2003,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf163554) pDoc->GetFormula(0, 0, 0)); CPPUNIT_ASSERT_EQUAL(u"7"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(u"=SUM($'time (misc) - last'.B1:$'time (pnrst)'.B1)"_ustr, @@ -2021,7 +2020,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testNotesAuthor) officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/comments1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -2075,10 +2074,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testSheetProtections) createScDoc("xlsx/tdfSheetProts.xlsx"); verify(); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); verify(); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); verify(); } @@ -2086,7 +2085,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf164417) { createScDoc("xlsx/tdf164417.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet1 = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet1); @@ -2103,7 +2102,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf165503) // FIXME: Invalid content was found starting with element 'c:noMultiLvlLbl' skipValidation(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pChart1 = parseExport(u"xl/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pChart1); @@ -2133,7 +2132,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf165655) { createScDoc("xlsx/tdf165655.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pDrawing = parseExport(u"xl/drawings/drawing1.xml"_ustr); CPPUNIT_ASSERT(pDrawing); @@ -2149,7 +2148,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf165886) { createScDoc("xlsx/tdf165886.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -2181,7 +2180,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166413) { createScDoc("xlsx/tdf166413.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); @@ -2216,7 +2215,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166712) { createScDoc("xlsx/tdf166712.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pConn = parseExport(u"xl/connections.xml"_ustr); CPPUNIT_ASSERT(pConn); @@ -2231,7 +2230,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf167689_x15_namespace) { createScDoc("xlsx/tdf167689_x15_namespace.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pConn = parseExport(u"xl/connections.xml"_ustr); CPPUNIT_ASSERT(pConn); @@ -2257,7 +2256,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939) loadWithParams(createFileURL(u"ods/autostyle-name-is-single-char.ods"), { comphelper::makePropertyValue(u"AsTemplate"_ustr, true) }); // Saving it must not crash / fail an assertion! - save(u"calc8"_ustr); + save(TestFilter::ODS); // Check that we tested the codepath preserving existing names - otherwise test makes no sense xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -2272,7 +2271,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939_1) loadWithParams(createFileURL(u"fods/lostRowStyle.fods"), { comphelper::makePropertyValue(u"AsTemplate"_ustr, true) }); // Saving it must keep the autostyles - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath( @@ -2290,7 +2289,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939_1) CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf108244) { createScDoc("ods/tdf108244.ods"); - save(u"OpenDocument Spreadsheet Flat XML"_ustr); + save(TestFilter::FODS); xmlDocUniquePtr pXmlDoc = parseExportedFile(); CPPUNIT_ASSERT(pXmlDoc); @@ -2328,7 +2327,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf150229) // Test XLSX export: the hyperlink must truncate at 8192 character boundary - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); { auto xDoc = mxComponent.queryThrow(); @@ -2352,7 +2351,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf150229) // Test XLS export: the hyperlink must truncate at 2083 character boundary (that's the limit // I found experimentally) - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); { auto xDoc = mxComponent.queryThrow(); @@ -2382,7 +2381,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf165733_leap_day_BCE) pDoc->GetFormatTable()->GetType(pDoc->GetNumberFormat(0, 0, 0))); } - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); { xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx index b229f9060018..7cfe43594bc4 100644 --- a/sc/qa/unit/subsequent_filters_test.cxx +++ b/sc/qa/unit/subsequent_filters_test.cxx @@ -494,7 +494,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenRangeNameODS) pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN); // Check if both named ranges are hidden after saving and reloading - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pRangeData1 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE1"_ustr); CPPUNIT_ASSERT(pRangeData1); @@ -523,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenRangeNameXLSX) pRangeData2->GetUnoType() & sheet::NamedRangeFlag::HIDDEN); // Save as ODS and test if the named ranges are still with the correct hidden flag - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pRangeData1 = pDoc->GetRangeName()->findByUpperName(u"NAMEDRANGE1"_ustr); CPPUNIT_ASSERT(pRangeData1); @@ -555,7 +555,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, testHiddenNamedExpression) CPPUNIT_ASSERT_EQUAL(size_t(4), pNamedRanges->size()); // Save and reload to test whether the named expressions retain the hidden where applicable - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pNamedRanges = pDoc->GetRangeName(); CPPUNIT_ASSERT_EQUAL(size_t(4), pNamedRanges->size()); diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index 6fb5816e9057..324bcf4edd03 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -89,11 +89,12 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testMiscRowHeights) have default row heights ( there was a problem where the optimal height was being calculated after import if no hard height ) */ - { u"ods/alldefaultheights.ods", OUString(), SAL_N_ELEMENTS(DfltRowData), DfltRowData }, + { u"ods/alldefaultheights.ods", TestFilter::NONE, SAL_N_ELEMENTS(DfltRowData), + DfltRowData }, /* Checks the imported height of some multiline input, additionally checks that the optimal height flag is set ( or not ) */ - { u"ods/multilineoptimal.ods", OUString(), SAL_N_ELEMENTS(MultiLineOptData), + { u"ods/multilineoptimal.ods", TestFilter::NONE, SAL_N_ELEMENTS(MultiLineOptData), MultiLineOptData }, }; miscRowHeightsTest(aTestValues, SAL_N_ELEMENTS(aTestValues)); diff --git a/sc/qa/unit/subsequent_filters_test5.cxx b/sc/qa/unit/subsequent_filters_test5.cxx index 8f16c130fb7b..6a71eadc7591 100644 --- a/sc/qa/unit/subsequent_filters_test5.cxx +++ b/sc/qa/unit/subsequent_filters_test5.cxx @@ -242,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest5, testTdf161948_NaturalSortSaveLoad) } // Save and reload, verify file format and reloaded sort descriptor - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); assertXPath(pXmlDoc, "//table:sort", "embedded-number-behavior", u"double"); pDoc = getScDoc(); @@ -267,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest5, testTdf161948_NaturalSortSaveLoad) // Save and reload, verify file format and reloaded sort descriptor // "alpha-numeric" is default and thus not written. - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pXmlDoc = parseExport("content.xml"); assertXPathNoAttribute(pXmlDoc, "//table:sort", "embedded-number-behavior"); pDoc = getScDoc(); diff --git a/sc/qa/unit/tiledrendering/SheetViewTest.cxx b/sc/qa/unit/tiledrendering/SheetViewTest.cxx index 373d52cf2a29..f8ce5152718a 100644 --- a/sc/qa/unit/tiledrendering/SheetViewTest.cxx +++ b/sc/qa/unit/tiledrendering/SheetViewTest.cxx @@ -487,7 +487,7 @@ CPPUNIT_TEST_FIXTURE(SheetViewTest, testCheckIfSheetViewIsSavedInDocument_ODF) dispatchCommand(mxComponent, u".uno:NewSheetView"_ustr, {}); Scheduler::ProcessEventsToIdle(); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -503,7 +503,7 @@ CPPUNIT_TEST_FIXTURE(SheetViewTest, testCheckIfSheetViewIsSavedInDocument_OOXML) dispatchCommand(mxComponent, u".uno:NewSheetView"_ustr, {}); Scheduler::ProcessEventsToIdle(); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pXmlDoc = parseExport(u"xl/workbook.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index df3035b55b77..0e5710024934 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -2533,7 +2533,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidEntrySave) loadFromFile(u"validity.xlsx"); // .uno:Save modifies the original file, make a copy first - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); pModelObj->initializeForTiledRendering(uno::Sequence()); @@ -2980,7 +2980,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNoInvalidateOnSave) loadFromFile(u"invalidate-on-save.ods"); // .uno:Save modifies the original file, make a copy first - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); pModelObj->initializeForTiledRendering(uno::Sequence()); @@ -3139,7 +3139,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCellInvalidationDocWithExistingZo { uno::ContextLayer aLayer(comphelper::NewFlagContext(u"IsLOKExport"_ustr)); - save(u"calc8"_ustr); // .ODS + save(TestFilter::ODS); // .ODS } xmlDocUniquePtr pSettingsXml = parseExport(u"settings.xml"_ustr); // Multi-user export: don't save every user's view into the exported file @@ -3147,7 +3147,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCellInvalidationDocWithExistingZo // Use view's logic (not technical) zoom level for export assertXPathContent(pSettingsXml, "//config:config-item[@config:name='ZoomValue'][1]", u"150"); - save(u"Calc Office Open XML"_ustr); // .XLSX + save(TestFilter::XLSX); // .XLSX xmlDocUniquePtr pSheet1Xml = parseExport(u"xl/worksheets/sheet1.xml"_ustr); // Use view's logic (not technical) zoom level for export assertXPath(pSheet1Xml, "//x:sheetViews/x:sheetView", "zoomScale", u"150"); @@ -3479,7 +3479,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNumberFormatLocaleMultiUser) // save and reopen // .uno:Save modifies the original file, make a copy first - saveAndReload(u"Calc MS Excel 2007 VBA XML"_ustr); + saveAndReload(TestFilter::XLSM); ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); diff --git a/sc/qa/unit/tiledrendering/tiledrendering2.cxx b/sc/qa/unit/tiledrendering/tiledrendering2.cxx index ab337030338c..c5a85d5daca4 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering2.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering2.cxx @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSplitPanes) { createDoc("split-panes.ods"); - save(u"calc8"_ustr); + save(TestFilter::ODS); xmlDocUniquePtr pSettings = parseExport(u"settings.xml"_ustr); CPPUNIT_ASSERT(pSettings); @@ -190,7 +190,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSplitPanesXLSX) { createDoc("split-panes.xlsx"); - save(u"Calc Office Open XML"_ustr); + save(TestFilter::XLSX); xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); CPPUNIT_ASSERT(pSheet); diff --git a/sc/qa/unit/ucalc_solver.cxx b/sc/qa/unit/ucalc_solver.cxx index fc48c648acac..7e4882d90be6 100644 --- a/sc/qa/unit/ucalc_solver.cxx +++ b/sc/qa/unit/ucalc_solver.cxx @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(SolverTest, testSingleModel) // Save and reload the file pSettings->SaveSolverSettings(); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pTable = pDoc->FetchTable(0); pSettings = pTable->GetSolverSettings(); diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index b378a61121c5..697d6b6df0a5 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -98,7 +98,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) insertStringToCell(u"D3"_ustr, u"FISHY"); // Save the document - save(u"calc8"_ustr); + save(TestFilter::ODS); // Open a new document createScDoc(); @@ -305,7 +305,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994) insertStringToCell(u"B1"_ustr, u"2"); // Save the document - save(u"calc8"_ustr); + save(TestFilter::ODS); // Open a new document createScDoc(); @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf113541) insertStringToCell(u"A1"_ustr, u"50"); // Save the document - save(u"calc8"_ustr); + save(TestFilter::ODS); // Open a new document createScDoc(); @@ -789,7 +789,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124820) dispatchCommand(mxComponent, u".uno:Strikeout"_ustr, {}); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); vcl::Font aFont; @@ -1024,7 +1024,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143896) CPPUNIT_ASSERT_EQUAL(u"Test"_ustr, pDoc->GetString(ScAddress(0, 1999, 0))); - saveAndReload(u"Calc Office Open XML"_ustr); + saveAndReload(TestFilter::XLSX); pDoc = getScDoc(); // Without the fix in place, this test would have failed with @@ -1083,7 +1083,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159046) dispatchCommand(mxComponent, u".uno:Paste"_ustr, {}); // Without the fix in place, this test would have crashed here - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); pDrawLayer = pDoc->GetDrawLayer(); @@ -1130,7 +1130,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144244) CPPUNIT_ASSERT_EQUAL(u"x"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); // Without the fix in place, this test would have crashed - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pModelObj = comphelper::getFromUnoTunnel(mxComponent); pDoc = getScDoc(); @@ -1206,7 +1206,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100582) dispatchCommand(mxComponent, u".uno:Paste"_ustr, {}); - saveAndReload(u"MS Excel 97"_ustr); + saveAndReload(TestFilter::XLS); pDoc = getScDoc(); OUString aFormula = pDoc->GetFormula(3, 10, 0); @@ -2503,7 +2503,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143940) // Without the fix in place, this test would have crashed // FIXME: Error: uncompleted content model. expecting: , skipValidation(); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); pDoc = getScDoc(); CPPUNIT_ASSERT(pDoc); diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx index 0d3c554e4b76..460a6c10db1f 100644 --- a/sd/qa/filter/eppt/eppt.cxx +++ b/sd/qa/filter/eppt/eppt.cxx @@ -39,7 +39,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOOXMLCustomShapeBitmapFill) { // Save the bugdoc to PPT. loadFromFile(u"custom-shape-bitmap-fill.pptx"); - saveAndReload(u"MS PowerPoint 97"_ustr); + saveAndReload(TestFilter::PPT); // Check if the bitmap shape was lost. uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); @@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport) } // Export to PPTX and load again: - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // Verify that this color is not lost: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/theme/theme1.xml"_ustr); @@ -117,7 +117,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation) loadFromFile(u"video-loop.pptx"); // When exporting that to PPTX: - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Then make sure that the "infinite" repeat count is written: xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); diff --git a/sd/qa/unit/FontEmbeddingTest.cxx b/sd/qa/unit/FontEmbeddingTest.cxx index 1b3169a6e5d9..79c77372282e 100644 --- a/sd/qa/unit/FontEmbeddingTest.cxx +++ b/sd/qa/unit/FontEmbeddingTest.cxx @@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testRoundtripEmbeddedFontsPPTX) } // Test Export - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Check the exported document has the font { @@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testExportEmbeddedFontsPPTX) xProps->setPropertyValue(u"EmbedAsianScriptFonts"_ustr, uno::Any(false)); xProps->setPropertyValue(u"EmbedComplexScriptFonts"_ustr, uno::Any(false)); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Check the exported document has the embedded fonts enabled and has entries { @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testTdf167214) createSdImpressDoc("pptx/tdf167214.pptx"); verify(); //Without the fix in place, it would crash at export time - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); verify(); } diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index d1cc8a805447..97087b9d9788 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -23,7 +23,7 @@ public: void testHTMLExport() { loadFromFile(u"HtmlExportTestDocument.odp"); - save(u"impress_html_Export"_ustr); + save(TestFilter::HTML_IMPRESS); htmlDocUniquePtr htmlDoc = parseHtml(maTempFile); assertXPath(htmlDoc, "/html", 1); @@ -43,7 +43,7 @@ public: void testTdf154989() { loadFromFile(u"tdf154989.odg"); - save(u"XHTML Draw File"_ustr); + save(TestFilter::XHTML_DRAW); xmlDocUniquePtr pXmlDoc = parseXml(maTempFile); assertXPath(pXmlDoc, "/xhtml:html", 1); diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index 68d73bee89db..8eaa8cb9e8d4 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -77,7 +77,7 @@ public: void testSVGExportTextDecorations() { loadFromFile(u"svg-export-text-decorations.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -100,7 +100,7 @@ public: void testSVGExportJavascriptURL() { loadFromFile(u"textbox-link-javascript.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -115,7 +115,7 @@ public: void testSVGExportSlideCustomBackground() { loadFromFile(u"slide-custom-background.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -126,7 +126,7 @@ public: void testSVGExportTextFieldsInMasterPage() { loadFromFile(u"text-fields.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -150,7 +150,7 @@ public: void testSVGExportEmbeddedVideo() { loadFromFile(u"slide-video-thumbnail.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -181,7 +181,7 @@ public: void testSVGExportSlideBitmapBackground() { loadFromFile(u"slide-bitmap-background.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -210,7 +210,7 @@ public: void testSVGExportSlideTileBitmapBackground() { loadFromFile(u"slide-tile-background.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); @@ -275,7 +275,7 @@ public: Application::SetSettings(aSettings); loadFromFile(u"text-fields.odp"); - save(u"impress_svg_Export"_ustr); + save(TestFilter::SVG_IMPRESS); xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); diff --git a/sd/qa/unit/ShapeImportExportTest.cxx b/sd/qa/unit/ShapeImportExportTest.cxx index 9da163e11c80..a33267275a94 100644 --- a/sd/qa/unit/ShapeImportExportTest.cxx +++ b/sd/qa/unit/ShapeImportExportTest.cxx @@ -256,7 +256,7 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export() { createSdImpressDoc("TextDistancesInsets3.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -372,7 +372,7 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export() void ShapeImportExportTest::testTextDistancesODP_OOXML_Export() { createSdImpressDoc("odp/tdf150966_hugeInset.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 7d2ae3c7e366..4d6ff232b5f7 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -77,7 +77,7 @@ void checkFontAttributes(const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf152335) { createSdImpressDoc("pptx/tdf152335.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocTheme = parseExport(u"ppt/theme/theme1.xml"_ustr); assertXPathChildren( @@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf152335) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149803) { createSdImpressDoc("pptx/tdf149803.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp", "useBgFill", u"1"); @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149803) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149311) { createSdImpressDoc("odp/tdf149311.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pRelsDoc = parseExport(u"ppt/slides/_rels/slide1.xml.rels"_ustr); @@ -107,7 +107,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149311) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149128) { createSdImpressDoc("odp/tdf149128.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id", @@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149128) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf66228) { createSdImpressDoc("odp/tdf66228.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", "prst", @@ -133,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf66228) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf147919) { createSdImpressDoc("odp/tdf147919.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom", "prst", @@ -202,7 +202,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf147919) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf130165) { createSdImpressDoc("pptx/tdf146223.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld", "showMasterSp", u"0"); @@ -211,7 +211,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf130165) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124781) { createSdImpressDoc("odp/tdf124781.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r[2]/a:rPr", "baseline", @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124781) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf168786_ppt_to_pptx_internal_link_to_nowhere) { createSdImpressDoc("ppt/tdf168786.ppt"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", @@ -241,7 +241,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf168786_ppt_to_pptx_internal_link CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf144914) { createSdImpressDoc("pptx/tdf144616.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", @@ -281,7 +281,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf144914) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124232) { createSdImpressDoc("pptx/tdf141704.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", @@ -321,7 +321,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124232) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143624) { createSdImpressDoc("pptx/tdf143624.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presProps.xml"_ustr); @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf142648) uno::Reference xNamed(xDrawPage, uno::UNO_QUERY_THROW); xNamed->setName(u"#Slide 1"_ustr); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pRelsDoc = parseExport(u"ppt/slides/_rels/slide2.xml.rels"_ustr); @@ -352,7 +352,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf142648) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf47365) { createSdImpressDoc("pptx/loopNoPause.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presProps.xml"_ustr); @@ -364,7 +364,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf47365) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125071) { createSdImpressDoc("pptx/tdf125071.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presentation.xml"_ustr); @@ -375,7 +375,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125071) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf54037) { createSdImpressDoc("pptx/tdf54037.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); xmlDocUniquePtr pRelsDoc = parseExport(u"ppt/slides/_rels/slide1.xml.rels"_ustr); @@ -393,7 +393,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf54037) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127237) { createSdImpressDoc("pptx/tdf127237.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); const SdrPage* pPage = GetPage(1); CPPUNIT_ASSERT(pPage != nullptr); @@ -412,7 +412,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127237) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc887230) { createSdImpressDoc("pptx/bnc887230.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -426,7 +426,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc887230) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_1) { createSdImpressDoc("pptx/bnc870233_1.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_1) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_2) { createSdImpressDoc("pptx/bnc870233_2.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -486,7 +486,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390_4) bool bPassed = false; createSdImpressDoc("n828390_4.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); { @@ -524,7 +524,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390_5) { createSdImpressDoc("n828390_5.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); { @@ -608,7 +608,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testPlaceholderFillAndOutlineExport) aLineStyle = xShpProps->getPropertyValue(u"LineStyle"_ustr); aLineColor = xShpProps->getPropertyValue(u"LineColor"_ustr); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); continue; } else @@ -635,7 +635,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo71961) { createSdImpressDoc("fdo71961.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); // Export to .pptx changes all text frames to custom shape objects, which obey TextWordWrap property @@ -664,7 +664,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390) bool bPassed = false; createSdImpressDoc("pptx/n828390.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); { @@ -687,7 +687,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testN828390) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc880763) { createSdImpressDoc("pptx/bnc880763.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -712,7 +712,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc880763) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc862510_5) { createSdImpressDoc("pptx/bnc862510_5.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -733,7 +733,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc862510_5) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc822347_EmptyBullet) { createSdImpressDoc("bnc822347_EmptyBullet.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); @@ -763,7 +763,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc822347_EmptyBullet) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo90607) { createSdImpressDoc("fdo90607.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(1)); @@ -776,7 +776,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo90607) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo83751) { createSdImpressDoc("pptx/fdo83751.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDocumentPropertiesSupplier( mxComponent, uno::UNO_QUERY); @@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo83751) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testFdo79731) { createSdImpressDoc("fdo79731.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); SdDrawDocument* pDoc = pXImpressDocument->GetDoc(); @@ -805,7 +805,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTableCellFillProperties) createSdImpressDoc("odp/Table_with_Cell_Fill.odp"); // Export the document and import again for a check - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTableCellFillProperties) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletStartNumber) { createSdImpressDoc("pptx/n90255.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(0)); @@ -850,7 +850,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletStartNumber) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testLineStyle) { createSdImpressDoc("pptx/lineStyle.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); SdrObject const* pShape = pPage->GetObj(0); @@ -876,7 +876,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf134862) CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB, nWritingMode); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); xShape.set(getShapeFromPage(0, 0)); @@ -893,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRightToLeftParaghraph) { createSdImpressDoc("pptx/rightToLeftParagraph.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); // Get first paragraph @@ -910,7 +910,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTextboxWithHyperlink) { createSdImpressDoc("pptx/hyperlinktest.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); // Get first paragraph @@ -934,7 +934,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf136911) { createSdImpressDoc("ppt/tdf136911.ppt"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); // Get second paragraph @@ -958,7 +958,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletColor) { createSdImpressDoc("pptx/bulletColor.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -975,7 +975,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletColor) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletCharAndFont) { createSdImpressDoc("odp/bulletCharAndFont.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); @@ -1004,7 +1004,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletCharAndFont) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletMarginAndIndentation) { createSdImpressDoc("pptx/bulletMarginAndIndent.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -1026,7 +1026,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testParaMarginAndindentation) { createSdImpressDoc("pptx/paraMarginAndIndentation.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); // Get first paragraph @@ -1045,7 +1045,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testParaMarginAndindentation) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCellLeftAndRightMargin) { createSdImpressDoc("pptx/n90223.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); sal_Int32 nLeftMargin, nRightMargin; const SdrPage* pPage = GetPage(1); @@ -1083,7 +1083,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCellLeftAndRightMargin) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testMergedCells) { createSdImpressDoc("odp/cellspan.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); sdr::table::SdrTableObj* pTableObj = dynamic_cast(pPage->GetObj(0)); @@ -1100,7 +1100,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testMergedCells) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTableCellBorder) { createSdImpressDoc("pptx/n90190.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -1144,7 +1144,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTableCellBorder) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf111884) { createSdImpressDoc("pptx/tdf111884.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); SdrObject const* pShape = pPage->GetObj(2); @@ -1158,7 +1158,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf112633) { // Load document and export it to a temporary file createSdImpressDoc("pptx/tdf112633.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); xmlDocUniquePtr pRelsDoc = parseExport(u"ppt/slides/_rels/slide1.xml.rels"_ustr); @@ -1188,7 +1188,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf112633) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128952) { createSdImpressDoc("pptx/tdf128952.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1201,7 +1201,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128952) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf127090) { createSdImpressDoc("pptx/tdf127090.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1212,7 +1212,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomXml) { // Load document and export it to a temporary file createSdImpressDoc("pptx/customxml.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"customXml/item1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -1233,7 +1233,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf94238) { // Load document and export it to a temporary file. createSdImpressDoc("pptx/tdf94238.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDoc.is()); @@ -1276,7 +1276,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testPictureTransparency) { // Load document and export it to a temporary file. createSdImpressDoc("odp/image_transparency.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDoc.is()); @@ -1294,7 +1294,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testPictureTransparency) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf125554) { createSdImpressDoc("pptx/tdf125554.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape = getShapeFromPage(0, 0); uno::Any aFillTransparenceGradientName @@ -1323,7 +1323,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRoundtripOwnLineStyles) } // Save to pptx, reload and compare the LineDash values - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xDocpptx(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDocpptx.is()); uno::Reference xPagepptx(xDocpptx->getDrawPages()->getByIndex(0), @@ -1350,7 +1350,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testRoundtripPrstDash) { // load and save document, compare prstDash values in saved document with original. createSdImpressDoc("pptx/presetDashDot.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); const OUString sOriginal[] = { u"dash"_ustr, u"dashDot"_ustr, u"dot"_ustr, u"lgDash"_ustr, @@ -1388,7 +1388,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testDashOnHairline) { // load and save document, make sure the custDash has 11 child elements. createSdImpressDoc("odp/tdf127267DashOnHairline.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:ln/a:custDash/a:ds", 11); @@ -1399,13 +1399,13 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationNonMediaShape) createSdImpressDoc("pptx/narration-non-media-shape.pptx"); // Without the accompanying fix in place, this test would have failed, // beans::UnknownPropertyException was thrown. - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomshapeBitmapfillSrcrect) { createSdImpressDoc("pptx/customshape-bitmapfill-srcrect.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1436,7 +1436,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testCustomshapeBitmapfillSrcrect) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkBitmapFill) { createSdImpressDoc("odp/tdf100348_FontworkBitmapFill.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Make sure the fontwork shape has a blip bitmap fill and a colored outline. // Without the patch, fill and outline were black. @@ -1449,7 +1449,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkBitmapFill) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkGradientGlow) { createSdImpressDoc("odp/tdf100348_FontworkGradientGlow.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Make sure the fontwork shape has a gradient fill and a colored glow. // Without the patch, fill was black and no glow applied. @@ -1464,7 +1464,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf100348FontworkGradientGlow) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345FullTransparentGradient) { createSdImpressDoc("odp/tdf128345_FullTransparentGradient.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Make sure the shape has no fill. Without the patch, fill was solid red. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1474,7 +1474,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345FullTransparentGradient) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientLinear) { createSdImpressDoc("odp/tdf128345_GradientLinear.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Make sure the shape has a lin fill. Without the patch, fill was solid red. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1494,7 +1494,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientLinear) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientRadial) { createSdImpressDoc("odp/tdf128345_GradientRadial.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Make sure the shape has transparency. In OOXML alpha means 'opacity' with default // 100000 for full opak, so only the full transparency with val 0 should be written. @@ -1512,7 +1512,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientAxial) // Without the patch, symmetric linear gradient with full transparence outside and // full opak in the middle were imported as full transparent. createSdImpressDoc("odp/tdf128345_GradientAxial.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShapePropSet(getShapeFromPage(0, 0)); awt::Gradient2 aTransparenceGradient; @@ -1535,7 +1535,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf128345GradientAxial) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf134969TransparencyOnColorGradient) { createSdImpressDoc("odp/tdf134969_TransparencyOnColorGradient.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Make sure the shape has a transparency in gradient stops. xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1550,7 +1550,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf134969TransparencyOnColorGradien CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testArcTo) { createSdImpressDoc("pptx/arc-validiert.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); static constexpr const char* sPath("//a:custGeom/a:pathLst/a:path/a:arcTo"); @@ -1563,7 +1563,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testArcTo) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationMimeType) { createSdImpressDoc("pptx/narration.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); // Without the accompanying fix in place, this test would have failed with: // - Expected: audio/mp4 @@ -1626,7 +1626,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testNarrationMimeType) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf150316) { createSdImpressDoc("odp/tdf150316.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:p/a:pPr", "indent", u"-343080"); @@ -1635,7 +1635,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf150316) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf140865Wordart3D) { createSdImpressDoc("pptx/tdf140865Wordart3D.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // without the fix in place a:sp3d was lost on round trip, and so extrusion was lost. @@ -1655,7 +1655,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf140865Wordart3D) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124457) { createSdImpressDoc("pptx/tdf124457.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1673,7 +1673,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf124457) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143126) { createSdImpressDoc("pptx/tdf143126.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presProps.xml"_ustr); @@ -1685,7 +1685,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143126) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143129) { createSdImpressDoc("pptx/tdf143129.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presProps.xml"_ustr); @@ -1696,7 +1696,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf143129) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf118045) { createSdImpressDoc("odp/tdf118045.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:lnSpc/a:spcPct", "val", @@ -1706,7 +1706,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf118045) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf137675) { createSdImpressDoc("pptx/tdf137675.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill", @@ -1716,7 +1716,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf137675) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf151134) { createSdImpressDoc("pptx/tdf151134.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr", "lIns", u"91440"); diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index b09b194cd8bb..9678eabb27ee 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -85,7 +85,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testRepeatBitmapMode) if (!IsDefaultDPI()) return; createSdImpressDoc("odp/repeatBitmapMode.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:tile", "tx", u"1269669"); @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testRepeatBitmapMode) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf153107) { createSdImpressDoc("odp/tdf153107.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // placeholder xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -164,7 +164,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf153107) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf142291) { createSdImpressDoc("pptx/tdt142291.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, @@ -192,7 +192,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf142291) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf151492) { createSdImpressDoc("odp/tdf151492.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", @@ -202,7 +202,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf151492) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149697) { createSdImpressDoc("pptx/tdf149697.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, @@ -220,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149697) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149126) { createSdImpressDoc("odp/tdf149126.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom", "prst", @@ -230,7 +230,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf149126) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf131905) { createSdImpressDoc("pptx/tdf131905.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath( @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf131905) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf93883) { createSdImpressDoc("odp/tdf93883.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); uno::Reference xPropSet(xParagraph, uno::UNO_QUERY_THROW); @@ -263,7 +263,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testBnc822341) { // Check import / export of embedded text document createSdImpressDoc("odp/bnc822341.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Export an LO specific ole object (imported from an ODP document) { @@ -291,7 +291,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testBnc822341) CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Export an MS specific ole object (imported from a PPTX document) { @@ -324,7 +324,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathObject) { // Check import / export of math object createSdImpressDoc("odp/math.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Export an LO specific ole object (imported from an ODP document) { @@ -342,7 +342,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathObject) CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Export an MS specific ole object (imported from a PPTX document) { @@ -365,7 +365,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathExportNonBMP) { // Check import / export of math object createSdImpressDoc("odp/Math.fodp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Export an MS specific ole object { @@ -387,7 +387,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathExportNonBMP) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf119015) { createSdImpressDoc("pptx/tdf119015.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -407,7 +407,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf119015) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf123090) { createSdImpressDoc("pptx/tdf123090.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -431,7 +431,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf123090) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf126324) { createSdImpressDoc("pptx/tdf126324.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY); uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT(xPage.is()); @@ -462,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf119187) = rProperties.GetItem(SDRATTR_TEXT_VERTADJUST); const SdrTextVertAdjust eTVA = rSdrTextVertAdjustItem.GetValue(); CPPUNIT_ASSERT_EQUAL(SDRTEXTVERTADJUST_TOP, eTVA); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); } } @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf132472) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf80224) { createSdImpressDoc("odp/tdf80224.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); @@ -522,7 +522,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf91378) OUString propValue; xUDProps->getPropertyValue(u"Testing"_ustr) >>= propValue; CPPUNIT_ASSERT(propValue.isEmpty()); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); } } @@ -575,7 +575,7 @@ static bool checkTransitionOnPage(uno::Reference co CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testExportTransitionsPPTX) { createSdImpressDoc("AllTransitions.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); // WIPE TRANSITIONS @@ -728,7 +728,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPresetShapesExport) "val 3770", }; - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocCT = parseExport(u"ppt/slides/slide1.xml"_ustr); static constexpr OStringLiteral sT("_T_"); @@ -772,7 +772,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf92527) uno::Reference xPropertySet1(xShape1, uno::UNO_QUERY); xPropertySet1->setPropertyValue(u"CustomShapeGeometry"_ustr, uno::Any(aShapeGeometry)); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDoc2(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xPage2(xDoc2->getDrawPages()->getByIndex(0), @@ -852,7 +852,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testDatetimeFieldNumberFormat) { createSdImpressDoc("odp/numfmt.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); for (sal_uInt16 i = 0; i <= 8; ++i) { @@ -864,7 +864,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testDatetimeFieldNumberFormatPPTX) { createSdImpressDoc("pptx/numfmt.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); for (sal_uInt16 i = 0; i <= 8; ++i) { @@ -876,7 +876,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testSlideNumberField) { createSdImpressDoc("odp/slidenum_field.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xField = getTextFieldFromPage(0, 0, 0, 0); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is()); @@ -886,7 +886,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testSlideNumberFieldPPTX) { createSdImpressDoc("pptx/slidenum_field.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xField = getTextFieldFromPage(0, 0, 0, 0); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is()); @@ -896,7 +896,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testSlideCountField) { createSdImpressDoc("odp/slidecount_field.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xField = getTextFieldFromPage(0, 0, 0, 0); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is()); @@ -906,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testSlideNameField) { createSdImpressDoc("odp/slidename_field.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xField = getTextFieldFromPage(0, 0, 0, 0); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is()); @@ -916,7 +916,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testExtFileField) { createSdImpressDoc("odp/extfile_field.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); for (sal_uInt16 i = 0; i <= 3; ++i) { @@ -947,7 +947,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAuthorField) { createSdImpressDoc("odp/author_field.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xField = getTextFieldFromPage(0, 0, 0, 0); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is()); @@ -956,7 +956,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAuthorField) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf99224) { createSdImpressDoc("odp/tdf99224.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xPage = getPage(0); // This was 0: the image with text was lost on export. CPPUNIT_ASSERT_EQUAL(static_cast(1), xPage->getCount()); @@ -965,7 +965,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf99224) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf92076) { createSdImpressDoc("odp/tdf92076.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xPage = getPage(0); CPPUNIT_ASSERT_EQUAL(static_cast(2), xPage->getCount()); } @@ -973,7 +973,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf92076) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf59046) { createSdImpressDoc("odp/tdf59046.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", 1); } @@ -981,7 +981,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf59046) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf133502) { createSdImpressDoc("odp/tdf133502.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/comments/comment1.xml"_ustr); // Without the fix to tdf#168754 the special characters would cause errors during parsing @@ -997,7 +997,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf105739) { // Gradient was lost during saving to ODP createSdImpressDoc("pptx/tdf105739.pptx"); - save(u"impress8"_ustr); + save(TestFilter::ODP); uno::Reference xPage = getPage(0); uno::Reference xPropSet(xPage, uno::UNO_QUERY); uno::Any aAny = xPropSet->getPropertyValue(u"Background"_ustr); @@ -1033,7 +1033,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPageBitmapWithTransparency) { createSdImpressDoc("pptx/page_transparent_bitmap.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xDoc(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one page", static_cast(1), xDoc->getDrawPages()->getCount()); @@ -1056,7 +1056,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPageBitmapWithTransparency) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPptmContentType) { createSdImpressDoc("pptm/macro.pptm"); - save(u"Impress MS PowerPoint 2007 XML VBA"_ustr); + save(TestFilter::PPTM); // Assert that the content type is the one of PPTM xmlDocUniquePtr pXmlContentType = parseExport(u"[Content_Types].xml"_ustr); @@ -1068,7 +1068,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPptmContentType) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111798) { createSdImpressDoc("odp/tdf111798.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); const std::u16string_view data[][11] @@ -1106,7 +1106,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111798) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPptmVBAStream) { createSdImpressDoc("pptm/macro.pptm"); - save(u"Impress MS PowerPoint 2007 XML VBA"_ustr); + save(TestFilter::PPTM); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), @@ -1118,7 +1118,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPptmVBAStream) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111863) { createSdImpressDoc("pptx/tdf111863.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // check that transition attribute didn't change from 'out' to 'in' xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1131,7 +1131,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111863) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111518) { createSdImpressDoc("pptx/tdf111518.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slides/slide1.xml"_ustr); OUString sActual = getXPath(pXmlDocRels, @@ -1145,7 +1145,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111518) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf100387) { createSdImpressDoc("odp/tdf100387.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn", @@ -1197,7 +1197,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf100387) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testClosingShapesAndLineCaps) { createSdImpressDoc("odp/closed-shapes.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", @@ -1244,7 +1244,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testClosingShapesAndLineCaps) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testRotateFlip) { createSdImpressDoc("odp/rotate_flip.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); const std::u16string_view data[][4] = { // flipH flipV x y @@ -1291,7 +1291,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testRotateFlip) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867) { createSdImpressDoc("pptx/tdf106867.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); @@ -1324,7 +1324,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280) { createSdImpressDoc("pptx/tdf112280.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // check the animRot value xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1337,7 +1337,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112088) { createSdImpressDoc("pptx/tdf112088.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // check gradient stops xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1348,7 +1348,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112088) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112333) { createSdImpressDoc("pptx/tdf112333.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1396,7 +1396,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112552) { // Background fill was not displayed, but it was because of the wrong geometry createSdImpressDoc("odp/tdf112552.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", @@ -1415,7 +1415,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112557) { // Subtitle shape should be skipped by export. createSdImpressDoc("odp/tdf112557.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slideMasters/slideMaster1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sldMaster/p:cSld/p:spTree/p:sp", 2); // title and object @@ -1424,7 +1424,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112557) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf128049) { createSdImpressDoc("odp/tdf128049.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom", 0); @@ -1439,7 +1439,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf128049) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106026) { createSdImpressDoc("odp/tdf106026.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlMasterContent = parseExport(u"ppt/slideMasters/slideMaster1.xml"_ustr); assertXPath(pXmlMasterContent, @@ -1479,7 +1479,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106026) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112334) { createSdImpressDoc("pptx/tdf112334.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1493,7 +1493,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112334) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112089) { createSdImpressDoc("pptx/tdf112089.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1510,7 +1510,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112089) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112086) { createSdImpressDoc("pptx/tdf112086.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1544,7 +1544,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112086) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112647) { createSdImpressDoc("odp/tdf112647.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference xParagraph(getParagraphFromShape(0, xShape)); uno::Reference xPropSet(xParagraph, uno::UNO_QUERY_THROW); @@ -1558,7 +1558,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112647) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testGroupRotation) { createSdImpressDoc("odp/group_rotation.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:grpSpPr/a:xfrm", @@ -1572,7 +1572,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testGroupRotation) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf104788) { createSdImpressDoc("pptx/tdf104788.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide6.xml"_ustr); @@ -1602,7 +1602,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testSmartartRotation2) uno::Sequence aInteropGrabBag; xShape->setPropertyValue(u"InteropGrabBag"_ustr, uno::Any(aInteropGrabBag)); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPathContent(pXmlDocContent, @@ -1622,7 +1622,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testSmartartRotation2) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf91999_rotateShape) { createSdImpressDoc("pptx/tdf91999_rotateShape.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr", "name", @@ -1639,7 +1639,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf91999_rotateShape) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf114845_rotateShape) { createSdImpressDoc("pptx/tdf114845_rotateShape.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp[2]/p:nvCxnSpPr/p:cNvPr", "name", @@ -1658,7 +1658,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf114845_rotateShape) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testGroupsPosition) { createSdImpressDoc("pptx/group.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp[1]/p:sp[1]/p:spPr/a:xfrm/a:off", @@ -1674,7 +1674,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testGroupsPosition) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testGroupsRotatedPosition) { createSdImpressDoc("pptx/group-rot.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[3]/p:spPr/a:xfrm/a:off", "x", @@ -1686,7 +1686,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testGroupsRotatedPosition) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor) { createSdImpressDoc("pptx/accent-color.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:sp/p:style/a:fillRef/a:schemeClr", "val", @@ -1712,7 +1712,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors) { createSdImpressDoc("pptx/tdf84205.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocTheme2 = parseExport(u"ppt/theme/theme1.xml"_ustr); assertXPathInsensitive(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", @@ -1725,7 +1725,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111785) { createSdImpressDoc("odp/tdf111785.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1740,7 +1740,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111785) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf118825) { createSdImpressDoc("odp/tdf118825-motionpath.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); CPPUNIT_ASSERT_MOTIONPATH( @@ -1800,7 +1800,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTextColumns_tdf140852) CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(1000)), xColProps->getPropertyValue(u"AutomaticDistance"_ustr)); } - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); { uno::Reference xPage(getPage(0)); @@ -1846,7 +1846,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTextColumns_3columns) CPPUNIT_ASSERT_LESS(100.0, fFontScale); } - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); { uno::Reference xPage(getPage(0)); @@ -1876,7 +1876,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf59323_slideFooters) { createSdImpressDoc("pptx/tdf59323.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDoc->getDrawPages()->getCount()); @@ -1918,7 +1918,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf53970) // Embedded media file { createSdImpressDoc("odp/tdf53970.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // Without fix in place, the media shape was lost on export. CPPUNIT_ASSERT(getPage(0)->hasElements()); @@ -1927,7 +1927,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf53970) // Linked media file { createSdImpressDoc("odp/tdf53970_linked.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlRels = parseExport(u"ppt/slides/_rels/slide1.xml.rels"_ustr); CPPUNIT_ASSERT(pXmlRels); diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index c804362c9ee5..a41639382fb3 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -30,7 +30,7 @@ public: CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf165670) { createSdImpressDoc("pptx/tdf165670.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf165670) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf165262) { createSdImpressDoc("ppt/tdf165262.ppt"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[1]/p:spPr/a:custGeom"); @@ -78,7 +78,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf165262) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf164775_ConnectorShape) { createSdImpressDoc("odp/tdf164775.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf164775_ConnectorShape) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf153105) { createSdImpressDoc("odp/tdf153105.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:bg/p:bgPr/a:blipFill/a:stretch/a:fillRect", "l", @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf153105) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf92222) { createSdImpressDoc("pptx/tdf92222.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocTheme = parseExport(u"ppt/theme/theme1.xml"_ustr); assertXPath(pXmlDocTheme, "/a:theme/a:themeElements/a:fmtScheme/a:lnStyleLst/a:ln[1]", "w", @@ -120,7 +120,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf92222) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf129430) { createSdImpressDoc("odp/tdf129430.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:pPr/a:lnSpc/a:spcPct", @@ -130,7 +130,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf129430) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf114848) { createSdImpressDoc("pptx/tdf114848.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocTheme1 = parseExport(u"ppt/theme/theme1.xml"_ustr); assertXPathInsensitive(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", @@ -140,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf114848) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf147586) { createSdImpressDoc("pptx/tdf147586.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); // Without the fix in place, this test would have failed with @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf147586) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf68759) { createSdImpressDoc("odp/tdf68759.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[1]/p:spPr/a:xfrm/a:off", "x", @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf68759) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf127901) { createSdImpressDoc("odp/tdf127901.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip/a:lum", "bright", @@ -199,7 +199,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf127901) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf48735) { createSdImpressDoc("odp/tdf48735.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent1, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:srcRect", "b", @@ -215,7 +215,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf48735) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf90626) { createSdImpressDoc("odp/tdf90626.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[1]/a:pPr/a:buSzPct", @@ -231,7 +231,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf90626) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf107608) { createSdImpressDoc("pptx/tdf107608.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference xPropSet(xShape, uno::UNO_SET_THROW); @@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf111786) // Export line transparency with the color createSdImpressDoc("pptx/tdf111786.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference xPropSet(xShape, uno::UNO_SET_THROW); @@ -271,7 +271,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf111786) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testFontScale) { createSdImpressDoc("pptx/font-scale.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); // Rounding errors possible, approximate value (+/- 1%) @@ -283,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testFontScale) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testShapeAutofitPPTX) { createSdImpressDoc("pptx/testShapeAutofit.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); CPPUNIT_ASSERT(pXmlDocContent); @@ -296,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testShapeAutofitPPTX) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testLegacyShapeAutofitPPTX) { createSdImpressDoc("odp/testLegacyShapeAutofit.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); CPPUNIT_ASSERT(pXmlDocContent); @@ -311,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testLegacyShapeAutofitPPTX) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115394) { createSdImpressDoc("pptx/tdf115394.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); @@ -347,7 +347,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115394) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115394Zero) { createSdImpressDoc("pptx/tdf115394-zero.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); double fTransitionDuration; SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); @@ -361,7 +361,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115394Zero) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115005) { createSdImpressDoc("odp/tdf115005.odp"); - save(u"impress8"_ustr); + save(TestFilter::ODP); // additional checks of the output file uno::Reference xNameAccess @@ -394,7 +394,7 @@ int SdOOXMLExportTest3::testTdf115005_FallBack_Images(bool bAddReplacementImages } // save the file with already set options - save(u"impress8"_ustr); + save(TestFilter::ODP); // additional checks of the output file uno::Reference xNameAccess @@ -432,7 +432,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115005_FallBack_Images_Off) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118806) { createSdImpressDoc("odp/tdf118806.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "//p:animMotion", "origin", u"layout"); @@ -441,7 +441,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118806) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf130058) { createSdImpressDoc("pptx/tdf130058.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); bool bHasShadow = false; @@ -471,7 +471,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf111789) // Shadow properties were not exported for text shapes. createSdImpressDoc("pptx/tdf111789.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // First text shape has some shadow { @@ -510,7 +510,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf111789) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf145162) { createSdImpressDoc("pptx/tdf145162.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[2]/a:pPr/a:buNone"); @@ -522,7 +522,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testZeroIndentExport) // Load the bugdoc and save to pptx then. createSdImpressDoc("odp/testZeroIndent.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // There are 3 slides, get them xmlDocUniquePtr pSlide1 = parseExport(u"ppt/slides/slide1.xml"_ustr); xmlDocUniquePtr pSlide2 = parseExport(u"ppt/slides/slide2.xml"_ustr); @@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testZeroIndentExport) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf100348_convert_Fontwork2TextWarp) { createSdImpressDoc("odp/tdf100348_Fontwork2TextWarp.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Resulting pptx has to contain the TextWarp shape xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -606,7 +606,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf100348_convert_Fontwork2TextWarp CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf125573_FontWorkScaleX) { createSdImpressDoc("pptx/tdf125573_FontWorkScaleX.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Error was, that attribute 'fromWordArt' was ignored // ensure, resulting pptx has fromWordArt="1" on textArchDown shape @@ -640,7 +640,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf99497_keepAppearanceOfCircleKind // Adjustment values need to exist and their values need to correspond to the // original angles. Shape 'arc' needs to be unfilled. createSdImpressDoc("odp/tdf99497_CircleKind.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // slide 1 45° -> adj1 = 20493903, 270° -> adj2 = 5400000, exists xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -671,7 +671,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf99497_keepAppearanceOfCircleKind CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf104792) { createSdImpressDoc("pptx/tdf104792-smart-art-animation.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, @@ -684,7 +684,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf104792) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf90627) { createSdImpressDoc("odp/tdf90627.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); // Don't export empty endCondLst without cond. @@ -698,7 +698,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf90627) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf104786) { createSdImpressDoc("pptx/tdf104786.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide2.xml"_ustr); // Don't export empty 'to' @@ -712,7 +712,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf104786) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118783) { createSdImpressDoc("odp/tdf118783.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); OUString sAttributeName @@ -723,7 +723,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118783) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf104789) { createSdImpressDoc("pptx/tdf104789.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); OUString sAttributeName = getXPathContent( @@ -740,7 +740,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testOpenDocumentAsReadOnly) CPPUNIT_ASSERT(pXImpressDocument); sd::DrawDocShell* pDocShell = pXImpressDocument->GetDocShell(); CPPUNIT_ASSERT(pDocShell->IsSecurityOptOpenReadOnly()); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); pDocShell = pXImpressDocument->GetDocShell(); @@ -750,7 +750,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testOpenDocumentAsReadOnly) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118835) { createSdImpressDoc("odp/tdf118835.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "(//p:animClr)[1]", "clrSpc", u"rgb"); @@ -775,7 +775,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118835) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118768) { createSdImpressDoc("odp/tdf118768-brake.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "//p:anim[1]", "from", u"(-#ppt_w/2)"); @@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118768) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf118836) { createSdImpressDoc("odp/tdf118836.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "//p:animScale/p:by", "x", u"250000"); @@ -881,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf116350TextEffects) CPPUNIT_ASSERT_EQUAL(true, bScaleX); // Export - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "//p:sp[1]/p:txBody/a:bodyPr/a:prstTxWarp", "prst", u"textArchUp"); @@ -892,7 +892,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf116350TextEffects) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf128096) { createSdImpressDoc("odp/tdf128096.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent1 = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPathInsensitive( @@ -910,7 +910,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf128096) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf120573) { createSdImpressDoc("pptx/tdf120573.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/a:audioFile", 1); @@ -932,7 +932,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf148478_transitionMusic) // This original file does not open cleanly in MS PowerPoint // because the file name has a Unicode character: ../media/Cortázar.wav. createSdImpressDoc("pptx/tdf148478_transitionMusic.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // an MD5-based ascii replacement was substituted for the unicode name. This now opens in MS PP. uno::Reference xNameAccess @@ -958,7 +958,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf148478_transitionMusic) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf119118) { createSdImpressDoc("pptx/tdf119118.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, "//p:iterate", "type", u"lt"); assertXPath(pXmlDocContent, "//p:tmAbs", "val", u"200"); @@ -967,7 +967,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf119118) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf99213) { createSdImpressDoc("odp/tdf99213-target-missing.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); // Number of nodes with p:attrNameLst was 3, including one that missed tgtEl assertXPath(pXmlDocContent, "//p:attrNameLst", 2); @@ -981,7 +981,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testPotxExport) createSdImpressDoc(); // Export as a POTM template - save(u"Impress Office Open XML Template"_ustr); + save(TestFilter::POTX); // Load and check content type xmlDocUniquePtr pContentTypes = parseExport(u"[Content_Types].xml"_ustr); @@ -995,7 +995,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testPotxExport) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf44223) { createSdImpressDoc("pptx/tdf44223.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); std::unique_ptr const pStream1( parseExportStream(maTempFile.GetURL(), u"ppt/media/audio1.wav"_ustr)); @@ -1037,7 +1037,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf44223) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf135843) { createSdImpressDoc("pptx/tdf135843_export.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); static constexpr OString sPathStart( @@ -1061,7 +1061,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf135843) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testNegativeTimeAnimateValue) { createSdImpressDoc("ppt/novell6655408.ppt"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index 25b42f4c206f..c06ce24a863e 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -45,7 +45,7 @@ public: CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf160591) { createSdImpressDoc("pptx/tdf160591.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Char scheme color xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -67,7 +67,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf160591) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testSmartArtPreserve) { createSdImpressDoc("pptx/smartart-preserve.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:cNvPr"); @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testSmartArtPreserve) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf168755_anim_on_SmartArt) { createSdImpressDoc("pptx/tdf168755_anim_on_SmartArt.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -151,7 +151,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125346) // There are two themes in the test document, make sure we use the right theme createSdImpressDoc("pptx/tdf125346.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference xPropSet(xShape, uno::UNO_SET_THROW); @@ -171,7 +171,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125346_2) // Test more slides with different themes createSdImpressDoc("pptx/tdf125346_2.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); { uno::Reference xShape(getShapeFromPage(0, 0)); @@ -224,7 +224,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360) xShape->setPropertyValue(u"FillTransparence"_ustr, uno::Any(static_cast(23))); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xShape.set(getShapeFromPage(0, 0)); @@ -244,7 +244,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360_1) xShape->setPropertyValue(u"FillTransparence"_ustr, uno::Any(static_cast(23))); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xShape.set(getShapeFromPage(0, 0)); @@ -268,7 +268,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360_2) xShape->setPropertyValue(u"FillTransparence"_ustr, uno::Any(static_cast(23))); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xShape.set(getShapeFromPage(0, 0)); @@ -280,7 +280,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360_2) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125551) { createSdImpressDoc("pptx/tdf125551.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xGroupShape(getShapeFromPage(0, 0), uno::UNO_QUERY); uno::Reference xShapeBg(xGroupShape->getByIndex(0), uno::UNO_QUERY); @@ -294,7 +294,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125551) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf136830) { createSdImpressDoc("pptx/tdf136830.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Without the fix in place, the X position of the shapes would have been 0 uno::Reference xGroupShape(getShapeFromPage(0, 0), uno::UNO_QUERY); @@ -315,7 +315,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf136830) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf126234) { createSdImpressDoc("pptx/tdf126234.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // check relative size of the bullet, 400% is a legitimate value for MS Office document // Without a fix, it will fail to set the size correctly @@ -331,7 +331,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf126234) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf126741) { createSdImpressDoc("pptx/tdf126741.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // dash dot dot line style import fix // The original fixed values are replaced with the percent values, because @@ -354,7 +354,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf126741) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127372) { createSdImpressDoc("odp/tdf127372.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); awt::Gradient2 aTransparenceGradient; xShape->getPropertyValue(u"FillTransparenceGradient"_ustr) >>= aTransparenceGradient; @@ -373,7 +373,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127372) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127379) { createSdImpressDoc("odp/tdf127379.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDoc->getDrawPages()->getCount()); @@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127379) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf98603) { createSdImpressDoc("pptx/tdf98603.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); uno::Reference xRun(getRunFromParagraph(0, xParagraph)); @@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf98603) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf128213) { createSdImpressDoc("pptx/tdf128213.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm", "rot"); @@ -429,7 +429,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf128213) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf79082) { createSdImpressDoc("pptx/tdf79082.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocContent, @@ -473,7 +473,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf129372) //Without the fix in place, it would crash at import time createSdImpressDoc("pptx/tdf129372.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); const SdrObject* pObj = pPage->GetObj(0); @@ -484,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf129372) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeGlowEffect) { createSdImpressDoc("pptx/shape-glow-effect.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); sal_Int32 nRadius = -1; xShape->getPropertyValue(u"GlowEffectRadius"_ustr) >>= nRadius; @@ -500,7 +500,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeGlowEffect) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeTextGlowEffect) { createSdImpressDoc("pptx/shape-text-glow-effect.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); sal_Int32 nRadius = -1; xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nRadius; @@ -533,7 +533,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testUnderline) xPropSet->getPropertyValue(u"CharUnderline"_ustr) >>= nUnderline; CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::DOUBLE, nUnderline); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); xShape.set(getShapeFromPage(0, 0)); xParagraph.set(getParagraphFromShape(0, xShape)); @@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testUnderline) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf119087) { createSdImpressDoc("pptx/tdf119087.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // This would fail both on export validation, and reloading the saved pptx file. // Get first paragraph of the text @@ -571,7 +571,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf119087) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf131554) { createSdImpressDoc("pptx/tdf131554.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(1, 0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast(5622), xShape->getPosition().X); CPPUNIT_ASSERT_EQUAL(static_cast(13251), xShape->getPosition().Y); @@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf131554) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf132282) { createSdImpressDoc("pptx/tdf132282.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0), uno::UNO_QUERY); // Without the fix in place, the position would be 0,0, height = 1 and width = 1 CPPUNIT_ASSERT_EQUAL(static_cast(1736), xShape->getPosition().X); @@ -592,7 +592,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf132282) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf132201EffectOrder) { createSdImpressDoc("pptx/effectOrder.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPathChildren(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst", 2); // The relative order of effects is important: glow must be before shadow @@ -607,7 +607,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf132201EffectOrder) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeSoftEdgeEffect) { createSdImpressDoc("pptx/shape-soft-edges.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); auto xShapeProps(getShapeFromPage(0, 0)); sal_Int32 nRadius = -1; xShapeProps->getPropertyValue(u"SoftEdgeRadius"_ustr) >>= nRadius; @@ -621,7 +621,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeSoftEdgeEffect) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeShadowBlurEffect) { createSdImpressDoc("pptx/shape-blur-effect.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); bool bHasShadow = false; xShape->getPropertyValue(u"Shadow"_ustr) >>= bHasShadow; @@ -634,7 +634,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeShadowBlurEffect) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf119223) { createSdImpressDoc("odp/tdf119223.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDocRels, "//p:cNvPr[@name='SomeCustomShape']"); @@ -655,7 +655,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf119223) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf128213ShapeRot) { createSdImpressDoc("pptx/tdf128213-shaperot.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -670,7 +670,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125560_textDeflate) createSdImpressDoc("pptx/ShapePlusImage.pptx"); // This problem did not affect the pptx export, only the ODP so assert that - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDocRels = parseExport(u"content.xml"_ustr); assertXPath(pXmlDocRels, @@ -684,7 +684,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125560_textInflateTop) createSdImpressDoc("pptx/ShapeTextInflateTop.pptx"); // This problem did not affect the pptx export, only the ODP so assert that - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDocRels = parseExport(u"content.xml"_ustr); assertXPath(pXmlDocRels, @@ -697,7 +697,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf142235_TestPlaceholderTextAlignm { createSdImpressDoc("odp/placeholder-box-textalignment.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXml1 = parseExport(u"ppt/slides/slide2.xml"_ustr); xmlDocUniquePtr pXml2 = parseExport(u"ppt/slides/slide3.xml"_ustr); @@ -727,7 +727,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf96061_textHighlight) xPropSet2->getPropertyValue(u"CharBackColor"_ustr) >>= aColor; CPPUNIT_ASSERT_EQUAL(COL_AUTO, aColor); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape2(getShapeFromPage(0, 0)); uno::Reference const xParagraph3(getParagraphFromShape(0, xShape2)); @@ -759,7 +759,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf143222_embeddedWorksheet) CPPUNIT_ASSERT_MESSAGE("no graphic", !pGraphic->IsNone()); // Check export of embedded worksheet in slide. - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); pPage = GetPage(1); pOleObj = static_cast(pPage->GetObj(0)); @@ -774,7 +774,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf143315) { createSdImpressDoc("ppt/tdf143315-WordartWithoutBullet.ppt"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXml = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -805,7 +805,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf147121) // Save the font size const auto nFontSizeBefore = xRun->getPropertyValue(u"CharHeight"_ustr).get() * 100; - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Parse the export xmlDocUniquePtr pXml = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf140912_PicturePlaceholder) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testEnhancedPathViewBox) { createSdImpressDoc("odp/tdf147978_enhancedPath_viewBox.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); auto xShapeProps(getShapeFromPage(0, 0)); awt::Rectangle aBoundRectangle; xShapeProps->getPropertyValue(u"BoundRect"_ustr) >>= aBoundRectangle; @@ -847,7 +847,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testEnhancedPathViewBox) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf74670) { createSdImpressDoc("odp/tdf74670.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf109169_OctagonBevel) // rectangle and thus had 4 points. createSdImpressDoc("odp/tdf109169_Octagon.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); auto xPropSet(getShapeFromPage(0, 0)); auto aGeomPropSeq = xPropSet->getPropertyValue(u"CustomShapeGeometry"_ustr) @@ -892,7 +892,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf109169_DiamondBevel) // rectangle and thus had 4 points. createSdImpressDoc("odp/tdf109169_Diamond.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); auto xPropSet(getShapeFromPage(0, 0)); auto aGeomPropSeq = xPropSet->getPropertyValue(u"CustomShapeGeometry"_ustr) @@ -911,7 +911,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf144092_emptyShapeTextProps) // text properties contained inside endParaRPr - The import and export // of endParaRPr for empty cells and shapes are tested here createSdImpressDoc("pptx/tdf144092-emptyShapeTextProps.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); Color aColor; // check text properties of empty shape @@ -954,7 +954,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf149551_tbrl90) CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode); // Test, that it is exported to vert="vert" - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "//a:bodyPr", "vert", u"vert"); @@ -965,7 +965,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf149551_tbrl90) CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode2); // Test, that it is written to odp with loext:writing-mode="tb-rl90" - save(u"impress8"_ustr); + save(TestFilter::ODP); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath( pXmlDoc, @@ -986,7 +986,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf149551_btlr) CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, eWritingMode); // Test, that it is exported to vert="vert270" - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPath(pXmlDoc, "//a:bodyPr", "vert", u"vert270"); @@ -997,7 +997,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf149551_btlr) CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, eWritingMode2); // Test, that it is written to odp with loext:writing-mode="bt-lr" - save(u"impress8"_ustr); + save(TestFilter::ODP); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath( pXmlDoc, @@ -1015,7 +1015,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf94122_autoColor) createSdImpressDoc("odp/tdf94122_autocolor.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Without the accompanying fix in place, these tests would have failed with: // - Expected: 1 @@ -1053,7 +1053,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf124333) CPPUNIT_ASSERT_EQUAL_MESSAGE("number of shapes is incorrect", sal_Int32(2), getPage(0)->getCount()); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // Check number of shapes after export. CPPUNIT_ASSERT_EQUAL_MESSAGE("number of shapes is incorrect after export", sal_Int32(2), @@ -1064,7 +1064,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testAutofittedTextboxIndent) { createSdImpressDoc("odp/autofitted-textbox-indent.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); // Check that the indent hasn't changed and wasn't scaled when exporting // (the behaviour changed). @@ -1078,7 +1078,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf151622_oleIcon) { createSdImpressDoc("odp/ole_icon.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXml = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1092,7 +1092,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf151622_oleIcon) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf152436) { createSdImpressDoc("pptx/ole-emf_min.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // Check number of shapes after export. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getPage(0)->getCount()); @@ -1102,7 +1102,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testLinkedOLE) { createSdImpressDoc("odp/linked_ole.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXml = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1117,7 +1117,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testLinkedOLE) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf102261_testParaTabStopDefaultDistance) { createSdImpressDoc("pptx/tdf102261_testParaTabStopDefaultDistance.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); { @@ -1147,7 +1147,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testNotesAuthorDate) pBatch); pBatch->commit(); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); xmlDocUniquePtr pXml = parseExport(u"ppt/commentAuthors.xml"_ustr); assertXPath(pXml, "/p:cmAuthorLst/p:cmAuthor[@id=0]", "name", u"Hans Wurst"); @@ -1160,7 +1160,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testNotesAuthorDate) officecfg::Office::Common::Security::Scripting::KeepNoteAuthorDateInfoOnSaving::set(false, pBatch); pBatch->commit(); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); pXml = parseExport(u"ppt/commentAuthors.xml"_ustr); assertXPath(pXml, "/p:cmAuthorLst/p:cmAuthor[@id=0]", "name", u"Author1"); @@ -1173,7 +1173,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testNotesAuthorDate) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTableCellVerticalPropertyRoundtrip) { createSdImpressDoc("pptx/tcPr-vert-roundtrip.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); xmlDocUniquePtr pXml = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1185,7 +1185,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTableCellVerticalPropertyRoundtrip) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf157740_slideMasters) { createSdImpressDoc("pptx/tdf157740.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // The original file has 1 slide master and 7 slide layouts in that master xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/presentation.xml"_ustr); @@ -1198,7 +1198,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf157740_slideMasters) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf159931_slideLayouts) { createSdImpressDoc("odp/repeatBitmapMode.odp"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels1 = parseExport(u"ppt/slides/_rels/slide1.xml.rels"_ustr); xmlDocUniquePtr pXmlDocRels2 = parseExport(u"ppt/slides/_rels/slide2.xml.rels"_ustr); @@ -1261,7 +1261,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf163483_export_math_fallback) css::lang::IndexOutOfBoundsException); // Only one shape on page } - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // After save-and-reload, there must still be a single shape; now it's a fallback image. // When we start to import formulas from PPTX, that will be formula. @@ -1301,7 +1301,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf163483_export_math_fallback) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testPlaceHolderFitHeightToText) { createSdImpressDoc("pptx/tdf160487.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(1, 0)); bool bTextAutoGrowHeight = false; xShape->getPropertyValue(u"TextAutoGrowHeight"_ustr) >>= bTextAutoGrowHeight; @@ -1311,7 +1311,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testPlaceHolderFitHeightToText) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testDeduplicateMasters) { createSdImpressDoc("pptx/onemaster-twolayouts.pptx"); - saveAndReload("Impress Office Open XML"); + saveAndReload(TestFilter::PPTX); // Check that the document still has one master and two layouts xmlDocUniquePtr pXmlDocContent = parseExport("ppt/presentation.xml"); @@ -1348,7 +1348,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testDeduplicateMasters) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testConvertWithMasterDeduplication) { createSdImpressDoc("odp/dupmastermultlayouts.odp"); - save("Impress Office Open XML"); + saveAndReload(TestFilter::PPTX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), @@ -1383,7 +1383,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testConvertWithMasterDeduplication) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf162571HorzAnchor) { createSdImpressDoc("pptx/tdf165261.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(1, 0), uno::UNO_QUERY); uno::Reference xProp(xShape, uno::UNO_QUERY); @@ -1396,7 +1396,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf162571HorzAnchor) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf165261HorzAnchor) { createSdImpressDoc("pptx/tdf165261.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xGroupShape(getShapeFromPage(0, 0), uno::UNO_QUERY); uno::Reference xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY); @@ -1410,7 +1410,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf165261HorzAnchor) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testCustomPromptTexts) { createSdImpressDoc("pptx/tdf163239.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage1 = GetPage(1); { @@ -1474,7 +1474,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testCustomPromptTexts) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testPresObjTextStyles) { createSdImpressDoc("pptx/tdf163239_v2.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); @@ -1539,7 +1539,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testPresObjTextStyles) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTextStylesXML) { createSdImpressDoc("pptx/tdf163239_v2.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slideLayouts/slideLayout1.xml"_ustr); @@ -1553,7 +1553,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTextStylesXML) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTextAlignLeft) { createSdImpressDoc("pptx/presLeftAlign.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDocRels = parseExport(u"ppt/slides/slide1.xml"_ustr); @@ -1563,7 +1563,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTextAlignLeft) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testOLEObjectAnimationTarget) { createSdImpressDoc("pptx/tdf169088.pptx"); - save(u"Impress Office Open XML"_ustr); + save(TestFilter::PPTX); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index b7733381fc05..cd2456e6a369 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testBackgroundImage) // Save as PPTX, reload and check again so we make sure exporting to PPTX is working correctly { - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", static_cast(1), xDoc->getDrawPages()->getCount()); @@ -163,7 +163,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testBackgroundImage) // Save as ODP, reload and check again so we make sure exporting and importing to ODP is working correctly { - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL_MESSAGE("not exactly one page", static_cast(1), xDoc->getDrawPages()->getCount()); @@ -211,7 +211,7 @@ void checkFontAttributes(const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId) CPPUNIT_TEST_FIXTURE(SdExportTest, testTransparentBackground) { createSdImpressDoc("odp/transparent_background.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); const SdrPage* pPage = GetPage(1); @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTransparentBackground) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf162283) { createSdImpressDoc("pptx/tdf162283.pptx"); - saveAndReload(u"MS PowerPoint 97"_ustr); + saveAndReload(TestFilter::PPT); uno::Reference xPage(getPage(0)); uno::Reference xPropSet(getShape(0, xPage)); @@ -343,17 +343,17 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testDecorative) doTest("initial pptx load: "_ostr); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); doTest("reload OOXML: "_ostr); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); doTest("reload ODF: "_ostr); } CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf142716) { createSdImpressDoc("pptx/tdf142716.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); const SdrTextObj* pObj = DynCastSdrTextObj(pPage->GetObj(0)); @@ -381,7 +381,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testMediaEmbedding) CPPUNIT_TEST_FIXTURE(SdExportTest, testFillBitmapUnused) { createSdImpressDoc("odp/fillbitmap2.odp"); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // shapes @@ -458,7 +458,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testFillBitmapUnused) CPPUNIT_TEST_FIXTURE(SdExportTest, testFdo84043) { createSdImpressDoc("fdo84043.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); // the bug was duplicate attributes, causing crash in a build with asserts const SdrPage* pPage = GetPage(1); @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf97630) CPPUNIT_ASSERT_EQUAL(drawing::TextFitToSizeType_ALLLINES, tmp); } - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); { uno::Reference xDP(getPage(0)); @@ -557,7 +557,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf97630) CPPUNIT_TEST_FIXTURE(SdExportTest, testImpressPasswordExport) { - std::vector vFormat{ u"impress8"_ustr, u"Impress Office Open XML"_ustr }; + std::vector vFormat{ TestFilter::ODP, TestFilter::PPTX }; for (size_t i = 0; i < vFormat.size(); i++) { @@ -571,21 +571,21 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testDrawPasswordExport) { createSdDrawDoc(); - saveAndReload(u"draw8"_ustr, /*pPassword*/ "test"); + saveAndReload(TestFilter::ODG, /*pPassword*/ "test"); } CPPUNIT_TEST_FIXTURE(SdExportTest, testSwappedOutImageExport) { // Problem was with the swapped out images, which were not swapped in during export. - std::vector vFormat{ u"impress8"_ustr, u"Impress Office Open XML"_ustr, - u"MS PowerPoint 97"_ustr }; + std::vector vFormat{ TestFilter::ODP, TestFilter::PPTX, TestFilter::PPT }; for (size_t i = 0; i < vFormat.size(); i++) { // Load the original file with one image createSdImpressDoc("odp/document_with_two_images.odp"); - const OString sFailedMessage = "Failed on filter: " + vFormat[i].toUtf8(); + const OString sFailedMessage + = "Failed on filter: " + TestFilterNames.at(vFormat[i]).toUtf8(); // Export the document and import again for a check saveAndReload(vFormat[i]); @@ -645,7 +645,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testOOoXMLAnimations) // FIXME: Error: unexpected attribute "presentation:preset-property" skipValidation(); - save(u"impress8"_ustr); + save(TestFilter::ODP); // the problem was that legacy OOoXML animations were lost if store // immediately follows load because they were "converted" async by a timer @@ -715,7 +715,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testUnknownAttributes) // FIXME: Error: unexpected attribute "foo:non-existent-att" skipValidation(); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/" @@ -740,7 +740,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf80020) uno::Reference xStyle(xStyleFamily->getByName(u"Test Style"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"text"_ustr, xStyle->getParentStyle()); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); } uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); @@ -773,7 +773,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf128985) xPropSet->setPropertyValue(u"WritingMode"_ustr, uno::Any(text::WritingMode2::LR_TB)); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); } uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); @@ -796,7 +796,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf128985) CPPUNIT_TEST_FIXTURE(SdExportTest, testLinkedGraphicRT) { // FIXME: PPTX fails - std::vector vFormat{ u"impress8"_ustr, u"MS PowerPoint 97"_ustr }; + std::vector vFormat{ TestFilter::ODP, TestFilter::PPT }; for (size_t i = 0; i < vFormat.size(); i++) { // Load the original file with one image @@ -829,7 +829,8 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testLinkedGraphicRT) // Check whether graphic imported well after export { - const OString sFailedMessage = "Failed on filter: " + vFormat[i].toUtf8(); + const OString sFailedMessage + = "Failed on filter: " + TestFilterNames.at(vFormat[i]).toUtf8(); SdXImpressDocument* pXImpressDocument = dynamic_cast(mxComponent.get()); @@ -854,7 +855,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testLinkedGraphicRT) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf79082) { createSdImpressDoc("ppt/tdf79082.ppt"); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // P1 should have 6 tab stops defined @@ -891,13 +892,13 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testImageWithSpecialID) // Check how LO handles when the imported graphic's ID is different from that one // which is generated by LO. - std::vector vFormat{ u"impress8"_ustr, u"Impress Office Open XML"_ustr, - u"MS PowerPoint 97"_ustr }; + std::vector vFormat{ TestFilter::ODP, TestFilter::PPTX, TestFilter::PPT }; for (size_t i = 0; i < vFormat.size(); i++) { // Load the original file createSdImpressDoc("odp/images_with_special_IDs.odp"); - const OString sFailedMessage = "Failed on filter: " + vFormat[i].toUtf8(); + const OString sFailedMessage + = "Failed on filter: " + TestFilterNames.at(vFormat[i]).toUtf8(); saveAndReload(vFormat[i]); // Check whether graphic was exported well @@ -971,7 +972,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf62176) CPPUNIT_ASSERT_EQUAL(u"Hello World"_ustr, xParagraph->getString()); //Saving and Reloading the file - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xPage2(getPage(0)); //there should be only *one* shape CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage2->getCount()); @@ -1000,7 +1001,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testEmbeddedPdf) } createSdImpressDoc("odp/embedded-pdf.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xPage = getPage(0); uno::Reference xShape(xPage->getByIndex(0), uno::UNO_QUERY); uno::Reference xGraphic; @@ -1019,7 +1020,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdf) setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); setImportFilterName(u"OpenDocument Drawing Flat XML"_ustr); - saveAndReload(u"OpenDocument Drawing Flat XML"_ustr); + saveAndReload(TestFilter::FODG); const SdrPage* pPage = GetPage(1); @@ -1042,7 +1043,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfTextPos) setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); setImportFilterName(u"OpenDocument Drawing Flat XML"_ustr); - saveAndReload(u"OpenDocument Drawing Flat XML"_ustr); + saveAndReload(TestFilter::FODG); xmlDocUniquePtr pXml = parseLayout(); sal_Int32 x = getXPath(pXml, "//textarray[1]", "x").toInt32(); @@ -1073,7 +1074,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfFont) setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); setImportFilterName(u"OpenDocument Drawing Flat XML"_ustr); - saveAndReload(u"OpenDocument Drawing Flat XML"_ustr); + saveAndReload(TestFilter::FODG); xmlDocUniquePtr pXml = parseLayout(); { @@ -1111,7 +1112,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfHindi) loadFromFile(u"pdf/BasicHindi.pdf"); setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); - save(u"OpenDocument Drawing Flat XML"_ustr); + save(TestFilter::FODG); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -1139,7 +1140,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfGrayscaleImageUnderInvisibleTe setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); setImportFilterName(u"OpenDocument Drawing Flat XML"_ustr); - saveAndReload(u"OpenDocument Drawing Flat XML"_ustr); + saveAndReload(TestFilter::FODG); uno::Reference xGroupShape(getShapeFromPage(0, 0), uno::UNO_QUERY); CPPUNIT_ASSERT(xGroupShape.is()); @@ -1186,7 +1187,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfClippedImages) setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); setImportFilterName(u"OpenDocument Drawing Flat XML"_ustr); - saveAndReload(u"OpenDocument Drawing Flat XML"_ustr); + saveAndReload(TestFilter::FODG); uno::Reference xGroupShape(getShapeFromPage(0, 0), uno::UNO_QUERY); CPPUNIT_ASSERT(xGroupShape.is()); @@ -1216,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfMissingFontVersion) setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); setImportFilterName(u"OpenDocument Drawing Flat XML"_ustr); - saveAndReload(u"OpenDocument Drawing Flat XML"_ustr); + saveAndReload(TestFilter::FODG); const SdrPage* pPage = GetPage(1); @@ -1240,7 +1241,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfEmbeddedFonts) loadFromFile(u"pdf/sciencejournalsource.pdf"); setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); - save(u"OpenDocument Drawing Flat XML"_ustr); + save(TestFilter::FODG); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -1261,7 +1262,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfPatternStroke) loadFromFile(u"pdf/pattern-stroke.pdf"); setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); - save(u"OpenDocument Drawing Flat XML"_ustr); + save(TestFilter::FODG); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -1281,7 +1282,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfPatternFill) loadFromFile(u"pdf/pattern-fill.pdf"); setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); - save(u"OpenDocument Drawing Flat XML"_ustr); + save(TestFilter::FODG); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -1303,7 +1304,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testPdfPageMasterOrientation) loadFromFile(u"pdf/SampleSlideDeck.pdf"); setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); - save(u"OpenDocument Drawing Flat XML"_ustr); + save(TestFilter::FODG); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -1325,7 +1326,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfTextShear) loadFromFile(u"pdf/textshear.pdf"); setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}"); - save(u"OpenDocument Drawing Flat XML"_ustr); + save(TestFilter::FODG); xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -1339,7 +1340,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfTextShear) CPPUNIT_TEST_FIXTURE(SdExportTest, testEmbeddedText) { createSdDrawDoc("objectwithtext.fodg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xPage = getPage(0); uno::Reference xShape(xPage->getByIndex(0), uno::UNO_QUERY); @@ -1367,7 +1368,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testEmbeddedText) CPPUNIT_TEST_FIXTURE(SdExportTest, testTransparenText) { createSdDrawDoc("transparent-text.fodg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xPage = getPage(0); uno::Reference xShape(xPage->getByIndex(0), uno::UNO_QUERY); @@ -1384,7 +1385,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTransparenText) CPPUNIT_TEST_FIXTURE(SdExportTest, testDefaultSubscripts) { createSdDrawDoc("tdf80194_defaultSubscripts.fodg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xPage = getPage(0); uno::Reference xShape(xPage->getByIndex(1), uno::UNO_QUERY); @@ -1396,7 +1397,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testDefaultSubscripts) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf98477) { createSdImpressDoc("pptx/tdf98477grow.pptx"); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//anim:animateTransform", "by", u"0.5,0.5"); @@ -1406,7 +1407,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testAuthorField) { createSdImpressDoc("odp/author_fixed.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xField = getTextFieldFromPage(0, 0, 0, 0); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is()); @@ -1421,7 +1422,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf50499) { createSdImpressDoc("pptx/tdf50499.pptx"); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//anim:animate[1]", "from", u"(-width/2)"); @@ -1433,7 +1434,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf100926) { createSdImpressDoc("pptx/tdf100926_ODP.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); const SdrPage* pPage = GetPage(1); CPPUNIT_ASSERT(pPage != nullptr); @@ -1461,7 +1462,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testPageWithTransparentBackground) { createSdImpressDoc("odp/page_transparent_background.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one page", static_cast(1), xDoc->getDrawPages()->getCount()); @@ -1493,7 +1494,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTextRotation) // attribute value "tb-rl90" is included in ODF strict. { createSdImpressDoc("pptx/shape-text-rotate.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xPage(getPage(0)); uno::Reference xPropSet(getShape(0, xPage)); @@ -1507,7 +1508,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTextRotation) SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); createSdImpressDoc("pptx/shape-text-rotate.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xPage(getPage(0)); uno::Reference xPropSet(getShape(0, xPage)); @@ -1530,7 +1531,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf115394PPT) createSdImpressDoc("ppt/tdf115394.ppt"); // Export the document and import again for a check - saveAndReload(u"MS PowerPoint 97"_ustr); + saveAndReload(TestFilter::PPT); double fTransitionDuration; @@ -1556,7 +1557,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf115394PPT) CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageImpress8) { createSdImpressDoc("odp/BulletsAsImage.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); @@ -1606,7 +1607,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageImpress8) CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageImpressOfficeOpenXml) { createSdImpressDoc("odp/BulletsAsImage.odp"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); @@ -1658,7 +1659,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageImpressOfficeOpenXml) CPPUNIT_TEST_FIXTURE(SdExportTest, testBulletsAsImageMsPowerpoint97) { createSdImpressDoc("odp/BulletsAsImage.odp"); - saveAndReload(u"MS PowerPoint 97"_ustr); + saveAndReload(TestFilter::PPT); uno::Reference xShape(getShapeFromPage(0, 0)); uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); @@ -1711,9 +1712,9 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf113822) createSdImpressDoc("pptx/tdf113822underline.pptx"); // Was unable to export iterate container (tdf#99213). - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); // Was unable to import iterate container (tdf#113822). - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1729,9 +1730,9 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf113822) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf113818) { createSdImpressDoc("pptx/tdf113818-swivel.pptx"); - saveAndReload(u"MS PowerPoint 97"_ustr); - saveAndReload(u"Impress Office Open XML"_ustr); - save(u"impress8"_ustr); + saveAndReload(TestFilter::PPT); + saveAndReload(TestFilter::PPTX); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//anim:animate[1]", "formula", u"width*sin(2.5*pi*$)"); @@ -1741,8 +1742,8 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf113818) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf119629) { createSdImpressDoc("ppt/tdf119629.ppt"); - saveAndReload(u"MS PowerPoint 97"_ustr); - save(u"impress8"_ustr); + saveAndReload(TestFilter::PPT); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1762,7 +1763,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf119629) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf141269) { createSdImpressDoc("odp/tdf141269.odp"); - saveAndReload(u"MS PowerPoint 97"_ustr); + saveAndReload(TestFilter::PPT); uno::Reference xShape(getShapeFromPage(0, 0), uno::UNO_SET_THROW); CPPUNIT_ASSERT(xShape.is()); @@ -1785,8 +1786,8 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf141269) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf123557) { createSdImpressDoc("pptx/trigger.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); - save(u"impress8"_ustr); + saveAndReload(TestFilter::PPTX); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // Contains 2 interactive sequences and 3 triggered effects. @@ -1808,7 +1809,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf123557) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf126761) { createSdImpressDoc("ppt/tdf126761.ppt"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xShape(getShapeFromPage(0, 0)); // Get first paragraph of the text @@ -1827,7 +1828,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf126761) CPPUNIT_TEST_FIXTURE(SdExportTest, testGlow) { createSdDrawDoc("odg/glow.odg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xShape(getShapeFromPage(0, 0)); // Check glow properties @@ -1866,7 +1867,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testGlow) CPPUNIT_TEST_FIXTURE(SdExportTest, testGlowTextInShape) { createSdImpressDoc("odp/shape-text-glow-effect.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); uno::Reference xDP(getPage(0)); uno::Reference xShape(xDP->getByIndex(0), uno::UNO_QUERY); @@ -1907,7 +1908,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testGlowTextInShape) CPPUNIT_TEST_FIXTURE(SdExportTest, testSoftEdges) { createSdDrawDoc("odg/softedges.odg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); auto xShapeProps(getShapeFromPage(0, 0)); // Check property @@ -1945,7 +1946,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testSoftEdges) CPPUNIT_TEST_FIXTURE(SdExportTest, testShadowBlur) { createSdImpressDoc("odp/shadow-blur.odp"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xShape(getShapeFromPage(0, 0)); sal_Int32 nRad = 0; @@ -1966,14 +1967,14 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testRhbz1870501) { //Without the fix in place, it would crash at export time createSdDrawDoc("odg/rhbz1870501.odg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); } CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf152606) { //Without the fix in place, it would crash at import time createSdImpressDoc("pptx/tdf152606.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), @@ -1986,20 +1987,20 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf154754) //Without the fix in place, it would crash at export time skipValidation(); createSdImpressDoc("odp/tdf154754.odp"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); } CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf91060) { //Without the fix in place, it would crash at import time createSdImpressDoc("pptx/tdf91060.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); } CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf128550) { createSdImpressDoc("pptx/tdf128550.pptx"); - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//anim:iterate[@anim:sub-item='background']", 1); assertXPath(pXmlDoc, "//anim:iterate[@anim:sub-item='text']", 4); @@ -2010,7 +2011,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf140714) //Without the fix in place, shape will be imported as GraphicObjectShape instead of CustomShape. createSdImpressDoc("pptx/tdf140714.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xShape(getShapeFromPage(0, 0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, xShape->getShapeType()); @@ -2019,7 +2020,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf140714) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf156649) { createSdImpressDoc("pptx/tdf156649.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); auto xShapeProps(getShapeFromPage(0, 0)); // Without the fix in place, this test would have failed with @@ -2131,7 +2132,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testMasterPageBackgroundFullSize) xBackgroundProps->getPropertyValue(u"FillTransparence"_ustr).get()); } - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); xMPS.set(mxComponent, uno::UNO_QUERY); xMPs.set(xMPS->getMasterPages()); @@ -2283,7 +2284,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testColumnsODG) CPPUNIT_ASSERT_EQUAL(sal_Int32(700), pTextObj->GetTextColumnsSpacing()); } - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); { uno::Reference xDrawPagesSupplier(mxComponent, @@ -2321,7 +2322,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testColumnsODG) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf112126) { createSdDrawDoc("tdf112126.odg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xPage(getPage(0)); uno::Reference xPropertySet(xPage, uno::UNO_QUERY); @@ -2342,7 +2343,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testCellProperties) skipValidation(); createSdDrawDoc("odg/tablestyles.fodg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); const SdrPage* pPage = GetPage(1); auto pTableObj = dynamic_cast(pPage->GetObj(0)); @@ -2374,7 +2375,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testUserTableStyles) skipValidation(); createSdDrawDoc("odg/tablestyles.fodg"); - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); @@ -2399,7 +2400,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testUserTableStyles) CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf153179) { createSdImpressDoc("pptx/ole-emf_min.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); // Check number of shapes after export. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getPage(0)->getCount()); @@ -2407,14 +2408,14 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf153179) CPPUNIT_TEST_FIXTURE(SdExportTest, testSvgImageSupport) { - for (OUString const& rFormat : { u"impress8"_ustr, u"Impress Office Open XML"_ustr }) + for (TestFilter eFormat : { TestFilter::ODP, TestFilter::PPTX }) { // Load the original file createSdImpressDoc("odp/SvgImageTest.odp"); // Save into the target format - saveAndReload(rFormat); + saveAndReload(eFormat); - const OString sFailedMessage = "Failed on filter: " + rFormat.toUtf8(); + const OString sFailedMessage = "Failed on filter: " + TestFilterNames.at(eFormat).toUtf8(); // Check whether SVG graphic was exported as expected uno::Reference xDrawPagesSupplier(mxComponent, @@ -2450,7 +2451,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testSvgImageSupport) CPPUNIT_TEST_FIXTURE(SdExportTest, testTableBordersTransparancy) { createSdImpressDoc("pptx/tdf164936.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); const SdrPage* pPage = GetPage(1); sdr::table::SdrTableObj* pTableObj = dynamic_cast(pPage->GetObj(0)); diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index ae0c790e259f..102eda38675e 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1458,7 +1458,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testFillColorList) CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf134221) { createSdImpressDoc("pptx/smartart-tdf134221.pptx"); - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xGroup(getShapeFromPage(0, 0), uno::UNO_QUERY); uno::Reference xShapeB = findChildShapeByText(xGroup, u"B"_ustr); CPPUNIT_ASSERT(xShapeB.is()); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 197af29e0e16..156bf66f643d 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -125,36 +125,36 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testDocumentLayout) static const struct { std::u16string_view sInput, sDump; - OUString sExportType; + TestFilter sExportType; } aFilesToCompare[] - = { { u"odp/shapes-test.odp", u"xml/shapes-test_page", u""_ustr }, - { u"fdo47434.pptx", u"xml/fdo47434_", u""_ustr }, - { u"n758621.ppt", u"xml/n758621_", u""_ustr }, - { u"fdo64586.ppt", u"xml/fdo64586_", u""_ustr }, + = { { u"odp/shapes-test.odp", u"xml/shapes-test_page", TestFilter::NONE }, + { u"fdo47434.pptx", u"xml/fdo47434_", TestFilter::NONE }, + { u"n758621.ppt", u"xml/n758621_", TestFilter::NONE }, + { u"fdo64586.ppt", u"xml/fdo64586_", TestFilter::NONE }, // needed to adapt this, the border parameter is no longer // exported with MCGRs due to oox neither needing nor // supporting it with now freely definable gradients - { u"n819614.pptx", u"xml/n819614_", u""_ustr }, + { u"n819614.pptx", u"xml/n819614_", TestFilter::NONE }, - { u"n820786.pptx", u"xml/n820786_", u""_ustr }, - { u"n762695.pptx", u"xml/n762695_", u""_ustr }, - { u"n593612.pptx", u"xml/n593612_", u""_ustr }, - { u"fdo71434.pptx", u"xml/fdo71434_", u""_ustr }, - { u"n902652.pptx", u"xml/n902652_", u""_ustr }, - { u"tdf90403.pptx", u"xml/tdf90403_", u""_ustr }, - { u"tdf90338.odp", u"xml/tdf90338_", u"Impress Office Open XML"_ustr }, - { u"tdf92001.odp", u"xml/tdf92001_", u"Impress Office Open XML"_ustr }, + { u"n820786.pptx", u"xml/n820786_", TestFilter::NONE }, + { u"n762695.pptx", u"xml/n762695_", TestFilter::NONE }, + { u"n593612.pptx", u"xml/n593612_", TestFilter::NONE }, + { u"fdo71434.pptx", u"xml/fdo71434_", TestFilter::NONE }, + { u"n902652.pptx", u"xml/n902652_", TestFilter::NONE }, + { u"tdf90403.pptx", u"xml/tdf90403_", TestFilter::NONE }, + { u"tdf90338.odp", u"xml/tdf90338_", TestFilter::PPTX }, + { u"tdf92001.odp", u"xml/tdf92001_", TestFilter::PPTX }, // GCC -mfpmath=387 rounding issues in lclPushMarkerProperties // (oox/source/drawingml/lineproperties.cxx); see mail sub-thread starting at // "Re: Test File: sc/qa/unit/data/functions/fods/chiinv.fods: // fails with Assertion" for how "-mfpmath=sse -msse2" would fix that: #if !(defined LINUX && defined X86) - { u"tdf100491.pptx", u"xml/tdf100491_", u""_ustr }, + { u"tdf100491.pptx", u"xml/tdf100491_", TestFilter::NONE }, #endif - { u"tdf109317.pptx", u"xml/tdf109317_", u"impress8"_ustr }, - // { u"pptx/n828390.pptx", u"pptx/xml/n828390_", "Impress Office Open XML" }, // Example + { u"tdf109317.pptx", u"xml/tdf109317_", TestFilter::ODP }, + // { u"pptx/n828390.pptx", u"pptx/xml/n828390_", TestFilter::PPTX }, // Example }; for (int i = 0; i < static_cast(SAL_N_ELEMENTS(aFilesToCompare)); ++i) @@ -163,7 +163,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testDocumentLayout) = -1; // index of test we want to update; supposedly only when the test is created loadFromFile(aFilesToCompare[i].sInput); - if (!aFilesToCompare[i].sExportType.isEmpty()) + if (aFilesToCompare[i].sExportType != TestFilter::NONE) saveAndReload(aFilesToCompare[i].sExportType); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY_THROW); @@ -347,7 +347,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf154363) CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nGlueId); } - saveAndReload(u"Impress MS PowerPoint 2007 XML"_ustr); + saveAndReload(TestFilter::PPTX_2007); { uno::Reference xConnector1(getShapeFromPage(1, 0), uno::UNO_SET_THROW); uno::Reference xConnector2(getShapeFromPage(3, 0), uno::UNO_SET_THROW); diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 45947c83000d..9ef9485783b0 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -191,7 +191,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf157285) CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf152186) { createSdImpressDoc("pptx/tdf152186.pptx"); - saveAndReload(u"Impress MS PowerPoint 2007 XML"_ustr); + saveAndReload(TestFilter::PPTX_2007); bool bHasShadow = bool(); const SdrPage* pPage = GetPage(1); @@ -1670,7 +1670,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf127964) CPPUNIT_ASSERT_EQUAL(true, rFillBackgroundItem.GetValue()); } - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); { const SdrPage* pPage = GetPage(1); @@ -2077,7 +2077,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf149961AutofitIndentation) CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf149588TransparentSolidFill) { createSdImpressDoc("pptx/tdf149588_transparentSolidFill.pptx"); - saveAndReload(u"Impress MS PowerPoint 2007 XML"_ustr); + saveAndReload(TestFilter::PPTX_2007); uno::Reference xShape(getShapeFromPage(6, 0)); uno::Reference xParagraph(getParagraphFromShape(0, xShape)); @@ -2104,7 +2104,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testOverflowBehaviorClip) true, xPropSet->getPropertyValue(u"TextClipVerticalOverflow"_ustr).get()); } - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); { uno::Reference xPropSet(getShapeFromPage(0, 0)); CPPUNIT_ASSERT_EQUAL( diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx index 10d2ed500d79..553d1841c479 100644 --- a/sd/qa/unit/layout-tests.cxx +++ b/sd/qa/unit/layout-tests.cxx @@ -535,7 +535,7 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf168010) } // 2. It must stay enabled after ODP round-trip - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); { CPPUNIT_ASSERT( getDoc()->GetCompatibilityFlag(SdrCompatibilityFlag::UseTrailingEmptyLinesInLayout)); @@ -559,7 +559,7 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf168010) } // 4. It must stay disabled after ODP round-trip - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); { CPPUNIT_ASSERT( !getDoc()->GetCompatibilityFlag(SdrCompatibilityFlag::UseTrailingEmptyLinesInLayout)); @@ -586,7 +586,7 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf168010) } // 6. Check PPTX round-trip - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); { CPPUNIT_ASSERT( getDoc()->GetCompatibilityFlag(SdrCompatibilityFlag::UseTrailingEmptyLinesInLayout)); @@ -602,7 +602,7 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf168010) skipValidation(); // 7. It must round-trip to ODP - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); { CPPUNIT_ASSERT( getDoc()->GetCompatibilityFlag(SdrCompatibilityFlag::UseTrailingEmptyLinesInLayout)); diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index cbad214058ef..df5ba7d5940f 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -395,7 +395,7 @@ void SdMiscTest::testTdf44774() rStyleB.SetParent(u"StyleA"_ustr); // Now save the file and reload - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); pDocShell = pXImpressDocument->GetDocShell(); @@ -420,7 +420,7 @@ void SdMiscTest::testTdf38225() pSSPool->Make(u"StyleWithName1"_ustr, SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined); // Now save the file and reload - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); pDocShell = pXImpressDocument->GetDocShell(); @@ -433,7 +433,7 @@ void SdMiscTest::testTdf38225() CPPUNIT_ASSERT(pStyle->SetName(u"StyleWithName2"_ustr)); // Save the file and reload again - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); pXImpressDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); pDocShell = pXImpressDocument->GetDocShell(); @@ -549,7 +549,7 @@ void SdMiscTest::testTdf101242_ODF_add_settings() comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(true, pBatch); pBatch->commit(); - save(u"draw8"_ustr); + save(TestFilter::ODG); // Verify, that the saved document still has the ODF attributes xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -603,7 +603,7 @@ void SdMiscTest::testTdf101242_ODF_no_settings() comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(false, pBatch); pBatch->commit(); - save(u"draw8"_ustr); + save(TestFilter::ODG); // Verify, that the saved document still has the ODF attributes xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -640,7 +640,7 @@ void SdMiscTest::testTdf101242_settings_keep() comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(true, pBatch); pBatch->commit(); - save(u"draw8"_ustr); + save(TestFilter::ODG); // Verify, that the saved document has the ODF attributes xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -695,7 +695,7 @@ void SdMiscTest::testTdf101242_settings_remove() comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::set(false, pBatch); pBatch->commit(); - save(u"draw8"_ustr); + save(TestFilter::ODG); // Verify, that the saved document has the ODF attributes xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -740,7 +740,7 @@ void SdMiscTest::testTdf119392() pPageView->SetLayerVisible(u"-P-"_ustr, false); pPageView->SetLayerPrintable(u"-P-"_ustr, true); pPageView->SetLayerLocked(u"-P-"_ustr, false); - save(u"draw8"_ustr); + save(TestFilter::ODG); // Verify correct bit order in bitfield in the config items in settings.xml xmlDocUniquePtr pXmlDoc = parseExport(u"settings.xml"_ustr); @@ -842,7 +842,7 @@ void SdMiscTest::testTdf98839_ShearVFlipH() pShape->Mirror(Point(4000, 2000), Point(4000, 10000)); // Save and examine attribute draw:transform - save(u"draw8"_ustr); + save(TestFilter::ODG); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT_MESSAGE("Failed to get 'content.xml'", pXmlDoc); static constexpr OString sPathStart( @@ -1034,7 +1034,7 @@ void SdMiscTest::testEncodedTableStyles() ->replaceByName(u"body"_ustr, uno::Any(xCellStyle)); } - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); { uno::Reference xStyleFamiliesSupplier(mxComponent, diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 060f679858b2..caf90b070016 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -1263,7 +1263,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testTdf81754) Scheduler::ProcessEventsToIdle(); // now save, reload, and assert that we did not lose the edit - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index c19b90dd19dc..49f874a31e2f 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -1983,7 +1983,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf153161) // Type something, getting into text editing mode (appending) automatically insertStringToObject(1, u"Foo Bar", /*bUseEscape*/ false); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); xDrawPagesSupplier.set(mxComponent, uno::UNO_QUERY); xDrawPage.set(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); @@ -2033,7 +2033,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696) dispatchCommand(mxComponent, u".uno:OutlineFont"_ustr, {}); // Save it as PPTX and load it again. - saveAndReload(u"Impress Office Open XML"_ustr); + saveAndReload(TestFilter::PPTX); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(1), diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index 55d7001a90a8..059ca8a69d7e 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -61,7 +61,7 @@ void MathMLExportTest::testBlank() SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"x`y~~z"_ustr); - save(u"MathML XML (Math)"_ustr); + save(TestFilter::MML); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[1]", "width", u"0.5em"); @@ -74,7 +74,7 @@ void MathMLExportTest::testTdf97049() SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"intd {{1 over x} dx}"_ustr); - save(u"MathML XML (Math)"_ustr); + save(TestFilter::MML); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]", "stretchy", u"true"); @@ -87,7 +87,7 @@ void MathMLExportTest::checkMathVariant(SmDocShell& rDocShell, bool bCapital, bo { rDocShell.SetText(u"%GAMMA %iGAMMA {ital %GAMMA} {nitalic %iGAMMA} " "%gamma %igamma {ital %gamma} {nitalic %igamma}"_ustr); - save(u"MathML XML (Math)"_ustr); + save(TestFilter::MML); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); if (bCapital) @@ -129,7 +129,7 @@ void MathMLExportTest::testMaj() SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText( u"maj to { \u0661 } from { \U0001EE0A = \u0660 } { \u0661 over \U0001EE0A }"_ustr); - save(u"MathML XML (Math)"_ustr); + save(TestFilter::MML); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", "stretchy", u"false"); @@ -142,7 +142,7 @@ void MathMLExportTest::testHadd() SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"hadd to { \U0001EE4E } from { \U0001EE4E } \U0001EE4E"_ustr); - save(u"MathML XML (Math)"_ustr); + save(TestFilter::MML); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi", u"\U0001EEF1"); @@ -154,7 +154,7 @@ void MathMLExportTest::testTdf158867() SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"1,2 over 2 = 0,65"_ustr); - save(u"MathML XML (Math)"_ustr); + save(TestFilter::MML); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:mfrac/m:mn[1]", u"1,2"); diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index 233d49793705..a49416472e99 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -1186,7 +1186,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf136176) } // Save and reload - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); // Expected values of point 4 of the shape polygon const OString sTestCase[] = { "FlipH"_ostr, "FlipV"_ostr, "FlipHV"_ostr }; diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index f4f4f2cba1e3..b3b8ce14e227 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -602,7 +602,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testPageViewDrawLayerClip) loadFromFile(u"page-view-draw-layer-clip.docx"); // When saving that document to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that line shape gets clipped: std::unique_ptr pDoc = parsePDFExport(); diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx index 5cefd05827ad..e7243c15d5b7 100644 --- a/sw/qa/core/draw/draw.cxx +++ b/sw/qa/core/draw/draw.cxx @@ -112,7 +112,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) createSwDoc("tdf107727_FrameBorder.odt"); // Export to RTF and reload - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Get frame without border and inspect it. uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/core/header_footer/HeaderFooterTest.cxx b/sw/qa/core/header_footer/HeaderFooterTest.cxx index fcf7d1a0aac6..5f117f87b0b6 100644 --- a/sw/qa/core/header_footer/HeaderFooterTest.cxx +++ b/sw/qa/core/header_footer/HeaderFooterTest.cxx @@ -109,7 +109,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testHeaderFooterWithSpecialFirstPage_OOXM { // Load, save in OOXML format and reload createSwDoc("tdf118393.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(7, getPages()); @@ -147,7 +147,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testHeaderFooterWithSpecialFirstPage_ODF) { // Load, save in ODF format and reload createSwDoc("tdf118393.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(7, getPages()); @@ -187,7 +187,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFloatingTableInHeader) // This was 0, floating table in header wasn't converted to a TextFrame. CPPUNIT_ASSERT_EQUAL(1, getShapes()); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This was 0, floating table in header wasn't converted to a TextFrame. CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -258,7 +258,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstPageHeadersAndEmptyFooters) createSwDoc("fdo66145.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -288,14 +288,14 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstHeaderFooterImport) createSwDoc("first-header-footer.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstHeaderFooterRoundTrip) { createSwDoc("first-header-footerB.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(6, getPages()); @@ -317,7 +317,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstHeaderFooterRoundTrip) CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstHeaderFooter_ODF) { createSwDoc("first-header-footer.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(6, getPages()); // Test import and export of the header-first token. @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstHeaderFooter_ODF) CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstHeaderFooter_DOC) { createSwDoc("first-header-footer.doc"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Test import and export of a section's headerf/footerf properties. @@ -387,7 +387,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFdo65655) }; createSwDoc("fdo65655.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -400,7 +400,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testImageInHeader) CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(4, getShapes()); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(4, getShapes()); @@ -415,7 +415,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testImageInFooter) CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(2, getShapes()); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -432,7 +432,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf112694) createSwDoc("tdf112694.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -465,7 +465,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testContSectBreakHeaderFooter) createSwDoc("cont-sect-break-header-footer.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); // Additional problem: top margin on page 3 was wrong. @@ -481,7 +481,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testContSectBreakHeaderFooter) CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf145998_firstHeader) { createSwDoc("tdf145998_firstHeader.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Sanity check - always good to test when dealing with page styles and breaks. CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -561,7 +561,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testEvenPageOddPageFooter_Roundtrip) // Load, save as OOXML and reload createSwDoc("tdf135216_evenOddFooter.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( @@ -598,7 +598,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testEvenPageOddPageFooter_Roundtrip) CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf69635) { createSwDoc("tdf69635.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlHeader1 = parseExport(u"word/header1.xml"_ustr); CPPUNIT_ASSERT(pXmlHeader1); @@ -618,7 +618,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf69635) CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf113849_evenAndOddHeaders) { createSwDoc("tdf113849_evenAndOddHeaders.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Header2 text", u"L. J. Kendall"_ustr, @@ -657,7 +657,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testFirstPageFooterEnabled) }; createSwDoc("TestFirstFooterDisabled.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -750,7 +750,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testBnc519228OddBreaks) createSwDoc("bnc519228_odd-breaksB.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } #endif @@ -893,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(TestHFBase, testHFLinkToPrev) }; createSwDoc("headerfooter-link-to-prev.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -915,14 +915,14 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testN750935) }; createSwDoc("n750935.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testOnlyLeftPageStyle) { createSwDoc("TestPageStyleOnlyLeft.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // There should be 2 pages - first page should be blank CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -971,7 +971,7 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testMsoPosition) }; createSwDoc("bnc884615-mso-position.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verifyHeader(); verifyFooter(); } diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx index 73d3af5a565d..48d816ba435b 100644 --- a/sw/qa/core/layout/flycnt.cxx +++ b/sw/qa/core/layout/flycnt.cxx @@ -738,7 +738,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyThenTable) // When layout is calculated during PDF export: // Then make sure that finishes without errors: // This crashed, due to a stack overflow in layout code. - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); } CPPUNIT_TEST_FIXTURE(Test, testSplitFlyInTextSection) diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index c4147d8893b5..6d4512bfb0f0 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -409,7 +409,7 @@ void SwMacrosTest::testFdo68983() loadFromFile(u"odt/fdo68983.odt"); Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // check that password-protected library survived store and re-load Reference xDocScr(mxComponent, UNO_QUERY_THROW); @@ -438,7 +438,7 @@ void SwMacrosTest::testFdo87530() xBasLibPwd->changeLibraryPassword(u"BarLibrary"_ustr, u""_ustr, u"foo"_ustr); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); { // check that password-protected library survived store and re-load @@ -461,7 +461,7 @@ void SwMacrosTest::testFdo87530() xBasLibPwd->changeLibraryPassword(u"FooLibrary"_ustr, u""_ustr, u"foo"_ustr); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // check that password-protected library survived store and re-load Reference xDocScr(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/core/text/itrform2.cxx b/sw/qa/core/text/itrform2.cxx index dea8ddcc9489..10931b0dfa41 100644 --- a/sw/qa/core/text/itrform2.cxx +++ b/sw/qa/core/text/itrform2.cxx @@ -151,7 +151,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlHeaderPDFExport) createSwDoc("content-control-header.docx"); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure all the expected text is there on page 2: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -215,7 +215,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckedCheckboxContentControlPDF) pWrtShell->GotoContentControl(rFormatContentControl); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a checked checkbox form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFFontColor) pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT); // When exporting that document to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that the widget in the PDF result has that custom font color: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -306,7 +306,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownText) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting that to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that the custom default is not lost: std::unique_ptr pPdfDocument = parsePDFExport(); diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 25d1b7ed34bb..5eef468719c7 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -110,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLastBibliographyPdfExport) createSwDoc("tdf158505.odt"); // It should be possible to export to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Without the accompanying fix, the export to PDF would get stuck in an infinite loop CPPUNIT_ASSERT(true); @@ -182,7 +182,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159903) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159924) { createSwDoc("tdf159924.odt"); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); vcl::filter::PDFDocument aDocument; SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159336) { SwExportFormFieldsGuard g; createSwDoc("tdf159336.odt"); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); vcl::filter::PDFDocument aDocument; SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); @@ -276,7 +276,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport) xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure the field links the source. std::unique_ptr pPdfDocument = parsePDFExport(); @@ -313,7 +313,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport2) xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure the field links when the Target URL is set // (this test is important, isn't the same as the one above) @@ -349,7 +349,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport3) xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure there are no links since UseTargetURL is not set std::unique_ptr pPdfDocument = parsePDFExport(); @@ -385,7 +385,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport4) xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure the field links when the Target URL is set std::unique_ptr pPdfDocument = parsePDFExport(); @@ -430,7 +430,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport5) xTableIndex->update(); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure the mark links to the table when table is present std::unique_ptr pPdfDocument = parsePDFExport(); @@ -525,7 +525,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport6) CPPUNIT_ASSERT_EQUAL(iTabPos, sDocumentText.lastIndexOf(sExpectedPattern)); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure the mark links to the table even when format contains tab stop std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1055,7 +1055,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF) pContentControl->SetAlias(u"mydesc"_ustr); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a fillable form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1086,7 +1086,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPlaceholderPDF) pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a fillable form widget is emitted with the expected value: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1114,7 +1114,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF) pWrtShell->InsertContentControl(SwContentControlType::CHECKBOX); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a checkbox form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1144,7 +1144,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF) pWrtShell->InsertContentControl(SwContentControlType::DROP_DOWN_LIST); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a dropdown form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1170,7 +1170,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF2) SwExportFormFieldsGuard g; createSwDoc("tdf153040.docx"); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Make sure that a dropdown form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1199,7 +1199,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDateContentControlPDF) pWrtShell->InsertContentControl(SwContentControlType::DATE); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a date form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1236,7 +1236,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDFFont) pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT); // When exporting that document to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that the widget in the PDF result has that custom font size: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1264,7 +1264,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testComboContentControlPDF) pWrtShell->InsertContentControl(SwContentControlType::COMBO_BOX); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a combo box form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1306,7 +1306,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRichContentControlPDF) pWrtShell->SetAttrSet(aSet); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a single fillable form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1329,7 +1329,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testPlaceholderFieldPDF) createSwDoc("placeholder.fodt"); // When exporting to PDF (default setting is "create a PDF form"): - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); // Then make sure that a fillable form widget is emitted: std::unique_ptr pPdfDocument = parsePDFExport(); @@ -1683,7 +1683,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf161990) createSwDoc("tdf161990-subscripts.fodt"); // When exporting to PDF: - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); auto pPdfDocument = parsePDFExport(); // Check that both subscripts are positioned correctly relative to the non-subscript runs diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx index ba18f844d744..cb29ae74c41c 100644 --- a/sw/qa/core/unocore/unocore.cxx +++ b/sw/qa/core/unocore/unocore.cxx @@ -853,7 +853,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testParagraphMarkerODFExport) createSwDoc("paragraph-marker.docx"); // When saving that as ODT + reload: - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Then make sure that it still has the correct color: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -871,7 +871,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testParagraphMarkerFormattedRun) createSwDoc("paragraph-marker-formatted-run.docx"); // When saving that as ODT + reload: - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Then make sure that the numbering portion is still non-bold, matching Word: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -989,7 +989,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testCollectFrameAtNodeWithLayout) calcLayout(); // When saving to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the output is valid and hasa 1 : // Without the accompanying fix in place, this test would have failed with: diff --git a/sw/qa/extras/docbookexport/docbookexport.cxx b/sw/qa/extras/docbookexport/docbookexport.cxx index c7af794bcb75..8c9f8b25d81a 100644 --- a/sw/qa/extras/docbookexport/docbookexport.cxx +++ b/sw/qa/extras/docbookexport/docbookexport.cxx @@ -22,7 +22,7 @@ public: CPPUNIT_TEST_FIXTURE(DocbookExportTest, testsimple) { createSwDoc("simple.docx"); - save(u"DocBook File"_ustr); + save(TestFilter::DOCBOOK); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -33,7 +33,7 @@ CPPUNIT_TEST_FIXTURE(DocbookExportTest, testsimple) CPPUNIT_TEST_FIXTURE(DocbookExportTest, testtdf91095) { createSwDoc("tdf91095.docx"); - save(u"DocBook File"_ustr); + save(TestFilter::DOCBOOK); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); } diff --git a/sw/qa/extras/embedded_fonts/embedded_fonts.cxx b/sw/qa/extras/embedded_fonts/embedded_fonts.cxx index 8fd1c9e6d99b..633a430d7b25 100644 --- a/sw/qa/extras/embedded_fonts/embedded_fonts.cxx +++ b/sw/qa/extras/embedded_fonts/embedded_fonts.cxx @@ -191,7 +191,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOpenODTWithRestrictedEmbeddedFont) CPPUNIT_ASSERT(fontMappingData.wasSubstituted(u"Naftalene")); // Make sure that saving doesn't somehow embed the font - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXml = parseExport(u"content.xml"_ustr); assertXPath(pXml, "//style:font-face[@style:name='Naftalene']"); assertXPath(pXml, "//style:font-face[@style:name='Naftalene']/svg:font-face-src", 0); @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOpenODTWithRestrictedEmbeddedFont) CPPUNIT_ASSERT(!fontMappingData.wasSubstituted(u"Naftalene")); // Make sure that saving doesn't somehow embed the font - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXml = parseExport(u"content.xml"_ustr); assertXPath(pXml, "//style:font-face[@style:name='Naftalene']"); assertXPath(pXml, "//style:font-face[@style:name='Naftalene']/svg:font-face-src", 0); @@ -262,7 +262,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOpenDOCXWithRestrictedEmbeddedFont) CPPUNIT_ASSERT(!fontMappingData.wasSubstituted(u"Unsteady Oversteer")); // Make sure that saving doesn't somehow embed the font - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/fontTable.xml"_ustr); assertXPath(pXml, "/w:fonts/w:font[@w:name='Naftalene']"); assertXPath(pXml, "/w:fonts/w:font[@w:name='Naftalene']/w:embedRegular", 0); @@ -298,7 +298,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOpenDOCXWithRestrictedEmbeddedFont) CPPUNIT_ASSERT(!fontMappingData.wasSubstituted(u"Unsteady Oversteer")); // Make sure that saving doesn't somehow embed the font - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/fontTable.xml"_ustr); assertXPath(pXml, "/w:fonts/w:font[@w:name='Naftalene']"); assertXPath(pXml, "/w:fonts/w:font[@w:name='Naftalene']/w:embedRegular", 0); @@ -334,7 +334,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOpenDOCXWithRestrictedEmbeddedFont) CPPUNIT_ASSERT(!fontMappingData.wasSubstituted(u"Unsteady Oversteer")); // Make sure that saving doesn't somehow embed the font - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/fontTable.xml"_ustr); assertXPath(pXml, "/w:fonts/w:font[@w:name='Naftalene']"); assertXPath(pXml, "/w:fonts/w:font[@w:name='Naftalene']/w:embedRegular", 0); @@ -386,7 +386,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167849) CPPUNIT_TEST_FIXTURE(Test, tdf166627) { createSwDoc("font_used_in_header_only.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // DejaVu Serif wasn't embedded before fix, because it was only seen used in header xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -455,7 +455,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontEmbedding) // CASE 1 - no font embedding enabled // Save the document - save(u"writer8"_ustr); + save(TestFilter::ODT); CPPUNIT_ASSERT(maTempFile.IsValid()); // Check setting - No font embedding should be enabled @@ -497,7 +497,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontEmbedding) xProps->setPropertyValue(u"EmbedOnlyUsedFonts"_ustr, uno::Any(false)); // Save the document again - save(u"writer8"_ustr); + save(TestFilter::ODT); CPPUNIT_ASSERT(maTempFile.IsValid()); // Check setting - font embedding should be enabled @@ -554,7 +554,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontEmbedding) xProps->setPropertyValue(u"EmbedComplexScriptFonts"_ustr, uno::Any(true)); // Save the document again - save(u"writer8"_ustr); + save(TestFilter::ODT); CPPUNIT_ASSERT(maTempFile.IsValid()); // Check setting - font embedding should be enabled + embed only used fonts and scripts @@ -623,7 +623,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedFontProps) xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY_THROW); xProps->setPropertyValue(u"EmbedFonts"_ustr, uno::Any(true)); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); #if !defined(MACOSX) // Test that font style/weight of embedded fonts is exposed. @@ -674,7 +674,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontEmbeddingDOCX) xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(uno::Any(true), xProps->getPropertyValue(u"EmbedFonts"_ustr)); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/fontTable.xml"_ustr); diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx index a4a83545adcc..b92427c3ca2f 100644 --- a/sw/qa/extras/fodfexport/fodfexport.cxx +++ b/sw/qa/extras/fodfexport/fodfexport.cxx @@ -29,7 +29,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113696) CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); - save(u"OpenDocument Text Flat XML"_ustr); + save(TestFilter::FODT); // Test that an image which is written in svm format (image/x-vclgraphic) // is accompanied by a png fallback graphic. xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -46,7 +46,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113696WriterImage) CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); - save(u"OpenDocument Text Flat XML"_ustr); + save(TestFilter::FODT); // Same as testTdf113696, but with a writer image instead of a draw image // (they use different code paths). xmlDocUniquePtr pXmlDoc = parseExportedFile(); @@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSvgImageRoundtrip) createSwDoc("SvgImageTest.fodt"); verify(); - saveAndReload(u"OpenDocument Text Flat XML"_ustr); + saveAndReload(TestFilter::FODT); verify(); } diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index ed4a4b7ae761..ab387550c84a 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -101,24 +101,24 @@ public: void Test::testEmbeddedGraphicRoundtrip() { - OUString aFilterNames[] = { - u"writer8"_ustr, - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { // Check whether the export code swaps in the image which was swapped out before by auto mechanism createSwDoc("document_with_two_images.odt"); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check whether graphic exported well after it was swapped out - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 2, getShapes()); // First image @@ -157,21 +157,21 @@ void Test::testEmbeddedGraphicRoundtrip() void Test::testLinkedGraphicRT() { - const OUString aFilterNames[] = { - u"writer8"_ustr, -// "Rich Text Format", Note: picture is there, but SwGrfNode is not found? - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + // TestFilter::RTF, Note: picture is there, but SwGrfNode is not found? + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("document_with_linked_graphic.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); SwDoc* pDoc = getSwDoc(); CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pDoc); @@ -213,22 +213,22 @@ void Test::testImageWithSpecialID() // Check how LO handles when the imported graphic's ID is different from that one // which is generated by LO. - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("images_with_special_IDs.odt"); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check whether graphic exported well - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 2, getShapes()); uno::Reference xImage = getShape(1); @@ -296,22 +296,22 @@ void Test::testGraphicShape() // There are two kind of images in Writer: 1) Writer specific handled by SwGrfNode and // 2) graphic shape handled by SdrGrafObj (e.g. after copy&paste from Impress). - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("graphic_shape.odt"); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check whether graphic exported well - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 2, getShapes()); uno::Reference xImage = lcl_getShape(mxComponent, true); @@ -330,13 +330,13 @@ void Test::testGraphicShape() } // MS filters make this kind of linked images broken !? - if (rFilterName != "writer8") + if (eFilterName != TestFilter::ODT) return; // Second image is a linked one xImage = lcl_getShape(mxComponent, false); XPropSet.set(xImage, uno::UNO_QUERY); - const OString sFailedImageLoad = OString::Concat("Couldn't load the shape/image for ") + rFilterName.toUtf8(); + const OString sFailedImageLoad = OString::Concat("Couldn't load the shape/image for ") + TestFilterNames.at(eFilterName).toUtf8(); CPPUNIT_ASSERT_MESSAGE(sFailedImageLoad.getStr(), xImage.is()); // Check size @@ -385,22 +385,22 @@ void Test::testMultipleIdenticalGraphics() // after loading them again. This test check that the de-duplication // works as expected. - const OUString aFilterNames[] { - u"writer8"_ustr, - //"Rich Text Format", // doesn't work correctly for now - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + //TestFilter::RTF, doesn't work correctly for now + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("multiple_identical_graphics.odt"); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check whether graphic exported well - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); auto aGraphics = lcl_getGraphics(mxComponent); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), size_t(5), aGraphics.size()); @@ -417,7 +417,7 @@ void Test::testMultipleIdenticalGraphics() // Check all addresses are the same bool bResult = std::equal(aGfxLinkAddresses.begin() + 1, aGfxLinkAddresses.end(), aGfxLinkAddresses.begin()); const OString sGraphicNotTheSameFailedMessage = OString::Concat("Graphics not the same for filter: '") + - rFilterName.toUtf8() + OString::Concat("'"); + TestFilterNames.at(eFilterName).toUtf8() + OString::Concat("'"); CPPUNIT_ASSERT_EQUAL_MESSAGE(sGraphicNotTheSameFailedMessage.getStr(), true, bResult); } } @@ -427,21 +427,21 @@ void Test::testCharHighlightBody() // MS Word has two kind of character backgrounds called character shading and highlighting // MS filters handle these attributes separately, but ODF export merges them into one background attribute - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("char_highlight.docx"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); const uno::Reference< text::XTextRange > xPara = getParagraph(1); // Both highlight and background @@ -470,7 +470,7 @@ void Test::testCharHighlightBody() case 16: nHighlightColor = COL_LIGHTGRAY; break; //light gray 0xC0C0C0 } - if (rFilterName == "writer8") + if (eFilterName == TestFilter::ODT) { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_TRANSPARENT, getProperty(xRun,u"CharHighlight"_ustr)); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), nHighlightColor, getProperty(xRun,u"CharBackColor"_ustr)); @@ -485,7 +485,7 @@ void Test::testCharHighlightBody() // Only highlight { const uno::Reference xRun(getRun(xPara,18), uno::UNO_QUERY); - if (rFilterName == "writer8") + if (eFilterName == TestFilter::ODT) { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_TRANSPARENT, getProperty(xRun,u"CharHighlight"_ustr)); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_LIGHTRED, getProperty(xRun,u"CharBackColor"_ustr)); @@ -511,20 +511,21 @@ void Test::testCharStyleHighlight() // MS Word has two kind of character backgrounds called character shading and highlighting. // However, their character style can only accept shading. It ignores the highlighting value. - const OUString aFilterNames[] = { - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("tdf138345_charstyle_highlight.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); uno::Reference xCharStyle; getStyles(u"CharacterStyles"_ustr)->getByName(u"charBackground"_ustr) >>= xCharStyle; @@ -590,7 +591,7 @@ void Test::testCharHighlightODF() } } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xPara.set(getParagraph(1)); for (int i = 1; i <= 4; ++i) @@ -624,22 +625,22 @@ void Test::testMSCharBackgroundEditing() // Simulate the editing process of imported MSO character background attributes // and check how export behaves. - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; auto batch = comphelper::ConfigurationChanges::create(); officecfg::Office::Common::Filter::Microsoft::Export::CharBackgroundToHighlighting::set(true, batch); batch->commit(); - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("char_background_editing.docx"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Check whether import was done on the right way uno::Reference< text::XTextRange > xPara = getParagraph(1); @@ -691,7 +692,7 @@ void Test::testMSCharBackgroundEditing() } // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check whether background was exported as highlighting xPara.set(getParagraph(1)); @@ -706,7 +707,7 @@ void Test::testMSCharBackgroundEditing() case 4: nBackColor = COL_LIGHTMAGENTA; break; //light magenta 0xff00ff } const uno::Reference xRun(getRun(xPara,i), uno::UNO_QUERY); - if (rFilterName == "writer8") + if (eFilterName == TestFilter::ODT) { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_TRANSPARENT, getProperty(xRun,u"CharHighlight"_ustr)); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), nBackColor, getProperty(xRun,u"CharBackColor"_ustr)); @@ -725,24 +726,24 @@ void Test::testCharBackgroundToHighlighting() // MSO highlighting has less kind of values so let's see how LO character background is converted // to these values - const OUString aFilterNames[] = { - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("char_background.odt"); - OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); auto batch = comphelper::ConfigurationChanges::create(); officecfg::Office::Common::Filter::Microsoft::Export::CharBackgroundToHighlighting::set(true, batch); batch->commit(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check highlight color const uno::Reference< text::XTextRange > xPara = getParagraph(1); @@ -908,22 +909,22 @@ void Test::testNestedFieldmark() CPPUNIT_ASSERT_EQUAL(pInner, rIDMA.getInnerFieldmarkFor(innerPos)); }; - std::pair const aFilterNames[] = { - {"writer8", "fieldmark_QUOTE_nest.fodt"}, - {"Office Open XML Text", "fieldmark_QUOTE_nest.docx"}, - {"Rich Text Format", "fieldmark_QUOTE_nest.rtf"}, + std::pair const aFilterNames[] = { + {TestFilter::ODT, "fieldmark_QUOTE_nest.fodt"}, + {TestFilter::DOCX, "fieldmark_QUOTE_nest.docx"}, + {TestFilter::RTF, "fieldmark_QUOTE_nest.rtf"}, }; for (auto const & rFilterName : aFilterNames) { createSwDoc(rFilterName.second.toUtf8().getStr()); - verify(rFilterName.first + ", load"); + verify(TestFilterNames.at(rFilterName.first) + ", load"); // Export the document and import again saveAndReload(rFilterName.first); - verify(rFilterName.first + " exported-reload"); + verify(TestFilterNames.at(rFilterName.first) + " exported-reload"); } } @@ -972,7 +973,7 @@ void Test::testODF13() // export ODF 1.3 SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // check XML xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr); @@ -1030,7 +1031,7 @@ void Test::testODF13() SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_012); // don't reload - no point - save(u"writer8"_ustr); + save(TestFilter::ODT); // check XML xmlDocUniquePtr pContentXml = parseExport(u"content.xml"_ustr); @@ -1051,11 +1052,11 @@ void Test::testODF13() void Test::testRedlineFlags() { - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Rich Text Format"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; createSwDoc(); @@ -1080,30 +1081,30 @@ void Test::testRedlineFlags() rIDRA.GetRedlineFlags() & ~RedlineFlags::ShowDelete; rIDRA.SetRedlineFlags(nRedlineFlags); - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { // export the document - save(rFilterName); + save(eFilterName); // tdf#97103 check that redline mode is properly restored CPPUNIT_ASSERT_EQUAL_MESSAGE( - OString(OString::Concat("redline mode not restored in ") + rFilterName.toUtf8()).getStr(), + OString(OString::Concat("redline mode not restored in ") + TestFilterNames.at(eFilterName).toUtf8()).getStr(), static_cast(nRedlineFlags), static_cast(rIDRA.GetRedlineFlags())); } } void Test::testBulletAsImage() { - OUString aFilterNames[] = { - u"writer8"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, - u"Rich Text Format"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { - OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); createSwDoc("BulletAsImage.odt"); @@ -1154,7 +1155,7 @@ void Test::testBulletAsImage() } // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); { uno::Reference xPara(getParagraph(1)); @@ -1197,18 +1198,18 @@ void Test::testBulletAsImage() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), tools::Long(16), aGraphic.GetSizePixel().Height()); // Graphic Size - if (rFilterName == "write8") // ODT is correct + if (eFilterName == TestFilter::ODT) // ODT is correct { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(400), aSize.Width); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(400), aSize.Height); } // FIXME: MS Filters don't work correctly for graphic bullet size - else if (rFilterName == "Office Open XML Text" || rFilterName == "Rich Text Format") + else if (eFilterName == TestFilter::DOCX || eFilterName == TestFilter::RTF) { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(279), aSize.Width); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(279), aSize.Height); } - else if (rFilterName == "MS Word 97") + else if (eFilterName == TestFilter::DOC) { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(296), aSize.Width); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(296), aSize.Height); @@ -1715,7 +1716,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143311) xDrawPage->add(xShape); } // check DOCX filters - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), u"Decorative"_ustr)); CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(2), u"Decorative"_ustr)); { @@ -1725,7 +1726,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143311) xStyle->setPropertyValue(u"Decorative"_ustr, uno::Any(true)); } // check ODF filters - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), u"Decorative"_ustr)); CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(2), u"Decorative"_ustr)); CPPUNIT_ASSERT_EQUAL(true, getProperty(getStyles(u"FrameStyles"_ustr)->getByName(u"Formula"_ustr), u"Decorative"_ustr)); @@ -1819,20 +1820,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143311) void Test::testTextFormField() { - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::DOC, + TestFilter::DOCX, }; - for (const OUString& rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("text_form_field.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check the document after round trip SwDoc* pDoc = getSwDoc(); @@ -1869,20 +1870,20 @@ void Test::testTextFormField() void Test::testCheckBoxFormField() { - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::DOC, + TestFilter::DOCX, }; - for (const OUString& rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("checkbox_form_field.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check the document after round trip SwDoc* pDoc = getSwDoc(); @@ -1896,7 +1897,7 @@ void Test::testCheckBoxFormField() { ::sw::mark::Fieldmark* pFieldmark = dynamic_cast<::sw::mark::Fieldmark*>(*aIter); - if(rFilterName == "Office Open XML Text") // OOXML import also generates bookmarks + if(eFilterName == TestFilter::DOCX) // OOXML import also generates bookmarks { if(!pFieldmark) continue; @@ -1920,20 +1921,21 @@ void Test::testCheckBoxFormField() void Test::testDropDownFormField() { - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"MS Word 97"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::RTF, + TestFilter::DOC, + TestFilter::DOCX, }; - for (const OUString& rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("dropdown_form_field.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check the document after round trip SwDoc* pDoc = getSwDoc(); @@ -1994,22 +1996,22 @@ void Test::testDropDownFormField() void Test::testDateFormField() { - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::DOCX, }; - for (const OUString& rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("date_form_field.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check the document after round trip - if (rFilterName == "writer8") + if (eFilterName == TestFilter::ODT) { SwDoc* pDoc = getSwDoc(); IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); @@ -2174,22 +2176,22 @@ void Test::testDateFormField() void Test::testDateFormFieldCharacterFormatting() { - const OUString aFilterNames[] = { - u"writer8"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::DOCX, }; - for (const OUString& rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { createSwDoc("date_form_field_char_formatting.odt"); - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + TestFilterNames.at(eFilterName).toUtf8(); // Export the document and import again for a check - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Check the document after round trip - if (rFilterName == "writer8") + if (eFilterName == TestFilter::ODT) { SwDoc* pDoc = getSwDoc(); IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); @@ -2213,7 +2215,7 @@ void Test::testDateFormFieldCharacterFormatting() uno::Reference xTextPortion(getRun(getParagraph(1), 1), uno::UNO_QUERY); OUString aPortionType; xTextPortion->getPropertyValue(u"TextPortionType"_ustr) >>= aPortionType; - CPPUNIT_ASSERT_EQUAL(u"ContentControl"_ustr, aPortionType); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), u"ContentControl"_ustr, aPortionType); uno::Reference xContentControl; xTextPortion->getPropertyValue(u"ContentControl"_ustr) >>= xContentControl; @@ -2238,12 +2240,12 @@ void Test::testDateFormFieldCharacterFormatting() void Test::testSvgImageSupport() { - OUString aFilterNames[] = { - u"writer8"_ustr, - u"Office Open XML Text"_ustr, + TestFilter aFilterNames[] = { + TestFilter::ODT, + TestFilter::DOCX, }; - for (OUString const & rFilterName : aFilterNames) + for (TestFilter eFilterName : aFilterNames) { // Use case to import a document containing a SVG image, export in target format, import and check if the // SVG image is present and as expected in the document @@ -2252,10 +2254,10 @@ void Test::testSvgImageSupport() createSwDoc("SvgImageTest.odt"); // Export the document in target format and import again - saveAndReload(rFilterName); + saveAndReload(eFilterName); // Prepare fail message (writing which import/export filter was used) - const OString sFailedMessage = "Failed on filter: "_ostr + rFilterName.toUtf8(); + const OString sFailedMessage = "Failed on filter: "_ostr + TestFilterNames.at(eFilterName).toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 1, getShapes()); diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 2e84ffc2735f..c5a9052bf086 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -61,7 +61,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo81276) setImportFilterName(u"HTML (StarWriter)"_ustr); createSwDoc("fdo81276.html"); verify(); - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); verify(); } @@ -70,7 +70,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo62336) // The problem was essentially a crash during table export as docx/rtf/html // If calc-layout is enabled, the crash does not occur, that's why loadFromFile/save is used loadFromFile(u"fdo62336.docx"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); } CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo86857) @@ -94,7 +94,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo86857) setImportFilterName(u"HTML (StarWriter)"_ustr); createSwDoc("fdo86857.html"); verify(); - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); verify(); } @@ -143,14 +143,14 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testCharacterBorder) }; createSwDoc("charborder.odt"); verify(); - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); verify(); } CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportOfImages) { createSwDoc("textAndImage.docx"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -162,7 +162,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportOfImagesWithSkipImagesEnabled) { createSwDoc("textAndImage.docx"); setFilterOptions(u"SkipImages"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -175,7 +175,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbedded) { createSwDoc("skipimage-embedded.doc"); setFilterOptions(u"SkipImages"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Embedded spreadsheet was exported as image, so content was lost. Make // sure it's exported as HTML instead. @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbeddedDocument) { createSwDoc("skipimage-embedded-document.docx"); setFilterOptions(u"SkipImages"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Similar to testSkipImagesEmbedded, but with an embedded Writer object, // not a Calc one, and this time OOXML, not WW8. @@ -210,7 +210,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbeddedDocument) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportImageProperties) { createSwDoc("HTMLImage.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportImageProperties) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportCheckboxRadioButtonState) { createSwDoc("checkbox-radiobutton.doc"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -274,7 +274,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportCheckboxRadioButtonState) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportUrlEncoding) { createSwDoc("tdf76291.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -286,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportUrlEncoding) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportInternalUrl) { createSwDoc("tdf90905.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -298,7 +298,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportInternalUrl) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportImageBulletList) { createSwDoc("tdf66822.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -338,7 +338,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportImageBulletList) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf83890) { createSwDoc("tdf83890.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -348,7 +348,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf83890) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExtbChars) { createSwWebDoc("extb.html"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); OUString aExpected(u"\U00024b62"_ustr); // Assert that UTF8 encoded non-BMP Unicode character is correct uno::Reference xTextRange1 = getRun(getParagraph(1), 1); @@ -362,7 +362,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExtbChars) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testNormalImageExport) { createSwDoc("textAndImage.docx"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -377,7 +377,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testEmbedImagesEnabled) { createSwDoc("textAndImage.docx"); setFilterOptions(u"EmbedImages"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -396,7 +396,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testXHTML) { createSwWebDoc("hello.html"); setFilterOptions(u"XHTML"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); OString aExpected(" element. @@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfJpgImg) setImportFilterName(u"HTML (StarWriter)"_ustr); createSwDoc("reqif-jpg-img.xhtml"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -596,7 +596,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfTable) setImportFilterName(u"HTML (StarWriter)"_ustr); createSwDoc("reqif-table.xhtml"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); xmlDocUniquePtr pDoc = WrapReqifFromTempFile(); @@ -619,7 +619,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfTable2) { createSwDoc("reqif-table2.odt"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -659,7 +659,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testXHTMLUseCSS) { createSwDoc("xhtml-css.odt"); setFilterOptions(u"XHTML"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -677,7 +677,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfList) setImportFilterName(u"HTML (StarWriter)"_ustr); createSwDoc("reqif-list.xhtml"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -722,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOle2) createSwDoc("reqif-ole2.xhtml"); verify(); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); verify(); // Check that the replacement graphic is exported at RTF level. @@ -766,14 +766,14 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOle2Odg) createSwDoc("reqif-ole-odg.xhtml"); verify(); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); verify(); } CPPUNIT_TEST_FIXTURE(HtmlExportTest, testList) { createSwWebDoc("list.html"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -786,7 +786,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testList) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTransparentImage) { createSwDoc("transparent-image.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -820,7 +820,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testOleNodataReqIf) { createSwDoc("reqif-ole-nodata.odt"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // This failed, io::IOException was thrown during the filter() call. xmlDocUniquePtr pDoc = WrapReqifFromTempFile(); @@ -837,7 +837,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testNoLangReqIf) { createSwDoc("reqif-no-lang.odt"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); xmlDocUniquePtr pDoc = WrapReqifFromTempFile(); @@ -848,7 +848,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testNoLangReqIf) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFieldShade) { createSwDoc("field-shade.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -866,7 +866,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFieldShade) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf132739) { createSwDoc("tdf132739.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -881,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFieldShadeReqIf) { createSwDoc("field-shade-reqif.odt"); setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -898,7 +898,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFieldShadeReqIf) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf126879) { createSwDoc("tdf126879.odt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); static constexpr OString aExpected(""_ostr); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -1044,7 +1044,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF) // Now import this back and check the ODT result. ImportFromReqif(maTempFile.GetURL()); - save(u"writer8"_ustr); + save(TestFilter::ODT); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); @@ -1067,7 +1067,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1Paint) ImportFromReqif(createFileURL(u"paint-ole.xhtml")); // Save it as ODT to inspect the result of the OLE1 -> OLE2 conversion. - save(u"writer8"_ustr); + save(TestFilter::ODT); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); diff --git a/sw/qa/extras/htmlexport/htmlexport2.cxx b/sw/qa/extras/htmlexport/htmlexport2.cxx index 9fedfb541fde..9873c15fc1d2 100644 --- a/sw/qa/extras/htmlexport/htmlexport2.cxx +++ b/sw/qa/extras/htmlexport/htmlexport2.cxx @@ -110,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testShapeAsImageHtml) xDrawPageSupplier->getDrawPage()->add(xShape); // When exporting to plain HTML: - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); // Without the accompanying fix in place, this test would have failed with: // - Expected: @@ -133,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testJson) // When exporting to HTML, and specifying options as JSON: setFilterOptions(u"{\"XhtmlNs\":{\"type\":\"string\", \"value\":\"reqif-xhtml\"}," "\"ShapeDPI\":{\"type\":\"long\",\"value\":\"192\"}}"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Then make sure those options are not ignored: // Without the accompanying fix in place, this test would have failed, as GetPngPath() expects @@ -489,7 +489,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testClearingBreak) createSwWebDoc("clearing-break.html"); // Then make sure that the clear property of the break is not ignored: verify(); - saveAndReload(u"HTML (StarWriter)"_ustr); + saveAndReload(TestFilter::HTML_WRITER); // Make sure that the clear property of the break is not ignored during export: verify(); } @@ -552,7 +552,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio) xBodyText->insertTextContent(xCursor, xTextContent, false); // When exporting to HTML: - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Then make sure that the width is not a fixed size, that would break on resizing the browser // window: @@ -623,7 +623,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769) xRun->setPropertyValue(u"HyperLinkURL"_ustr, uno::Any(u".\\another.odt"_ustr)); // Export - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pHtmlDoc); @@ -638,7 +638,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf153923) { createSwDoc("TableWithIndent.fodt"); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Parse it as XML (strict!) xmlDocUniquePtr pDoc = parseXml(maTempFile); diff --git a/sw/qa/extras/htmlexport/htmlmodeltestbase.hxx b/sw/qa/extras/htmlexport/htmlmodeltestbase.hxx index 0a4098d685aa..268582a490a5 100644 --- a/sw/qa/extras/htmlexport/htmlmodeltestbase.hxx +++ b/sw/qa/extras/htmlexport/htmlmodeltestbase.hxx @@ -210,7 +210,7 @@ void SwHtmlDomExportTest::ParseOle1FromRtfUrl(const OUString& rRtfUrl, SvMemoryS void SwHtmlDomExportTest::ExportToReqif() { setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); } void SwHtmlDomExportTest::ExportToHTML() diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx index 893b18a814b1..3bc10238985e 100644 --- a/sw/qa/extras/htmlexport/xhtmlexport.cxx +++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx @@ -27,7 +27,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testImageEmbedding) { createSwDoc("image-mimetype.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT(pDoc); @@ -41,7 +41,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf131812) { createSwDoc("tdf131812.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf146264) { createSwDoc("tdf146264.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -75,7 +75,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf167910) { createSwDoc("tdf167910.fodt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -105,7 +105,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf118637) { createSwDoc("tdf118637.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf145361) { createSwDoc("tdf145361.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); // Without the fix in place, this test would have failed with // - SfxBaseModel::impl_store failed: 0xc10(Error Area:Io Class:Write Code:16) SvStream* pStream = maTempFile.GetStream(StreamMode::READ); @@ -133,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf142483) { createSwDoc("tdf142483.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -172,7 +172,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf107696) { createSwDoc("tdf107696.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); @@ -202,7 +202,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf66305) { createSwDoc("tdf66305.odt"); setFilterOptions(u"UTF8"_ustr); - save(u"XHTML Writer File"_ustr); + save(TestFilter::XHTML_WRITER); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); sal_uInt64 nLength = pStream->TellEnd(); diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 0540330922a7..7e6452a90ce4 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3595,7 +3595,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) createSwDoc("tdf109137.docx"); // FIXME: Error: attribute "text:start-value" has a bad value skipValidation(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 0, the blue rectangle moved from the 1st to the 2nd page. assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly/notxt", diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index a5ba9d7f9399..f332a5226806 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -1392,7 +1392,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) // inline the loading because currently properties can't be passed... OUString const url(createFileURL(u"table_cell_overlap.fodt")); loadWithParams(url, comphelper::containerToSequence(aFilterOptions)); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // somehow these 2 rows overlapped in the PDF unless CalcLayout() runs diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 94a522def904..f13163d640c3 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134463) CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117188) { createSwDoc("tdf117188.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); OUString sWidth = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "width"); OUString sHeight = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height"); @@ -2124,7 +2124,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122607_regression) // inline the loading because currently properties can't be passed... OUString const url(createFileURL(u"tdf122607_leerzeile.odt")); loadWithParams(url, comphelper::containerToSequence(aFilterOptions)); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // somehow these 2 rows overlapped in the PDF unless CalcLayout() runs @@ -2152,7 +2152,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf150616) // inline the loading because currently properties can't be passed... OUString const url(createFileURL(u"in_056132_mod.odt")); loadWithParams(url, comphelper::containerToSequence(aFilterOptions)); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -2962,7 +2962,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156724) // inline the loading because currently properties can't be passed... OUString const url(createFileURL(u"fdo56797-2-min.odt")); loadWithParams(url, comphelper::containerToSequence(aFilterOptions)); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // both pages have a tab frame and one footnote diff --git a/sw/qa/extras/layout/layout4.cxx b/sw/qa/extras/layout/layout4.cxx index 7fb98e772d11..b1e3897acd12 100644 --- a/sw/qa/extras/layout/layout4.cxx +++ b/sw/qa/extras/layout/layout4.cxx @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter4, testTdf147666) dispatchCommand(mxComponent, u".uno:GoToEndOfPara"_ustr, {}); dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {}); - save(u"writer8"_ustr); + save(TestFilter::ODT); sal_Int32 nNonInsertedViewTop = getXPathContent(parseExport(u"settings.xml"_ustr), "//config:config-item[@config:name='ViewTop']") .toInt32(); @@ -1030,7 +1030,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter4, testTdf147666) }; dispatchCommand(mxComponent, u".uno:InsertGraphic"_ustr, aArgs); - save(u"writer8"_ustr); + save(TestFilter::ODT); sal_Int32 nInsertedViewTop = getXPathContent(parseExport(u"settings.xml"_ustr), "//config:config-item[@config:name='ViewTop']") .toInt32(); diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx index efbf59ea6f1c..b1b6c9cc9d23 100644 --- a/sw/qa/extras/layout/layout5.cxx +++ b/sw/qa/extras/layout/layout5.cxx @@ -148,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf92714_TOC_pageBreak) SfxDispatcher& rDispatcher = *pView->GetViewFrame().GetDispatcher(); rDispatcher.Execute(FN_REMOVE_CUR_TOX); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( @@ -1124,7 +1124,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf121509) aNewAnch.SetAnchor(aCursor.Start()); CPPUNIT_ASSERT(pTriangleShapeFormat->SetFormatAttr(aNewAnch)); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The second part: check if the reloaded doc has flys inside a fly // FIXME: if we use 'saveAndReload' or 'loadFromURL' here, it fails with @@ -1913,7 +1913,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf167526) } // DOCX roundtrip: - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // check layout { @@ -2029,7 +2029,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf167540) verify_me(); // DOCX roundtrip: - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify_me(); } @@ -2147,7 +2147,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf168858) assertXPath(pXmlDoc, "//page['pass 1']/body/section/infos/bounds", "height", u"0"); } { - saveAndReload(u"OpenDocument Text Flat XML"_ustr); + saveAndReload(TestFilter::FODT); Scheduler::ProcessEventsToIdle(); // Recalculate conditions auto xTextSections = mxComponent.queryThrow()->getTextSections(); @@ -2191,7 +2191,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf168858) assertXPath(pXmlDoc, "//page['pass 3']/body/section/infos/bounds", "height", u"0"); } { - saveAndReload(u"OpenDocument Text Flat XML"_ustr); + saveAndReload(TestFilter::FODT); Scheduler::ProcessEventsToIdle(); // Recalculate conditions auto xTextSections = mxComponent.queryThrow()->getTextSections(); diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 20bdea8a547d..fe7275e5be36 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -78,7 +78,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathObjectFlatExport) officecfg::Office::Common::Cache::Writer::OLE_Objects::set(1, pBatch); pBatch->commit(); createSwDoc("2_MathType3.docx"); - saveAndReload(u"OpenDocument Text Flat XML"_ustr); // doesn't happen with ODF package + saveAndReload(TestFilter::FODT); // doesn't happen with ODF package uno::Reference xModifiable(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(!xModifiable->isModified()); @@ -194,7 +194,7 @@ void testTdf43569_CheckIfFieldParse() CPPUNIT_TEST_FIXTURE(Test, testTdf43569) { createSwDoc("tdf43569_conditionalfield.doc"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // check if our parser is valid testTdf43569_CheckIfFieldParse(); @@ -210,7 +210,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf43569) CPPUNIT_TEST_FIXTURE(Test, testTdf130314) { createSwDoc("tdf130314.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Without the fix in place, this test would have hung CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130314) CPPUNIT_TEST_FIXTURE(Test, testTdf133487) { createSwDoc("MadeByLO7.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -236,7 +236,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133487) CPPUNIT_TEST_FIXTURE(Test, testTdf141467) { createSwDoc("Formcontrol needs high z-index.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -269,7 +269,7 @@ DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt") CPPUNIT_TEST_FIXTURE(Test, testTdf125877) { createSwDoc("tdf95806.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xSupplier->getTextTables(), uno::UNO_QUERY); @@ -287,7 +287,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125877) CPPUNIT_TEST_FIXTURE(Test, testTdf150149) { createSwDoc("tdf150149.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // This was 0 (lost table header in multi-column section) @@ -335,7 +335,7 @@ DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt") CPPUNIT_TEST_FIXTURE(Test, testUserFieldDecl) { createSwDoc("user-field-decl.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); // Without the accompanying fix in place, this test would have failed with 'Expected: 2; @@ -347,7 +347,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUserFieldDecl) CPPUNIT_TEST_FIXTURE(Test, testUserFieldDeclFly) { createSwDoc("user-field-decl-fly.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -477,7 +477,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFramebackgrounds) createSwDoc("framebackgrounds.odt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -498,7 +498,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSHA1Correct) CPPUNIT_ASSERT_EQUAL(1, getPages()); getParagraph(1, u"012"_ustr); - saveAndReload(u"writer8"_ustr, sPass); + saveAndReload(TestFilter::ODT, sPass); CPPUNIT_ASSERT_EQUAL(1, getPages()); getParagraph(1, u"012"_ustr); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSHA1Wrong) CPPUNIT_ASSERT_EQUAL(1, getPages()); getParagraph(1, u"012"_ustr); - saveAndReload(u"writer8"_ustr, sPass); + saveAndReload(TestFilter::ODT, sPass); CPPUNIT_ASSERT_EQUAL(1, getPages()); getParagraph(1, u"012"_ustr); @@ -521,7 +521,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSHA1Wrong) CPPUNIT_TEST_FIXTURE(Test, testOOoxmlEmbedded) { createSwDoc("oooxml_embedded.sxw"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xTEOSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xAccess(xTEOSupplier->getEmbeddedObjects()); uno::Sequence aSeq(xAccess->getElementNames()); @@ -596,7 +596,7 @@ DECLARE_ODFEXPORT_TEST(testTdf140437, "tdf140437.odt") CPPUNIT_TEST_FIXTURE(Test, testTdf131621) { createSwDoc("tdf131621.ott"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(12, getShapes()); //Crash test, Check number of pages CPPUNIT_ASSERT_EQUAL( 1, getPages() ); @@ -605,7 +605,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131621) CPPUNIT_TEST_FIXTURE(Test, testTdf135144) { createSwDoc("tdf135144.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); //Crashes at import time after roundtrip CPPUNIT_ASSERT_EQUAL(3, getPages()); CPPUNIT_ASSERT_EQUAL(4, getShapes()); @@ -648,7 +648,7 @@ DECLARE_ODFEXPORT_TEST(testFdo38244, "fdo38244.odt") CPPUNIT_TEST_FIXTURE(Test, testSenderInitials) { createSwDoc("sender-initials.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Test sender-initial properties (both annotation metadata and text field) uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -746,7 +746,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92379) createSwDoc("tdf92379.fodt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -821,7 +821,7 @@ DECLARE_ODFEXPORT_TEST(testTextframeGradient, "textframe-gradient.odt") CPPUNIT_TEST_FIXTURE(Test, testDuplicateCrossRefHeadingBookmark) { createSwDoc("CrossRefHeadingBookmark.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // the file contains invalid duplicate heading cross reference bookmarks // but we have to round trip them, tdf#94804 @@ -927,7 +927,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58949) officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::set(false, pBatch); pBatch->commit(); createSwDoc("fdo58949.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); /* * The problem was that the exporter didn't insert "Obj102" to the @@ -935,7 +935,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58949) * and replacement image) OLE objects using UNO, so we'll check the zip file directly. */ - save(u"writer8"_ustr); + save(TestFilter::ODT); uno::Sequence aArgs{ uno::Any(maTempFile.GetURL()) }; uno::Reference xNameAccess(m_xSFactory->createInstanceWithArguments(u"com.sun.star.packages.zip.ZipFileAccess"_ustr, aArgs), uno::UNO_QUERY); @@ -963,7 +963,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58949) CPPUNIT_TEST_FIXTURE(Test, testTdf134987) { createSwDoc("tdf134987.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xTEOSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xAccess(xTEOSupplier->getEmbeddedObjects()); uno::Sequence aSeq(xAccess->getElementNames()); @@ -1223,7 +1223,7 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectionKey) createSwDoc("protection-key.fodt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(); // we can't assume that the user entered the password; check that we @@ -1238,7 +1238,7 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectionKey) CPPUNIT_TEST_FIXTURE(Test, testTdf128188) { createSwDoc("footnote-collect-at-end-of-section.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); SwDoc* pDoc = getSwDoc(); SwFootnoteIdxs const& rFootnotes(pDoc->GetFootnoteIdxs()); // Section1 @@ -1272,7 +1272,7 @@ DECLARE_ODFEXPORT_TEST(testFdo43807, "fdo43807.odt") CPPUNIT_TEST_FIXTURE(Test, testTdf103091) { createSwDoc("tdf103091.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // check that all conditional paragraph style conditions are imported uno::Reference xParaStyles(getStyles(u"ParagraphStyles"_ustr)); uno::Reference xStyle1(xParaStyles->getByName( @@ -1440,7 +1440,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf69500) xPersistence->store(); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Without the fix, the toolbar will be gone after save-and-reload { @@ -1487,7 +1487,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf60700_images) xImgMgr->store(); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Verify that the custom icon is still present after save-and-reload { @@ -1531,7 +1531,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf60700_accelerators) xAccel->store(); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Verify that the custom keyboard shortcut is still present after save-and-reload { @@ -1546,7 +1546,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf60700_accelerators) CPPUNIT_TEST_FIXTURE(Test, testTdf60700_directories) { createSwDoc(); - save(u"writer8"_ustr); + save(TestFilter::ODT); // There is no way to read the contents of Configurations2/ from a loaded document, // because only UIConfigurationManager has a reference to it and there is no method diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 7d08d1f51d33..7bd37ed31582 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -82,7 +82,7 @@ DECLARE_ODFEXPORT_TEST(testTdf77961, "tdf77961.odt") CPPUNIT_TEST_FIXTURE(Test, testTdf106733) { createSwDoc("tdf106733.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -112,7 +112,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page) // fo:hyphenation-keep="page" defined in direct paragraph formatting createSwDoc("tdf132599_page.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // This was 2 (not truncated hyphenated line) CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_auto) // fo:hyphenation-keep="auto" defined in direct paragraph formatting createSwDoc("tdf132599_auto.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // not truncated hyphenated line CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_spread) // fo:hyphenation-keep="page" loext:hyphenation-keep-type="spread" createSwDoc("tdf132599_spread.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // shift last line of right page, resulting 3 pages CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -151,7 +151,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_spread_left_page) // fo:hyphenation-keep="page" loext:hyphenation-keep-type="spread" createSwDoc("tdf132599_spread-left-page.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // do not shift last line of left page // This was 4 (shifted last line of left page, when it's hyphenated) CPPUNIT_ASSERT_EQUAL(3, getPages()); @@ -166,7 +166,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_column) // last line of the left column is shifted, according to // fo:hyphenation-keep="page" loext:hyphenation-keep-type="column" createSwDoc("tdf132599_column.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // shift last line of the first column, resulting 3 pages CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_not_last_column) // last line of the not last column is not shifted, according to // fo:hyphenation-keep="page" loext:hyphenation-keep-type="page" createSwDoc("tdf132599_page_in_not_last_column.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // do not shift last line of the first column, resulting 2 pages CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_last_column) // last line of the last column is shifted, according to // fo:hyphenation-keep="page" loext:hyphenation-keep-type="page" createSwDoc("tdf132599_page_in_last_column.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // shift last line of the first page, resulting 3 pages CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -208,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_always) // last full line of the paragraph column is not hyphenated // fo:hyphenation-keep="page" loext:hyphenation-keep-type="always" createSwDoc("tdf132599_always.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -224,7 +224,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_table) // last full line of the table is not hyphenated on page 1 // fo:hyphenation-keep="page" loext:hyphenation-keep-type="" createSwDoc("tdf132599_page_in_table.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // This was 2 (not handling hyphenation-keep in tables) CPPUNIT_ASSERT_EQUAL(3, getPages()); @@ -240,7 +240,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_default_paragraph_style) // fo:hyphenation-keep="page" defined in default paragraph style createSwDoc("tdf160518_page_in_default_paragraph_style.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_auto_in_default_paragraph_style) // fo:hyphenation-keep="auto" defined in default paragraph style createSwDoc("tdf160518_auto_in_default_paragraph_style.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -264,7 +264,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_text_body_style) // fo:hyphenation-keep="page" defined in text body style createSwDoc("tdf160518_page_in_text_body_style.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -276,7 +276,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_auto_in_text_body_style) // fo:hyphenation-keep="auto" defined in text body style createSwDoc("tdf160518_auto_in_text_body_style.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -288,7 +288,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165354_page) // fo:hyphenation-keep="page" defined in direct paragraph formatting createSwDoc("tdf165354_page.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // This was 3 in tdf132599, but now 2, shifting only the last hyphenated word, // not the full line, because of loext:hyphenation-keep-line=true CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -297,7 +297,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165354_page) CPPUNIT_TEST_FIXTURE(Test, testTdf158885_compound_remain) { createSwDoc("tdf158885_compound-remain.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//style:style[@style:family='paragraph']/style:text-properties[@loext:hyphenation-compound-remain-char-count='3']", 1); @@ -340,7 +340,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt") CPPUNIT_TEST_FIXTURE(Test, testRubyPosition) { createSwDoc("ruby-position.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -364,7 +364,7 @@ DECLARE_ODFEXPORT_TEST(testAllowOverlap, "allow-overlap.odt") CPPUNIT_TEST_FIXTURE(Test, testSignatureLineProperties) { createSwDoc("signatureline-properties.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xShape = getShape(1); CPPUNIT_ASSERT(xShape.is()); @@ -538,7 +538,7 @@ DECLARE_ODFEXPORT_TEST(tdf118502, "tdf118502.odt") CPPUNIT_TEST_FIXTURE(Test, tdf99631) { createSwDoc("tdf99631.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // check import of VisualArea settings of the embedded XLSX OLE objects xmlDocUniquePtr pXmlDoc = parseExport(u"Object 1/settings.xml"_ustr); assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaWidth']", u"4516"); @@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf163575) { // crashes/assert at export time createSwDoc("tdf163575.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); } DECLARE_ODFEXPORT_TEST(testTdf159923, "tdf159923.fodt") @@ -571,7 +571,7 @@ DECLARE_ODFEXPORT_TEST(testTdf159923_stretched, "tdf159923_stretched.fodt") CPPUNIT_TEST_FIXTURE(Test, tdf145871) { createSwDoc("tdf145871.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); @@ -586,7 +586,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf145871) CPPUNIT_TEST_FIXTURE(Test, tdf128504) { createSwDoc("tdf128504.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xPara = getParagraph(6); uno::Reference xRun(getRun(xPara,1), uno::UNO_QUERY); OUString unVisitedStyleName = getProperty(xRun, u"UnvisitedCharStyleName"_ustr); @@ -728,7 +728,7 @@ DECLARE_ODFEXPORT_TEST(testPageContentBottom, "page-content-bottom.odt") CPPUNIT_TEST_FIXTURE(Test, tdf124470) { createSwDoc("tdf124470TableAndEmbeddedUsedFonts.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Table styles were exported out of place, inside font-face-decls. // Without the fix in place, this will fail already in ODF validation: // "content.xml[2,2150]: Error: tag name "style:style" is not allowed. Possible tag names are: " diff --git a/sw/qa/extras/odfexport/odfexport3.cxx b/sw/qa/extras/odfexport/odfexport3.cxx index 8edbcd75238e..50427fe9f294 100644 --- a/sw/qa/extras/odfexport/odfexport3.cxx +++ b/sw/qa/extras/odfexport/odfexport3.cxx @@ -93,7 +93,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextboxRoundedCorners) createSwDoc("textbox-rounded-corners.odt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(); // Table inside a textbox should be in the extension namespace. @@ -541,14 +541,14 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) createSwDoc("btlr-frame.odt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testTdf129520) { createSwDoc("tdf129520.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL(u"M"_ustr, getParagraph(1)->getString()); @@ -635,7 +635,7 @@ DECLARE_ODFEXPORT_TEST(testMasterPageWithDrawingPage, "sw_hatch.odt") CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeOOo) { createSwDoc("pagestyle_background_ooo33.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(3, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); // Standard @@ -730,7 +730,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeOOo) CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO64) { createSwDoc("pagestyle_background_lo64.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(6, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); // Standard @@ -912,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO64) CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO70) { createSwDoc("pagestyle_background_lo70.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(6, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); // Standard @@ -1094,7 +1094,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO70) CPPUNIT_TEST_FIXTURE(Test, testFillBitmapUnused) { createSwDoc("fillbitmap3.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(4, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // nav_5f_home and all its references are completely gone @@ -1243,7 +1243,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedPdf) createSwDoc("embedded-pdf.odt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(); uno::Sequence aArgs{ uno::Any(maTempFile.GetURL()) }; @@ -1514,7 +1514,7 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") CPPUNIT_TEST_FIXTURE(Test, testTableStyles3) { createSwDoc("table_styles_3.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); // This test checks if default valued attributes aren't exported. xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -1705,7 +1705,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles4) CPPUNIT_TEST_FIXTURE(Test, testTableStyles5) { createSwDoc("table_styles_5.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Test if cell styles doesn't have a style:parent-style-name attribute. xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -1779,7 +1779,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles5) CPPUNIT_TEST_FIXTURE(Test, testTdf145226) { createSwDoc("tdf145226.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1809,7 +1809,7 @@ DECLARE_ODFEXPORT_TEST(testTdf101710, "tdf101710.odt") CPPUNIT_TEST_FIXTURE(Test, testTdf129568) { createSwDoc("tdf129568.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Test that export doesn't fail, and that style is imported and in use. uno::Reference xStyle( getStyles(u"CellStyles"_ustr)->getByName(u"Default Style.1"_ustr), uno::UNO_QUERY); @@ -1820,7 +1820,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129568) CPPUNIT_TEST_FIXTURE(Test, testTdf129568ui) { createSwDoc("tdf129568-ui.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Same as above, but styles referenced by UI name. uno::Reference xStyle( getStyles(u"CellStyles"_ustr)->getByName(u"Default Style.1"_ustr), uno::UNO_QUERY); @@ -1831,7 +1831,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129568ui) CPPUNIT_TEST_FIXTURE(Test, testTdf164712) { createSwDoc("tdf164712.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); auto xText = getParagraph(1)->getText(); CPPUNIT_ASSERT(xText.is()); auto xCursor(xText->createTextCursorByRange(getParagraph(1))); @@ -1918,7 +1918,7 @@ DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-numbering.docx") CPPUNIT_TEST_FIXTURE(Test, testImageMimetype) { createSwDoc("image-mimetype.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Test that the loext:mimetype attribute is written for exported images, tdf#109202 diff --git a/sw/qa/extras/odfexport/odfexport4.cxx b/sw/qa/extras/odfexport/odfexport4.cxx index 8c1599e073bf..45cccd53f3e1 100644 --- a/sw/qa/extras/odfexport/odfexport4.cxx +++ b/sw/qa/extras/odfexport/odfexport4.cxx @@ -50,7 +50,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, tdf135942) { createSwDoc("nestedTableInFooter.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // All table autostyles should be collected, including nested, and must not crash. CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -67,7 +67,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf150927) // Similar to tdf135942 createSwDoc("table-in-frame-in-table-in-header-base.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // All table autostyles should be collected, including nested, and must not crash. CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) pBatch->commit(); createSwDoc("personalmetadata.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"meta.xml"_ustr); assertXPath(pXmlDoc, "/office:document-meta/office:meta/meta:initial-creator", 1); assertXPath(pXmlDoc, "/office:document-meta/office:meta/meta:creation-date", 1); @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) pBatch->commit(); createSwDoc("personalmetadata.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pXmlDoc = parseExport(u"meta.xml"_ustr); assertXPath(pXmlDoc, "/office:document-meta/office:meta/meta:initial-creator", 0); assertXPath(pXmlDoc, "/office:document-meta/office:meta/meta:creation-date", 0); @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) { // 1. Check we have the original edit time info createSwDoc("personalmetadata.odt"); - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"meta.xml"_ustr); assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/meta:editing-duration", u"PT21M22S"); @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) // 2. Check edit time info is 0 createSwDoc("personalmetadata.odt"); - save(u"writer8"_ustr); + save(TestFilter::ODT); pXmlDoc = parseExport(u"meta.xml"_ustr); assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/meta:editing-duration", u"P0D"); @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf151100) // Similar to tdf135942 createSwDoc("tdf151100.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // All table autostyles should be collected, including nested, and must not crash. CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -273,7 +273,7 @@ DECLARE_ODFEXPORT_TEST(testTdf143793_noBodyWrapping, "tdf143793_noBodyWrapping.o CPPUNIT_TEST_FIXTURE(Test, testTdf137199) { createSwDoc("tdf137199.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(u">1<"_ustr, getProperty(getParagraph(1), u"ListLabelString"_ustr)); @@ -299,7 +299,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165115) { // Test saving a template file with password protection createSwDoc(); - saveAndReload("writer8_template", "test"); + saveAndReload(TestFilter::OTT, "test"); } CPPUNIT_TEST_FIXTURE(Test, testTdf57317_autoListName) @@ -317,7 +317,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf57317_autoListName) // This was failing with a duplicate auto numbering style name of L1 instead of a unique name, // thus it was showing the same info as before the bullet modification. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xPara.set(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u""_ustr, getProperty(xPara, u"ListLabelString"_ustr)); @@ -336,7 +336,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf57317_autoListName) CPPUNIT_TEST_FIXTURE(Test, testListFormatDocx) { createSwDoc("listformat.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Ensure in resulting ODT we also have not just prefix/suffix, but custom delimiters CPPUNIT_ASSERT_EQUAL(u">1<"_ustr, getProperty(getParagraph(1), u"ListLabelString"_ustr)); @@ -392,7 +392,7 @@ CPPUNIT_TEST_FIXTURE(Test, testListFormatDocx) CPPUNIT_TEST_FIXTURE(Test, testShapeWithHyperlink) { createSwDoc("shape-with-hyperlink.odt"); - save(u"writer8"_ustr); + save(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -443,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(Test, testListFormatOdt) createSwDoc("listformat.odt"); verify(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -524,7 +524,7 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleLink) CPPUNIT_TEST_FIXTURE(Test, tdf120972) { createSwDoc("table_number_format_3.docx"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); OUString cDecimal(SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]); @@ -831,7 +831,7 @@ DECLARE_ODFEXPORT_TEST(testTdf78510, "WordTest_edit.odt") CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkerMarkupRoundtrip) { createSwDoc("ParagraphMarkerMarkup.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Test that the markup stays at save-and-reload xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); OUString autostyle = getXPath(pXmlDoc, "//office:body/office:text/text:p", "marker-style-name"); @@ -856,7 +856,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentStyles) xComment->attach(getParagraph(1)->getEnd()); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); auto xFields( mxComponent.queryThrow()->getTextFields()->createEnumeration()); @@ -882,7 +882,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentStyles) CPPUNIT_TEST_FIXTURE(Test, testTdf150408_IsLegal) { createSwDoc("IsLegal.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Second level's numbering should use Arabic numbers for first level reference auto xPara = getParagraph(1); @@ -926,7 +926,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159382) CPPUNIT_ASSERT_LESS(sal_Int32(100), width); // It was 720, i.e. 0.5 inch } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // 2. Make sure that exported document has NoGapAfterNoteNumber option set, // and has correct layout { @@ -1006,7 +1006,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159438) // Given a text with bookmarks, where an end of one bookmark is the position of another, // and the start of a third createSwDoc("bookmark_order.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); auto xPara = getParagraph(1); // Check that the order of runs is correct (bookmarks don't overlap) @@ -1095,7 +1095,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160700) { // Given a document with an empty numbered paragraph, and a cross-reference to it createSwDoc("tdf160700.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Refresh fields and ensure cross-reference to numbered para is okay auto xTextFieldsSupplier(mxComponent.queryThrow()); @@ -1128,7 +1128,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160253_ordinary_numbering) // Before the fix, this already failed with // Error: "list2916587379" is referenced by an IDREF, but not defined. createSwDoc("tdf160253_ordinary_numbering.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Make sure that the fourth paragraph has correct number - it was "1." before the fix CPPUNIT_ASSERT_EQUAL(u"3."_ustr, @@ -1149,7 +1149,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160253_outline_numbering) // Before the fix, this already failed with // Error: "list2916587379" is referenced by an IDREF, but not defined. createSwDoc("tdf160253_outline_numbering.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Make sure that the third paragraph has correct number - it was "1" before the fix CPPUNIT_ASSERT_EQUAL(u"2"_ustr, @@ -1166,7 +1166,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableInFrameAnchoredToPage) // Given a table in a frame anchored to a page: // it must not assert on export because of missing format for an exported table createSwDoc("table_in_frame_to_page.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); auto AutoStyleUsedIn = [this, &pXmlDoc](const OString& path, const char* attr) -> OString { @@ -1192,7 +1192,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDeletedTableAutostylesExport) // Given a document with deleted table: // it must not assert on export because of missing format for an exported table createSwDoc("deleted_table.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); } DECLARE_ODFEXPORT_TEST(testTdf160877, "tdf160877.odt") @@ -1216,7 +1216,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMidnightRedlineDatetime) // - Error: "2001-01-01" does not satisfy the "dateTime" type // because "2001-01-01T00:00:00" became "2001-01-01" on roundtrip. createSwDoc("midnight_redline.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPathContent(pXmlDoc, @@ -1230,7 +1230,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122452) // FIXME: Error: element "text:insertion" was found where no element may occur skipValidation(); createSwDoc("tdf122452.doc"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); // Without the fix in place this fails with: @@ -1243,7 +1243,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122452) CPPUNIT_TEST_FIXTURE(Test, testTdf159027) { createSwDoc("tdf159027.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); SwDoc* pDoc = getSwDoc(); pDoc->getIDocumentFieldsAccess().UpdateFields(true); @@ -1273,7 +1273,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121119) CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xIndexAccess->getCount()); - saveAndReload(u"writerglobal8_writer"_ustr); + saveAndReload(TestFilter::ODM); pDoc = getSwDoc(); CPPUNIT_ASSERT_EQUAL( @@ -1315,7 +1315,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf163703) { // Given a document with italics autostyle in a comment createSwDoc("italics-in-comment.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); auto xFields( mxComponent.queryThrow()->getTextFields()->createEnumeration()); @@ -1364,7 +1364,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf36709) { // Verifies that loext:text-indent correctly round-trips createSwDoc("tdf36709.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1391,7 +1391,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf163913) { // Verifies that loext:left-margin and loext:right-margin correctly round-trip createSwDoc("tdf163913.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1470,7 +1470,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMsWordUlTrailSpace) CPPUNIT_ASSERT_EQUAL(u"false"_ustr, val); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // 2. Make sure that exported document has MsWordUlTrailSpace option set { xmlDocUniquePtr pXmlDoc = parseExport(u"settings.xml"_ustr); @@ -1511,7 +1511,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMsWordUlTrailSpace) CPPUNIT_ASSERT_EQUAL(u"false"_ustr, val); } - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // 4. Make sure that exported document has MsWordUlTrailSpace option not set { xmlDocUniquePtr pXmlDoc = parseExport(u"settings.xml"_ustr); @@ -1552,7 +1552,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf71583) { // Verifies that loext:text-indent correctly round-trips createSwDoc("tdf71583.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPathNodeName(pXmlDoc, "//office:body/office:text/text:p/*[1]", "page-count-range"); } @@ -1561,7 +1561,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166011) { // Verifies that style:script-type correctly round-trips createSwDoc("tdf166011.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1575,7 +1575,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166011ee) { // Verifies that style:script-type correctly round-trips with Edit Engine createSwDoc("tdf166011ee.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1590,7 +1590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf168817) // A ruby text with a hyperlink // Without the fix, it failed an assertion on save, and produced invalid XML that couldn't load createSwDoc("ruby+hyperlink.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // Check that only one instance of respective elements are produced assertXPath(pXmlDoc, "//text:p", 1); @@ -1610,7 +1610,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf164677) // properties, and generated a single section autostyle, so all the sections got identical // properties after reload: createSwDoc("colored-sections-separators.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); auto xTextSections = mxComponent.queryThrow()->getTextSections(); CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTextSections->getElementNames().getLength()); @@ -1670,7 +1670,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf168980) // - com.sun.star.io.IOException: {Message: "SfxBaseModel::impl_store // failed: 0xc10(Error // Area:Io Class:Write Code:16) - saveAndReload(u"OpenDocument Text Flat XML"_ustr); + saveAndReload(TestFilter::FODT); } CPPUNIT_TEST_FIXTURE(Test, testTdf37128ConvertStartEndOnResave) @@ -1679,7 +1679,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf37128ConvertStartEndOnResave) // start/end, respectively. Make sure documents produced by older // versions of LO convert these values to left/right. createSwDoc("tdf37128-start-end-to-left-right.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -1706,7 +1706,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118350StartEndPreserved) // Check that fo:text-align start/end round-trip correctly for // documents made by newer versions of LO. createSwDoc("tdf118350-start-end-preserved.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -1731,7 +1731,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118350StartEndPreserved) CPPUNIT_TEST_FIXTURE(Test, testTdf162120StyleWritingModeAutomaticSerialization) { createSwDoc("tdf162120-style-writing-mode-automatic.fodt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); auto pStylesDoc = parseExport(u"styles.xml"_ustr); assertXPath(pStylesDoc, "//style:paragraph-properties[@style:writing-mode-automatic]", 1); diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index b0866cf087ce..0c583d9ed0d0 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -1335,7 +1335,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVerticallyMergedCellBorder) CPPUNIT_ASSERT(!rA2Set.GetBox().GetRight()); // Given this document model, when exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the covered cell has a style. xmlDocUniquePtr pXmlSettings = parseExport(u"content.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx b/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx index b8be177a2ff3..651c72bf9a79 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx @@ -26,7 +26,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasswordMSO2007) // Standard encryption format, AES 128, SHA1 uno::Reference xParagraph(getParagraph(1)); CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, getParagraph(1)->getString()); - saveAndReload(u"Office Open XML Text"_ustr, sPass); + saveAndReload(TestFilter::DOCX, sPass); CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, getParagraph(1)->getString()); } @@ -36,7 +36,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasswordMSO2010) createSwDoc("Encrypted_MSO2010_abc.docx", sPass); // Agile encryption format, AES 128, CBC, SHA1 CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, getParagraph(1)->getString()); - saveAndReload(u"Office Open XML Text"_ustr, sPass); + saveAndReload(TestFilter::DOCX, sPass); CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, getParagraph(1)->getString()); } @@ -47,7 +47,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasswordMSO2013) // Agile encryption format, AES 256, CBC, SHA512 uno::Reference xParagraph(getParagraph(1)); CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, getParagraph(1)->getString()); - saveAndReload(u"Office Open XML Text"_ustr, sPass); + saveAndReload(TestFilter::DOCX, sPass); CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, getParagraph(1)->getString()); } @@ -58,7 +58,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasswordLOStandard) // Standard encryption format, AES 128, SHA1 uno::Reference xParagraph(getParagraph(1)); CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, getParagraph(1)->getString()); - saveAndReload(u"Office Open XML Text"_ustr, sPass); + saveAndReload(TestFilter::DOCX, sPass); CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, getParagraph(1)->getString()); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 0ca030e2c633..fb8965c5bc24 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -43,7 +43,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testfdo81381) { createSwDoc("fdo81381.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", u"Icon"); } @@ -51,7 +51,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo81381) CPPUNIT_TEST_FIXTURE(Test, testSdtAlias) { createSwDoc("sdt-alias.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // was completely missing. @@ -61,7 +61,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtAlias) CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance) { createSwDoc("footer-body-distance.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Page break was exported as section break, this was 0 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); @@ -84,7 +84,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx") CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder) { createSwDoc("plausable-border.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Page break was exported as section break, this was 0 @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder) CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak) { createSwDoc("unwanted-section-break.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 2: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 1); @@ -105,7 +105,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak) CPPUNIT_TEST_FIXTURE(Test, testfdo80897 ) { createSwDoc("fdo80897.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:prstTxWarp", "prst", u"textTriangle"); } @@ -121,7 +121,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80997, "fdo80997.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo80902) { createSwDoc("fdo80902.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the docGrid type was set as default so fix it for other grid type xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80902) CPPUNIT_TEST_FIXTURE(Test, testParaShading) { createSwDoc("para-shading.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Make sure the themeColor attribute is not written when it would be empty. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", "themeColor"); @@ -140,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaShading) CPPUNIT_TEST_FIXTURE(Test, testFDO83044) { createSwDoc("fdo83044.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:text", 1); @@ -157,7 +157,7 @@ DECLARE_OOXMLEXPORT_TEST(testfdo83428, "fdo83428.docx") CPPUNIT_TEST_FIXTURE(Test, testShapeInFloattable) { createSwDoc("shape-in-floattable.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // No nested drawingML w:txbxContent. assertXPath(pXmlDoc, "//mc:Choice//w:txbxContent//w:txbxContent", 0); @@ -169,7 +169,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeInFloattable) CPPUNIT_TEST_FIXTURE(Test, testEmptyAnnotationMark) { createSwDoc("empty-annotation-mark.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Delete the word that is commented, and save again. uno::Reference xRun = getRun(getParagraph(1), 3); CPPUNIT_ASSERT_EQUAL(u"with"_ustr, xRun->getString()); @@ -242,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDropdownInCell) createSwDoc("dropdown-in-cell.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -258,7 +258,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx") CPPUNIT_TEST_FIXTURE(Test, testSdtIgnoredFooter) { createSwDoc("sdt-ignored-footer.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 1, make sure no w:sdt sneaks into the main document from the footer. assertXPath(pXmlDoc, "//w:sdt", 0); @@ -267,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtIgnoredFooter) CPPUNIT_TEST_FIXTURE(Test, testSdtRunPicture) { createSwDoc("sdt-run-picture.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // SDT around run was exported as SDT around paragraph xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 1: there was an SDT around w:p. @@ -288,7 +288,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChartDupe) createSwDoc("chart-dupe.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDocCT = parseExport(u"[Content_Types].xml"_ustr); @@ -348,7 +348,7 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf106541_noinheritChapterNumbering) { createSwDoc("tdf106541_noinheritChapterNumbering.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // in LO, it appears that styles based on the Chapter Numbering style explicitly set the // numbering style/outline level to 0 by default, and that LO prevents inheriting directly from "Outline" style. @@ -390,7 +390,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104713_undefinedStyles, "tdf104713_undefinedStyl CPPUNIT_TEST_FIXTURE(Test, testDrawingmlFlipv) { createSwDoc("drawingml-flipv.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the shape had vertical flip only, but then we added rotation as well on export. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "rot"); @@ -399,7 +399,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawingmlFlipv) CPPUNIT_TEST_FIXTURE(Test, testRot90Fliph) { createSwDoc("rot90-fliph.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that a shape rotation of 90° got turned into 270° after roundtrip. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//a:xfrm", "flipH", u"1"); @@ -410,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRot90Fliph) CPPUNIT_TEST_FIXTURE(Test, testRot180Flipv) { createSwDoc("rot180-flipv.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // 180° rotation got lost after roundtrip. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//a:xfrm", "flipV", u"1"); @@ -421,7 +421,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRot180Flipv) CPPUNIT_TEST_FIXTURE(Test, testRot270Flipv) { createSwDoc("rot270-flipv.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // 270° rotation got turned into 90° after roundtrip. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//a:xfrm", "flipV", u"1"); @@ -507,7 +507,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxTable, "textbox-table.docx") CPPUNIT_TEST_FIXTURE(Test, testCropPixel) { createSwDoc("crop-pixel.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // If map mode of the graphic is in pixels, then we used to handle original // size of the graphic as mm100, but it was in pixels. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -519,7 +519,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCropPixel) CPPUNIT_TEST_FIXTURE(Test, testEffectExtent) { createSwDoc("effect-extent.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that in case there were no shadows on the picture, we // wrote a full or zeros. xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -530,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEffectExtent) CPPUNIT_TEST_FIXTURE(Test, testEffectExtentInline) { createSwDoc("effect-extent-inline.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that in case there was inline rotated picture, we // wrote a full or zeros. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -590,7 +590,7 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphMark2, "paragraph-mark2.docx") CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkNonempty) { createSwDoc("paragraph-mark-nonempty.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); validate(maTempFile.GetFileName(), u"Office Open XML Text"); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -679,7 +679,7 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlSymbolChicagoList, "symbol_chicago_list.docx") CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHTW) { createSwDoc("numlist-zhtw.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); @@ -689,7 +689,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHTW) CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHCN) { createSwDoc("numlist-zhcn.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); @@ -699,7 +699,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHCN) CPPUNIT_TEST_FIXTURE(Test, testOOxmlOutlineNumberTypes) { createSwDoc("outline-number-types.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); @@ -800,7 +800,7 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin, "effectextent-margin.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf88583) { createSwDoc("tdf88583.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty(getParagraph(1), u"FillStyle"_ustr)); CPPUNIT_ASSERT_EQUAL(Color(0x00cc00), getProperty(getParagraph(1), u"FillColor"_ustr)); @@ -832,7 +832,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89791) uno::Reference< beans::XPropertySet > properties(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Titre"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"Corps de texte"_ustr, getProperty(properties, u"FollowStyle"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); properties.set(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Titre"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"Corps de texte"_ustr, getProperty(properties, u"FollowStyle"_ustr)); @@ -923,7 +923,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf44986, "tdf44986.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf118682) { createSwDoc("tdf118682.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -952,7 +952,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118682) CPPUNIT_TEST_FIXTURE(Test, testTdf133163) { createSwDoc("tdf133163.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -980,7 +980,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133163) CPPUNIT_TEST_FIXTURE(Test, testTdf166102) { createSwDoc("tdf166102.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -1003,7 +1003,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166102) CPPUNIT_TEST_FIXTURE(Test, testTdf133647) { createSwDoc("tdf133647.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep original formula during round-trip @@ -1020,7 +1020,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647) CPPUNIT_TEST_FIXTURE(Test, testTdf123386) { createSwDoc("tdf123386.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep original formula during round-trip @@ -1039,7 +1039,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123386) CPPUNIT_TEST_FIXTURE(Test, testTdf123389) { createSwDoc("tdf123389.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep original formula during round-trip @@ -1067,7 +1067,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094v3) // i.e. some unwanted ~-2mm left margin appeared. CPPUNIT_ASSERT_EQUAL(static_cast(1991), pFormat->GetHoriOrient().GetPos()); } - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // floating table is now exported directly without surrounding frame xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 653b01a15f88..7a884b455426 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -96,14 +96,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSmartart) }; createSwDoc("smartart.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(Test, testFdo69548) { createSwDoc("fdo69548.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The problem was that the last space in target URL was removed CPPUNIT_ASSERT_EQUAL(u"#this_is_a_bookmark"_ustr, getProperty(getRun(getParagraph(1), 1), u"HyperLinkURL"_ustr)); } @@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableNestedDOCXExport) createSwDoc("floattable-nested.odt"); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure both floating table is exported: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -153,7 +153,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableNestedCellStartDOCXExport) createSwDoc("floattable-nested-cell-start.odt"); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure both floating table is exported at the right position: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -275,7 +275,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf162916_nastyTOC, "tdf162916_nastyTOC.docx") CPPUNIT_TEST_FIXTURE(Test, testFontEsc) { createSwDoc("test_tdf120412.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc =parseExport(u"word/document.xml"_ustr); // don't lose the run with superscript formatting assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 2); @@ -430,7 +430,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo73389) { createSwDoc("fdo73389.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The width of the inner table was too large. The first fix still converted // the "auto" table width to a fixed one. The second fix used variable width. // The recent fix uses fixed width again, according to the fixed width cells. @@ -443,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73389) CPPUNIT_TEST_FIXTURE(Test, testTdf133735) { createSwDoc("fdo73389.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:spacing", "after", u"0"); @@ -456,7 +456,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133735) CPPUNIT_TEST_FIXTURE(Test, testTdf134569_nestedTable) { createSwDoc("tdf134569_nestedTable.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // non-overridden w:after spacing in the table was pushing the document to the second page. CPPUNIT_ASSERT_EQUAL(1, getPages()); } @@ -464,7 +464,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134569_nestedTable) CPPUNIT_TEST_FIXTURE(Test, testTdf59274) { createSwDoc("tdf59274.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Table with "auto" table width and incomplete grid: 11 columns, but only 4 gridCol elements. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -621,7 +621,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSmartartStrict) }; createSwDoc("strict-smartart.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -732,7 +732,7 @@ DECLARE_OOXMLEXPORT_TEST(testGridBefore, "gridbefore.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf116194) { createSwDoc("tdf116194.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the importer lost consecutive tables with w:gridBefore xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2); @@ -741,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116194) CPPUNIT_TEST_FIXTURE(Test, testTdf134606) { createSwDoc("tdf134606.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the importer lost the nested table structure with w:gridBefore xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 49d3d17128c1..c4a61db19d73 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -77,7 +77,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90906_colAutoB, "tdf90906_colAutoB.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf92524_autoColor) { createSwDoc("tdf92524_autoColor.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty(getParagraph(1), u"FillStyle"_ustr)); CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty(getParagraph(1), u"ParaBackColor"_ustr)); } @@ -85,7 +85,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92524_autoColor) CPPUNIT_TEST_FIXTURE(Test, testTdf116436_rowFill) { createSwDoc("tdf116436_rowFill.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -103,7 +103,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121665_back2backColumnBreaks, "tdf121665_back2ba CPPUNIT_TEST_FIXTURE(Test, testTdf126795_TabsRelativeToIndent0) { createSwDoc("tdf126795_TabsRelativeToIndent0.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence >(getParagraph( 2 ), u"ParaTabStops"_ustr); CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126795_TabsRelativeToIndent0) CPPUNIT_TEST_FIXTURE(Test, testTdf126795_TabsRelativeToIndent1) { createSwDoc("tdf126795_TabsRelativeToIndent1.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence >(getParagraph( 2 ), u"ParaTabStops"_ustr); CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); @@ -152,7 +152,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124384, "tdf124384.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121456_tabsOffset) { createSwDoc("tdf121456_tabsOffset.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); for (int i=2; i<8; i++) { uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence >(getParagraph( i ), u"ParaTabStops"_ustr); @@ -166,7 +166,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121456_tabsOffset) CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle) { createSwDoc("tdf121456_tabsOffset.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:t", u"Inhaltsverzeichnis"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:instrText", u" TOC \\f \\o \"1-9\" \\h"); @@ -177,7 +177,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle) CPPUNIT_TEST_FIXTURE(Test, testTdf129525) { createSwDoc("tdf129525.rtf"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[4]/w:t", u"Overview"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t", u"3"); @@ -198,7 +198,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitleDocx) { createSwDoc("tdf121456_tabsOffset.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(7, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -255,7 +255,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82065_Ind_start_strict, "tdf82065_Ind_start_stri CPPUNIT_TEST_FIXTURE(Test, testTdf76683_negativeTwipsMeasure) { createSwDoc("tdf76683_negativeTwipsMeasure.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col", 2); sal_uInt32 nColumn1 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]", "w").toUInt32(); @@ -360,7 +360,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf94801, "tdf94801.docx") CPPUNIT_TEST_FIXTURE(Test, testParagraphSplitOnSectionBorder) { createSwDoc("parasplit-on-section-border.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -373,7 +373,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSplitOnSectionBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf44832_testSectionWithDifferentHeader) { createSwDoc("tdf44832_section_new_header.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1); @@ -420,7 +420,7 @@ DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.d CPPUNIT_TEST_FIXTURE(Test, testTdf117805) { createSwDoc("tdf117805.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xNameAccess @@ -471,7 +471,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113547, "tdf113547.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf113399) { createSwDoc("tdf113399.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // 0 padding was not preserved // In LO 0 is the default, but in OOXML format the default is 254 / 127 uno::Reference xPropSet(getShape(1), uno::UNO_QUERY); @@ -548,7 +548,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142542_cancelledAutospacing, "tdf142542_cancelle CPPUNIT_TEST_FIXTURE(Test, testTdf137655) { createSwDoc("tdf137655.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 280. assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", u"0"); @@ -594,7 +594,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_firstParaInSection, "tdf104354_firstParaI CPPUNIT_TEST_FIXTURE(Test, testPageBreak_after) { createSwDoc("pageBreak_after.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The problem was that the page breakAfter put the empty page BEFORE the table xmlDocUniquePtr pDump = parseLayoutDump(); assertXPath(pDump, "/root/page[1]/body/tab", 1); @@ -722,7 +722,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119760_positionCellBorder, "tdf119760_positionCe CPPUNIT_TEST_FIXTURE(Test, testTdf98620_environmentBiDi) { createSwDoc("tdf98620_environmentBiDi.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty( getParagraph(1), u"WritingMode"_ustr )); CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_RIGHT), getProperty( getParagraph(1), u"ParaAdjust"_ustr )); @@ -871,7 +871,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149996, "lorem_hyperlink.fodt") CPPUNIT_TEST_FIXTURE(Test, testGroupedShapeLink) { createSwDoc("grouped_link.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#145147 Hyperlink in grouped shape not imported // tdf#154469 Hyperlink in grouped shape not exported uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index fe50033e7252..25a2507196a9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -33,7 +33,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTableCrossReference) { createSwDoc("table_cross_reference.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // MSO uses simple bookmarks for referencing table caption, so we do the same by export @@ -206,7 +206,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCrossReference) CPPUNIT_TEST_FIXTURE(Test, testTableCrossReferenceCustomFormat) { createSwDoc("table_cross_reference_custom_format.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // Check also captions with custom formatting @@ -340,7 +340,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCrossReferenceCustomFormat) CPPUNIT_TEST_FIXTURE(Test, testObjectCrossReference) { createSwDoc("object_cross_reference.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(10, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); // tdf#42346: Cross references to objects were not saved @@ -731,14 +731,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTd112202) createSwDoc("090716_Studentische_Arbeit_VWS.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields) { createSwDoc("tdf79435_legacyInputFields.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); //using .doc input file to verify cross-format compatibility. uno::Reference xFormField = getProperty>( getRun(getParagraph(5), 3), u"Bookmark"_ustr); @@ -888,7 +888,7 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx") CPPUNIT_TEST_FIXTURE(Test, testVMLShapetypeId) { createSwDoc("controlshape.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // must be _x0000_t assertXPath(pXmlDoc, @@ -906,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLShapetypeId) CPPUNIT_TEST_FIXTURE(Test, testTdf73547) { createSwDoc("tdf73547-dash.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); double nD = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "d").toDouble(); CPPUNIT_ASSERT_DOUBLES_EQUAL(105000.0, nD, 5000.0); // was 100000 @@ -936,7 +936,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf105444) { createSwDoc("tdf105444.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlComm = parseExport(u"word/comments.xml"_ustr); // there is no extra paragraph on Win32, only a single one. assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1); @@ -961,7 +961,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117137, "tdf117137.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf138780) { createSwDoc("tdf138780.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Paragraphs were not part of a numbering anymore after roundtrip. uno::Reference xPara1(getParagraph(1), uno::UNO_QUERY); @@ -980,7 +980,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138780) CPPUNIT_TEST_FIXTURE(Test, testTdf134618) { createSwDoc("tdf134618.doc"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); //Without the fix it in place, it would have failed with @@ -994,7 +994,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134618) CPPUNIT_TEST_FIXTURE(Test, testTdf99631) { createSwDoc("tdf99631.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:object", 2); @@ -1010,7 +1010,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99631) CPPUNIT_TEST_FIXTURE(Test, testTdf138899) { createSwDoc("tdf138899.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This was 6, not removed empty temporary paragraph at the end of the section assertXPath(pXmlDocument, "/w:document/w:body/w:p", 5); @@ -1022,7 +1022,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138899) CPPUNIT_TEST_FIXTURE(Test, testTdf122563) { createSwDoc("tdf122563.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1); @@ -1034,7 +1034,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122563) CPPUNIT_TEST_FIXTURE(Test, testTdf94628) { createSwDoc("tdf94628.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xPropertySet( getStyles(u"NumberingStyles"_ustr)->getByName(u"WWNum1"_ustr), uno::UNO_QUERY); uno::Reference xLevels( @@ -1113,7 +1113,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx") CPPUNIT_TEST_FIXTURE(Test, testLanguageInGroupShape) { createSwDoc("tdf131922_LanguageInGroupShape.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#131922: Check if good language is used in shape group texts xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); assertXPath(pXml, @@ -1172,7 +1172,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116883, "tdf116883.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf131420) { createSwDoc("tdf131420.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:pPr/w:pBdr/w:top"); } @@ -1245,7 +1245,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145720) { // check moveFromRangeStart/End and moveToRangeStart/End (to keep tracked text moving) createSwDoc("tdf104797.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 0 (missing move*FromRange* elements) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]//w:moveFromRangeStart", 1); @@ -1271,7 +1271,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150166) { // check moveFromRangeStart/End and moveToRangeStart/End (to keep tracked text moving) createSwDoc("tdf150166.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:moveFromRangeStart", 0); // This was 2 (missing RangeStart elements, but bad unpaired RangeEnds) @@ -1291,7 +1291,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table move by drag & drop createSwDoc("TC-table-DnD-move.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 2); @@ -1302,7 +1302,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510_table_from_row) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table move by drag & drop createSwDoc("TC-table-Separate-Move.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 1); @@ -1315,7 +1315,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510_within_table) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table row move by DnD createSwDoc("TC-table-rowDND.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:del", 1); @@ -1326,7 +1326,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143510_within_table2) { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table row move by DnD createSwDoc("TC-table-rowDND-front.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1); @@ -1337,7 +1337,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150824) { // check tracked table row insertion (stored in a single redline) createSwDoc("tdf150824.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1); @@ -1349,7 +1349,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157011) { // check tracked table column insertions and deletions with empty cells createSwDoc("tdf157011_ins_del_empty_cols.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 1 (missing tracked table cell insertions) @@ -1413,7 +1413,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119188_list_margin_in_cell, "tdf119188_list_marg CPPUNIT_TEST_FIXTURE(Test, testChart_BorderLine_Style) { createSwDoc("Chart_BorderLine_Style.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* DOCX containing Chart with BorderLine Style as Dash Type should get preserved * inside an XML tag with value "dash", "sysDot, "lgDot", etc. */ @@ -1432,7 +1432,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChart_BorderLine_Style) CPPUNIT_TEST_FIXTURE(Test, testChart_Plot_BorderLine_Style) { createSwDoc("Chart_Plot_BorderLine_Style.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* DOCX containing Chart wall (plot area) and Chart Page with BorderLine Style as Dash Type * should get preserved inside an XML tag with value "dash", "sysDot, "lgDot", etc. */ @@ -1445,7 +1445,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChart_Plot_BorderLine_Style) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedEmptyParagraph) { createSwDoc("testTrackChangesDeletedEmptyParagraph.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:del"); } @@ -1453,7 +1453,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedEmptyParagraph) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesEmptyParagraphsInADeletion) { createSwDoc("testTrackChangesEmptyParagraphsInADeletion.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); for (int i = 1; i < 12; ++i) assertXPath(pXmlDoc, @@ -1463,7 +1463,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesEmptyParagraphsInADeletion) CPPUNIT_TEST_FIXTURE(Test, testTdf149708) { createSwDoc("tdf149708.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // keep tracked insertion of a list item // This was 0 (missing tracked insertion of the paragraph mark) @@ -1473,7 +1473,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149708) CPPUNIT_TEST_FIXTURE(Test, testTdf149707) { createSwDoc("tdf149711.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveFrom"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:moveTo"); @@ -1485,7 +1485,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149707) CPPUNIT_TEST_FIXTURE(Test, testTdf70234) { createSwDoc("tdf70234.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import field with tracked deletion assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r[1]/w:fldChar"); @@ -1500,7 +1500,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf70234) CPPUNIT_TEST_FIXTURE(Test, testTdf115212) { createSwDoc("tdf115212.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export field with tracked deletion assertXPath(pXmlDoc, "//w:p[2]/w:del[1]/w:r[1]/w:fldChar"); @@ -1509,7 +1509,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115212) CPPUNIT_TEST_FIXTURE(Test, testTdf126243) { createSwDoc("tdf120338.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export change tracking rejection data for tracked paragraph style change assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pPrChange/w:pPr/w:pStyle", "val", @@ -1519,7 +1519,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126243) CPPUNIT_TEST_FIXTURE(Test, testTdf126245) { createSwDoc("tdf126245.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export change tracking rejection data for tracked numbering change assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange/w:pPr/w:numPr/w:numId", "val", @@ -1529,7 +1529,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126245) CPPUNIT_TEST_FIXTURE(Test, testTdf124491) { createSwDoc("tdf124491.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import format change of empty lines, FIXME: change w:r with w:pPr in export assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/*/w:rPr/w:rPrChange"); @@ -1541,7 +1541,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124491) CPPUNIT_TEST_FIXTURE(Test, testTdf143911) { createSwDoc("tdf126206.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // export format change of text portions assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange"); @@ -1552,7 +1552,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143911) CPPUNIT_TEST_FIXTURE(Test, testTdf105485) { createSwDoc("tdf105485.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking of deleted comments assertXPath(pXmlDoc, "//w:del/w:r/w:commentReference"); @@ -1561,7 +1561,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105485) CPPUNIT_TEST_FIXTURE(Test, testTdf125894) { createSwDoc("tdf125894.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in frames assertXPath(pXmlDoc, "//w:del", 2); @@ -1572,7 +1572,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149388) { // see also testTdf132371 createSwDoc("tdf132271.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables // (don't recognize tracked text moving during the import, @@ -1587,7 +1587,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132271) { // see also testTdf149388 createSwDoc("tdf149388.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del", 2); @@ -1600,7 +1600,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149388_fly) { // see also testTdf136667 createSwDoc("tdf136667.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del", 2); @@ -1613,7 +1613,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136667) { // see also testTdf149388_fly createSwDoc("tdf149388_fly.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del", 2); @@ -1625,7 +1625,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136667) CPPUNIT_TEST_FIXTURE(Test, testTdf136850) { createSwDoc("tdf136850.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // import change tracking in floating tables assertXPath(pXmlDoc, "//w:del"); @@ -1634,7 +1634,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136850) CPPUNIT_TEST_FIXTURE(Test, testTdf128156) { createSwDoc("tdf128156.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // keep tracked insertion of a paragraph // This was 0 before 350972a8bffc1a74b531e0336954bf54b1356025, @@ -1645,7 +1645,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128156) CPPUNIT_TEST_FIXTURE(Test, testTdf165330) { createSwDoc("CT-with-frame.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // check that *both* tracked changes were round tripped @@ -1656,7 +1656,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165330) CPPUNIT_TEST_FIXTURE(Test, testTdf125546) { createSwDoc("tdf125546.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // compress redlines (it was 15) assertXPath(pXmlDoc, "//w:rPrChange", 3); @@ -1665,7 +1665,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125546) CPPUNIT_TEST_FIXTURE(Test, testLabelWidthAndPosition_Left_FirstLineIndent) { createSwDoc("Hau_min_list2.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // list is LABEL_WIDTH_AND_POSITION with SvxAdjust::Left // I) LTR @@ -1769,7 +1769,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLabelWidthAndPosition_Left_FirstLineIndent) CPPUNIT_TEST_FIXTURE(Test, testTdf124604) { createSwDoc("tdf124604.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // If the numbering comes from a base style, indentation of the base style has also priority. assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", u"0"); @@ -1778,7 +1778,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124604) CPPUNIT_TEST_FIXTURE(Test, testTdf95374) { createSwDoc("tdf95374.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Numbering disabled by non-existent numId=0, disabling also inheritance of indentation of parent styles assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", u"0"); @@ -1854,7 +1854,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81100) }; createSwDoc("tdf81100.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); @@ -1866,7 +1866,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81100) CPPUNIT_TEST_FIXTURE(Test, testTdf88496) { createSwDoc("tdf88496.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Switch off repeating header, there is no place for it. // Now there are only 3 pages with complete table content // instead of a 51-page long table only with header. @@ -1884,7 +1884,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88496) CPPUNIT_TEST_FIXTURE(Test, testTdf77417) { createSwDoc("tdf77417.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // MSO 2010 compatibility mode: terminating white spaces are ignored in tables. // This was 3 pages with the first invisible blank page. CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -1893,7 +1893,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77417) CPPUNIT_TEST_FIXTURE(Test, testTdf130494) { createSwDoc("tdf130494.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", u"yellow"); @@ -1904,7 +1904,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130494) CPPUNIT_TEST_FIXTURE(Test, testTdf130690) { createSwDoc("tdf130690.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", u"yellow"); @@ -1916,7 +1916,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130690) CPPUNIT_TEST_FIXTURE(Test, testTdf105215) { createSwDoc("tdf105215.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts", "ascii", u"Linux Libertine G"); @@ -1938,7 +1938,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105215) CPPUNIT_TEST_FIXTURE(Test, testTdf135187) { createSwDoc("tdf135187.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 0); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 1); @@ -1959,7 +1959,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135187) CPPUNIT_TEST_FIXTURE(Test, testTdf136617) { createSwDoc("tdf136617.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This was 2 CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -1972,7 +1972,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136617) CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs) { createSwDoc("tdf121597.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1988,7 +1988,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs) CPPUNIT_TEST_FIXTURE(Test, testTdf141660) { createSwDoc("tdf141660.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -2001,7 +2001,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141660) CPPUNIT_TEST_FIXTURE(Test, testTdf133643) { createSwDoc("tdf133643.doc"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -2054,7 +2054,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116084, "tdf116084.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf116084_anonymized) { createSwDoc("tdf116084.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", u"must"); @@ -2081,7 +2081,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121176, "tdf121176.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121176_anonymized) { createSwDoc("tdf121176.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", u"must"); @@ -2100,7 +2100,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121176_anonymized) CPPUNIT_TEST_FIXTURE(Test, testTdf128913) { createSwDoc("tdf128913.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:ins and w:del are imported correctly, if they contain only inline images assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:inline/a:graphic"); @@ -2110,7 +2110,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128913) CPPUNIT_TEST_FIXTURE(Test, testTdf142700) { createSwDoc("tdf142700.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:ins and w:del are imported correctly, if they contain only images anchored to character assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:anchor/a:graphic"); @@ -2120,7 +2120,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142700) CPPUNIT_TEST_FIXTURE(Test, testTdf142387) { createSwDoc("tdf142387.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly (only w:del was exported) assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", u"inserts "); @@ -2129,7 +2129,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142387) CPPUNIT_TEST_FIXTURE(Test, testTdf147892) { createSwDoc("tdf147892.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:del in w:ins is exported correctly // (both w:del and w:ins were exported for para marker) @@ -2181,7 +2181,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD_DATABASE, "tdf67207.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf101122_noFillForCustomShape) { createSwDoc("tdf101122_noFillForCustomShape.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#101122 check whether the "F" (noFill) option has been exported to docx @@ -2205,7 +2205,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf101122_noFillForCustomShape) CPPUNIT_TEST_FIXTURE(Test, testTdf124678_case1) { createSwDoc("tdf124678_no_leading_paragraph.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", u""_ustr, @@ -2222,7 +2222,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124678_case1) CPPUNIT_TEST_FIXTURE(Test, testTdf124678_case2) { createSwDoc("tdf124678_with_leading_paragraph.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", u""_ustr, @@ -2357,7 +2357,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119952_negativeMargins) createSwDoc("tdf119952_negativeMargins.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 47492d519a3f..383e3776916a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -39,7 +39,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testFlyInFly) { createSwDoc("ooo39250-1-min.rtf"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check that anchor of text frame is in other text frame uno::Reference const xAnchored(getShape(3), uno::UNO_QUERY); CPPUNIT_ASSERT(xAnchored.is()); @@ -110,7 +110,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf155690, "tdf155690.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF) { createSwDoc("tdf121374_sectionHF.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xPageStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); uno::Reference xFooterText = getProperty< uno::Reference >(xPageStyle, u"FooterText"_ustr); CPPUNIT_ASSERT_EQUAL( u"footer"_ustr, xFooterText->getString() ); @@ -122,7 +122,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF) CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF2) { createSwDoc("tdf121374_sectionHF2.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xPageStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); uno::Reference xHeaderText = getProperty< uno::Reference >(xPageStyle, u"HeaderText"_ustr); CPPUNIT_ASSERT( xHeaderText->getString().startsWith("virkamatka-anomus") ); @@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF2) CPPUNIT_TEST_FIXTURE(Test, testTdf121666_lostPage) { createSwDoc("tdf121666_lostPage.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", u"page"); // The second page break is exported too. @@ -154,13 +154,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf140182_extraPagebreak, "tdf140182_extraPagebreak CPPUNIT_TEST_FIXTURE(Test, testTdf121659_loseColumnBrNextToShape) { createSwDoc("tdf121659_loseColumnBrNextToShape.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The third paragraph contains a manual column break and a shape. // The column break was moved into the shape during the first import // (messing also the shape position), and eliminated during the second import, // losing the 2-column text layout. As a workaround, split the paragraph // moving the column break into the fourth paragraph instead of losing it. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); bool bBreakOnPara3 = getProperty(getParagraph(3), u"BreakType"_ustr) == style::BreakType_COLUMN_BEFORE; bool bBreakOnPara4 = getProperty(getParagraph(4), u"BreakType"_ustr) == style::BreakType_COLUMN_BEFORE; CPPUNIT_ASSERT(bBreakOnPara3 || bBreakOnPara4); @@ -374,7 +374,7 @@ DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf127316_autoEscapement) { createSwDoc("tdf127316_autoEscapement.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // This should be roughly .8*35% of the ORIGINAL(non-reduced) size. However, during export the // proportional height has to be changed into direct formatting, which then changes the relative percent. @@ -418,7 +418,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript, "tdf99602_charStyleSub CPPUNIT_TEST_FIXTURE(Test, testTdf99602_charStyleSubscript2) { createSwDoc("tdf99602_charStyleSubscript2.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // *_In styles_*, don't let the proportionality/escapement affect the fontsize - otherwise it starts doubling up, // so instead just throw away the values and use the default settings instead - meaning fontsize is unaffected. @@ -531,7 +531,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle2, "tdf118947_tableStyle2.docx" CPPUNIT_TEST_FIXTURE(Test, tdf123912_protectedForm) { createSwDoc("tdf123912_protectedForm.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); SwDoc* pDoc = getSwDoc(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Compatibility: Protect form", true, @@ -556,7 +556,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf124600b, "tdf124600b.docx") CPPUNIT_TEST_FIXTURE(Test, testDateControl) { createSwDoc("empty-date-control.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Check that we exported the empty date control correctly // Date form field is converted to date content control. @@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateControl) CPPUNIT_TEST_FIXTURE(Test, testTdf121867) { createSwDoc("tdf121867.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); SwEditShell* pEditShell = getSwDocShell()->GetEditShell(); CPPUNIT_ASSERT(pEditShell); @@ -629,7 +629,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInputListExport) uno::Reference xServiceInfo(aField, uno::UNO_QUERY); CPPUNIT_ASSERT(xServiceInfo->supportsService(u"com.sun.star.text.textfield.DropDown"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextPortion(getRun(getParagraph(1), 1), uno::UNO_QUERY); OUString aPortionType; @@ -666,7 +666,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123435, "tdf123435.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf116371) { createSwDoc("tdf116371.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure the rotation is exported correctly, and size not distorted @@ -680,7 +680,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116371) CPPUNIT_TEST_FIXTURE(Test, testFrameSizeExport) { createSwDoc("floating-tables-anchor.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Make sure the table width is 4000 xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW", "w", u"4000"); @@ -727,7 +727,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") CPPUNIT_TEST_FIXTURE(Test, testTextInput) { createSwDoc("textinput.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -828,14 +828,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123460) createSwDoc("tdf123460.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testTdf146140) { createSwDoc("tdf123460.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -852,7 +852,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146140) CPPUNIT_TEST_FIXTURE(Test, testTdf125298) { createSwDoc("tdf125298_crossreflink_nonascii_charlimit.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // check whether test file keeps non-ascii values or not OUString bookmarkName1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart[1]", "name"); @@ -898,7 +898,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTbrlFrameVml) // 4', i.e. writing direction was inherited from page, instead of explicit tbrl. CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL, nActual); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xTextFrame.set(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xTextFrame.is()); @@ -910,7 +910,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTbrlFrameVml) CPPUNIT_TEST_FIXTURE(Test, testTdf119037) { createSwDoc("tdf119037.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -969,7 +969,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119037) CPPUNIT_TEST_FIXTURE(Test, testTdf125657) { createSwDoc("tdf125657.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); auto checkAttrIsInt = [&](const char* sAttrName) { @@ -1004,7 +1004,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf78657) { createSwDoc("tdf78657_picture_hyperlink.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); xmlDocUniquePtr pXmlRels = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick", 1); @@ -1015,7 +1015,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78657) CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) { createSwDoc("btlr-frame.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); @@ -1029,7 +1029,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) CPPUNIT_TEST_FIXTURE(Test, testTdf125518) { createSwDoc("tdf125518.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(4, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1072,7 +1072,7 @@ DECLARE_OOXMLEXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf131594) { createSwDoc("tdf131594.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // lnNumType should not be exported if w:countBy="0" assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType", 0); @@ -1081,7 +1081,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131594) CPPUNIT_TEST_FIXTURE(Test, testTdf121663) { createSwDoc("tdf121663.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // auto distance of line numbering is 0.5 cm assertXPath(pXmlDoc, "//w:lnNumType", "distance", u"283"); @@ -1197,7 +1197,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf127116) { createSwDoc("tdf127116.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1210,7 +1210,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127116) CPPUNIT_TEST_FIXTURE(Test, testTdf127339) { createSwDoc("tdf127339.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlRels = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='#bookmark']", "TargetMode"); @@ -1219,7 +1219,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127339) CPPUNIT_TEST_FIXTURE(Test, testTdf127362) { createSwDoc("tdf127362.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1234,7 +1234,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127362) CPPUNIT_TEST_FIXTURE(Test, testTdf127605) { createSwDoc("tdf127605.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1247,7 +1247,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127605) CPPUNIT_TEST_FIXTURE(Test, testTdf127732) { createSwDoc("internal_hyperlink_frame.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1260,7 +1260,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127732) CPPUNIT_TEST_FIXTURE(Test, testTdf127733) { createSwDoc("internal_hyperlink_ole.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1274,7 +1274,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127733) CPPUNIT_TEST_FIXTURE(Test, testTdf127734) { createSwDoc("internal_hyperlink_region.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1286,7 +1286,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127734) CPPUNIT_TEST_FIXTURE(Test, testTdf127735) { createSwDoc("internal_hyperlink_table.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1298,7 +1298,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127735) CPPUNIT_TEST_FIXTURE(Test, testTdf123628) { createSwDoc("tdf123628.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1321,7 +1321,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSizeImport) { createSwDoc("tdf142693_hugePaperSizeImport.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", u"90369"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", u"104372"); @@ -1330,7 +1330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSizeImport) CPPUNIT_TEST_FIXTURE(Test, testTdf127925) { createSwDoc("tdf127925.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='FollowedHyperlink']/w:name", "val", u"FollowedHyperlink"); @@ -1339,7 +1339,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127925) CPPUNIT_TEST_FIXTURE(Test, testTdf127579) { createSwDoc("tdf127579.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", u"Hyperlink"); @@ -1348,7 +1348,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127579) CPPUNIT_TEST_FIXTURE(Test, testTdf128304) { createSwDoc("tdf128304.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(4, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); css::text::WritingMode eMode; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 21341e3284f2..8e5439aa4fb6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -84,7 +84,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128197) CPPUNIT_TEST_FIXTURE(Test, testTdf135595_HFtableWrap) { createSwDoc("tdf135595_HFtableWrap.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nRowHeight = getXPath(pXmlDoc, "//page[1]/header/tab/row/infos/bounds", "height").toInt32(); // tdf#77794: always force bLayoutInCell from false to true for MSO2013+ @@ -161,7 +161,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123622, "tdf123622.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf78749) { createSwDoc("tdf78749.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); //Shape lost the background image before, now check if it still has... auto xShape = getShape(1); uno::Reference xShpProps(xShape, uno::UNO_QUERY); @@ -173,7 +173,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78749) CPPUNIT_TEST_FIXTURE(Test, testTdf128207) { createSwDoc("tdf128207.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //There was the charts on each other, because their horizontal and vertical position was 0! xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(p_XmlDoc); @@ -183,7 +183,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128207) CPPUNIT_TEST_FIXTURE(Test, testTdf123873) { createSwDoc("tdf123873.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //OLE Object were overlapped due to missing wrap import xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(p_XmlDoc); @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123873) CPPUNIT_TEST_FIXTURE(Test, Tdf133065) { createSwDoc("tdf133065.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(7, getShapes()); CPPUNIT_ASSERT_EQUAL(3, getPages()); auto pxmldoc = parseExport(u"word/document.xml"_ustr); @@ -235,7 +235,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130814model, "tdf130814.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf107020) { createSwDoc("tdf107020.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); if (!IsDefaultDPI()) return; xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); @@ -253,7 +253,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107020) CPPUNIT_TEST_FIXTURE(Test, testTdf130814ooxml) { createSwDoc("tdf130814.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(p_XmlDoc); assertXPath( @@ -303,7 +303,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129888dml, "tdf129888dml.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf130120) { createSwDoc("tdf130120.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Text for exporting the allowincell attribute: xmlDocUniquePtr p_XmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(p_XmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/" @@ -313,7 +313,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130120) CPPUNIT_TEST_FIXTURE(Test, Tdf133030) { createSwDoc("tdf133030.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); auto pExport = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pExport); @@ -393,7 +393,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) uno::UNO_QUERY); xTextContentAppend->appendTextContent(xFootnote, {}); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: @@ -421,7 +421,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote) uno::UNO_QUERY); xTextContentAppend->appendTextContent(xFootnote, {}); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: @@ -433,7 +433,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote) CPPUNIT_TEST_FIXTURE(Test, testListNotCountedIndent) { createSwDoc("list_notcounted_indent.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId", "val", u"0"); // wrong: 720 @@ -471,7 +471,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf87569d, "tdf87569_drawingml.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf130610) { createSwDoc("tdf130610_bold_in_2_styles.ott"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // check character properties { @@ -497,7 +497,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130610) CPPUNIT_TEST_FIXTURE(Test, testTdf121045) { createSwDoc("tdf121045.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:sz", "val", u"20"); @@ -530,7 +530,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf81567) { createSwDoc("tdf81567.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -561,7 +561,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81567) CPPUNIT_TEST_FIXTURE(Test, testTdf92472) { createSwDoc("tdf92472.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:sz", "val", u"20"); @@ -584,7 +584,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92472) CPPUNIT_TEST_FIXTURE(Test, Tdf133035) { createSwDoc("tdf133035.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); auto pxml = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pxml); OUString aXmlVal = getXPath(pxml, "/w:document/w:body/w:p[1]/w:r[1]/w:object/v:shape", "style"); @@ -629,7 +629,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf108350_noFontdefaults, "tdf108350_noFontdefaults CPPUNIT_TEST_FIXTURE(Test, testTdf123116_oversizedRowSplit) { createSwDoc("tdf123116_oversizedRowSplit.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Intentionally require a very non-backward-compatible, natural continuation of the table // instead of an ugly "page break" like MS Word does (and LO used to do). CPPUNIT_ASSERT_EQUAL_MESSAGE("Row splits over 4 pages", 4, getPages()); @@ -649,7 +649,7 @@ DECLARE_OOXMLEXPORT_TEST(testPageContentBottom, "page-content-bottom.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf129522_removeShadowStyle) { createSwDoc("tdf129522_removeShadowStyle.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference< container::XNameAccess > paragraphStyles = getStyles(u"ParagraphStyles"_ustr); uno::Reference< beans::XPropertySet > xStyleProps(paragraphStyles->getByName(u"Shadow"_ustr), uno::UNO_QUERY_THROW); @@ -724,7 +724,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf121661) { createSwDoc("tdf121661.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", u"851"); @@ -757,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149421) createSwDoc("tdf121661.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -778,7 +778,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf161628, "tdf132599_frames_on_right_pages_no_hyph CPPUNIT_TEST_FIXTURE(Test, testTdf155707) { createSwDoc("tdf155707.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -791,7 +791,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155707) CPPUNIT_TEST_FIXTURE(Test, testTdf161643) { createSwDoc("fdo76163.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:consecutiveHyphenLimit", "val", u"1"); @@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161643) CPPUNIT_TEST_FIXTURE(Test, testTdf121658) { createSwDoc("tdf121658.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps"); } @@ -811,7 +811,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121658) CPPUNIT_TEST_FIXTURE(Test, testTableStyleConfNested) { createSwDoc("table-style-conf-nested.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed, as the custom table cell @@ -830,7 +830,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133771) // Without the fix in place, this test would have failed with // "An uncaught exception of type com.sun.star.io.IOException" // exporting to docx - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, "//w:body/w:p/w:r/w:t", u"Password Protected"); @@ -847,7 +847,7 @@ CPPUNIT_TEST_FIXTURE(Test, testZeroLineSpacing) xParagraph->setPropertyValue(u"ParaLineSpacing"_ustr, uno::Any(aSpacing)); // Export to docx. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -874,7 +874,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSemiTransparentText) xTextRange->setString(u"x"_ustr); // Export to docx. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); double fValue = getXPath( @@ -929,7 +929,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUserField) xText->insertTextContent(xCursor, xUnnamedField, /*bAbsorb=*/false); // Export to docx. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index dbcf7c0b6c2f..de298a604319 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -30,7 +30,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf123621) { createSwDoc("tdf123621.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" @@ -40,7 +40,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123621) CPPUNIT_TEST_FIXTURE(Test, testTdf131540) { createSwDoc("tdf131540.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // There are 2 OLEs test if one of them moved on save: @@ -84,7 +84,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131801) createSwDoc("tdf131801.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -110,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131801) CPPUNIT_TEST_FIXTURE(Test, testTdf133334_followPgStyle) { createSwDoc("tdf133334_followPgStyle.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -135,7 +135,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137850_compat15ZOrder, "tdf137850_compat15ZOrder CPPUNIT_TEST_FIXTURE(Test, testTdf118701) { createSwDoc("tdf118701.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This was 6, related to moving inline images after the page breaks CPPUNIT_ASSERT_EQUAL(4, getPages()); @@ -183,7 +183,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123381, "tdf123381.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf123401) { createSwDoc("tdf123401.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -221,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116394) createSwDoc("tdf116394.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", u" MERGEFIELD ab=cd "); @@ -230,7 +230,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116394) CPPUNIT_TEST_FIXTURE(Test, testTdf123356) { createSwDoc("tdf123356.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -248,7 +248,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123356) CPPUNIT_TEST_FIXTURE(Test, testTdf136404) { createSwDoc("tdf136404.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -303,7 +303,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166436) { // Without the fix in place, this test would have crashed at import time createSwDoc("tdf166436.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); CPPUNIT_ASSERT(xFieldsAccess->hasElements()); @@ -312,7 +312,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166436) CPPUNIT_TEST_FIXTURE(Test, testTdf123390) { createSwDoc("tdf123390.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -334,7 +334,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123390) CPPUNIT_TEST_FIXTURE(Test, testTdf123354) { createSwDoc("tdf123354.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -356,7 +356,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123354) CPPUNIT_TEST_FIXTURE(Test, testTdf123384) { createSwDoc("tdf123384.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -413,7 +413,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123355) createSwDoc("tdf123355.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -469,7 +469,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123382) createSwDoc("tdf123382.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122648) createSwDoc("tdf122648.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -527,7 +527,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122648) CPPUNIT_TEST_FIXTURE(Test, testTdf98000_changePageStyle) { createSwDoc("tdf98000_changePageStyle.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); @@ -542,7 +542,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf98000_changePageStyle) CPPUNIT_TEST_FIXTURE(Test, testTdf145998_unnecessaryPageStyles) { createSwDoc("tdf145998_unnecessaryPageStyles.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Sanity check - always good to test when dealing with page styles and breaks. CPPUNIT_ASSERT_EQUAL(5, getPages()); @@ -575,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145998_unnecessaryPageStyles) CPPUNIT_TEST_FIXTURE(Test, testTdf136929_framesOfParagraph) { createSwDoc("tdf136929_framesOfParagraph.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Before this fix, the image was placed in the footer instead of in the text body - messing everything up. CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 5, getPages() ); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -595,7 +595,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf136589_paraHadField, "tdf136589_paraHadField.doc CPPUNIT_TEST_FIXTURE(Test, testTdf133370_columnBreak) { createSwDoc("tdf133370_columnBreak.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Since non-DOCX formats ignores column breaks in non-column situations, don't export to docx. CPPUNIT_ASSERT_EQUAL(1, getPages()); } @@ -603,7 +603,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133370_columnBreak) CPPUNIT_TEST_FIXTURE(Test, testTdf134649_pageBreak) { createSwDoc("tdf134649_pageBreak.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This was 1 (missing page break between tables). CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -624,7 +624,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135343_columnSectionBreak_c14, "tdf135343_column CPPUNIT_TEST_FIXTURE(Test, testTdf135973) { createSwDoc("tdf135973.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); { uno::Reference xPara(getParagraph(2), uno::UNO_QUERY); @@ -688,7 +688,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121669_equalColumns, "tdf121669_equalColumns.doc CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak) { createSwDoc("tdf132149_pgBreak.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This 5 page document is designed to visually exaggerate the problems // of emulating LO's followed-by-page-style into MSWord's sections. // While much has been improved, there are extra pages present, which still need fixing. @@ -718,7 +718,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak) CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreakB) { createSwDoc("tdf132149_pgBreakB.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This 5 page document is designed to visually exaggerate the problems // of emulating LO's followed-by-page-style into MSWord's sections. xmlDocUniquePtr pDump = parseLayoutDump(); @@ -732,7 +732,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreakB) CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak2) { createSwDoc("tdf132149_pgBreak2.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This 3 page document is designed to visually exaggerate the problems // of emulating LO's followed-by-page-style into MSWord's sections. @@ -748,7 +748,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak2) CPPUNIT_TEST_FIXTURE(Test, testTdf136952_pgBreak3B) { createSwDoc("tdf136952_pgBreak3B.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This 4 page document is designed to visually exaggerate the problems // of emulating LO's followed-by-page-style into MSWord's sections. xmlDocUniquePtr pDump = parseLayoutDump(); @@ -826,7 +826,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131561_necessaryBorder, "tdf131561_necessaryBord CPPUNIT_TEST_FIXTURE(Test, testTdf135655) { createSwDoc("tdf135655.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); const xmlDocUniquePtr pExpDoc = parseExport(u"word/document.xml"_ustr); const OUString sXFillColVal = getXPath(pExpDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape", "fillcolor"); CPPUNIT_ASSERT_EQUAL(u"#00A933"_ustr, sXFillColVal); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135655) CPPUNIT_TEST_FIXTURE(Test, testTdf138374) { createSwDoc("tdf138374.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "fillcolor", u"#ffd320"); assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "coordsize", u"1315,6116"); @@ -868,7 +868,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf134609_gridAfter, "tdf134609_gridAfter.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf135329_lostImage) { createSwDoc("tdf135329_lostImage.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // the character-anchored image was being skipped, since searchNext didn't notice it. uno::Reference xImageProps(getShape(2), uno::UNO_QUERY_THROW); } @@ -876,7 +876,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135329_lostImage) CPPUNIT_TEST_FIXTURE(Test, testTdf136441_commentInFootnote) { createSwDoc("tdf136441_commentInFootnote.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // failed to load without error if footnote contained a comment. // (MS Word's UI doesn't allow adding comments to a footnote.) } @@ -892,7 +892,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137683_charHighlightTests) // Don't export unnecessary w:highlight="none" (Unnecessary one intentionally hand-added to original .docx) createSwDoc("tdf137683_charHighlightTests.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); @@ -911,7 +911,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138345_charStyleHighlight, "tdf138345_charStyleH CPPUNIT_TEST_FIXTURE(Test, testTdf125268) { createSwDoc("tdf125268.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); const uno::Reference xRun(getRun(getParagraph(1), 1, u"Hello"_ustr), uno::UNO_QUERY); // Without the fix in place, this test would have failed with @@ -924,7 +924,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125268) CPPUNIT_TEST_FIXTURE(Test, testTdf138345_numberingHighlight) { createSwDoc("tdf138345_numberingHighlight.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Before the fix, the highlight was completely lost. xmlDocUniquePtr pXmlStyles = parseExport(u"word/numbering.xml"_ustr); if (pXmlStyles) @@ -976,7 +976,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135665, "tdf135665.docx") CPPUNIT_TEST_FIXTURE(Test, testAtPageShapeRelOrientation) { createSwDoc("rotated_shape.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // invalid combination of at-page anchor and horizontal-rel="paragraph" // caused relativeFrom="column" instead of relativeFrom="page" @@ -1013,7 +1013,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAtPageShapeRelOrientation) CPPUNIT_TEST_FIXTURE(Test, testVMLallowincell) { createSwDoc("shape-atpage-in-table.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // VML o:allowincell, apparently the default is "t" @@ -1026,7 +1026,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLallowincell) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginHasFooter) { createSwDoc("tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#133070 The height was set relative to page print area bottom, // but this was handled relative to page height. // Note: page print area bottom = margin + footer height. @@ -1051,7 +1051,7 @@ DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx") CPPUNIT_TEST_FIXTURE(Test, TestTdf143028) { createSwDoc("fail_bracePair.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); auto pExportXml = parseExport(u"word/document.xml"_ustr); @@ -1064,7 +1064,7 @@ CPPUNIT_TEST_FIXTURE(Test, TestTdf143028) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginNoFooter) { createSwDoc("tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#133070 The height was set relative to page print area bottom, // but this was handled relative to page height. // Note: page print area bottom = margin + footer height. @@ -1076,7 +1076,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginNoFooter) CPPUNIT_TEST_FIXTURE(Test, testTdf133702) { createSwDoc("tdf133702.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"); } @@ -1084,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133702) CPPUNIT_TEST_FIXTURE(Test, testTdf135667) { createSwDoc("tdf135667.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This was missing. @@ -1103,7 +1103,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135667) CPPUNIT_TEST_FIXTURE(Test, testImageSpaceSettings) { createSwDoc("tdf135047_ImageSpaceSettings.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#135047 The spaces of image were not saved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distT", u"90170"); @@ -1115,7 +1115,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageSpaceSettings) CPPUNIT_TEST_FIXTURE(Test, testTdf137295) { createSwDoc("tdf137295.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Without the fix in place, the test would have failed with @@ -1146,7 +1146,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135660, "tdf135660.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf136814) { createSwDoc("tdf136814.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // Padding in this document is 0.10 cm which should translate to 3 pt (approx. 1.0583mm) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 7d2dc44b9cc2..3a5022865d55 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -41,7 +41,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf143860NonPrimitiveCustomShape) { createSwDoc("tdf143860_NonPrimitiveCustomShape.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The document has a custom shape of type non-primitive without handles. Make sure that the shape @@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143860NonPrimitiveCustomShape) CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCurve) { createSwDoc("tdf136386_WrapPolygonCurve.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Document has a curve with contour wrap and 'outside only'. Error was, that type 'square' was @@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCurve) CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonLineShape) { createSwDoc("tdf136386_WrapPolygonLineShape.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Document has a sloping line with contour wrap. Error was, that type 'square' was written and @@ -92,7 +92,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonLineShape) CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCustomShape) { createSwDoc("tdf142433_WrapPolygonCustomShape.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Document has 4-point star with contour wrap. Error was, that the enhanced path was written @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCustomShape) CPPUNIT_TEST_FIXTURE(Test, testFrameWrapTextMode) { createSwDoc("tdf143432_Frame_WrapTextMode.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -146,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134219ContourWrap_glow_rotate) // Test fails on reload without fix with left: expected 1461 actual 2455; right: expected 1302 // actual 4177; top: expected 1522 actual 2457; bottom: expected 1296, actual 4179 verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -170,14 +170,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134219ContourWrap_stroke_shadow) // Test after reload would fail without fix with // left, top: expected 318 actual 635; right, bottom: expected 1164 actual 2434 verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf123569_rotWriterImage) { createSwDoc("tdf123569_rotWriterImage_46deg.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); uno::Reference xFrame(getShape(1), uno::UNO_QUERY); @@ -203,7 +203,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142486_LeftMarginShadowLeft, "tdf142486_LeftMarg DECLARE_OOXMLEXPORT_TEST(testTdf151384Hyperlink, "151384Hyperlink.odt") { createSwDoc("151384Hyperlink.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", u"Hyperlink"); @@ -225,7 +225,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf66039, "tdf66039.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf142486_FrameShadow) { createSwDoc("tdf142486_FrameShadow.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xModel(mxComponent, uno::UNO_QUERY); @@ -247,7 +247,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142486_FrameShadow) CPPUNIT_TEST_FIXTURE(Test, testTdf136059) { createSwDoc("tdf136059.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Contour has not been exported!", true, @@ -429,7 +429,7 @@ DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx") CPPUNIT_TEST_FIXTURE(Test, testGutterTop) { createSwDoc("gutter-top.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); CPPUNIT_ASSERT(pXmlSettings); // Without the accompanying fix in place, this test would have failed with: @@ -442,7 +442,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterTop) CPPUNIT_TEST_FIXTURE(Test, testCustomShapePresetExport) { createSwDoc("testCustomShapePresetExport.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Check if the load failed. CPPUNIT_ASSERT(getPages()); @@ -475,7 +475,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapePresetExport) CPPUNIT_TEST_FIXTURE(Test, testTdf148671) { createSwDoc("tdf148671.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Don't assert with 'pFieldMark' failed when document is opened CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -516,7 +516,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf125936_numberingSuperscript, "tdf125936_numberin CPPUNIT_TEST_FIXTURE(Test, testTdf134619_numberingProps) { createSwDoc("tdf134619_numberingProps.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Get the third paragraph's numbering style's 1st level's bullet size uno::Reference xParagraph = getParagraph(3); auto xLevels = getProperty< uno::Reference >(xParagraph, u"NumberingRules"_ustr); @@ -532,7 +532,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134619_numberingProps) CPPUNIT_TEST_FIXTURE(Test, testTdf134951_duplicates) { createSwDoc("tdf134951_duplicates.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xEndnotesSupplier(mxComponent, uno::UNO_QUERY); @@ -561,7 +561,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135773_numberingShading) batch->commit(); createSwDoc("tdf135774_numberingShading.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This test uses a custom setting to export CharBackground as Highlight instead of the 7.0 default of Shading. // Before the fix, the imported shading was converted into a red highlight. @@ -572,7 +572,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135773_numberingShading) CPPUNIT_TEST_FIXTURE(Test, testTdf140336_paraNoneShading) { createSwDoc("tdf140336_paraNoneShading.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Before the fix, the background from a style was exported to dis-inheriting paragraphs/styles. CPPUNIT_ASSERT_EQUAL(sal_uInt32(COL_AUTO), getProperty(getParagraph(1), u"ParaBackColor"_ustr)); @@ -586,7 +586,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf140336_paraNoneShading) CPPUNIT_TEST_FIXTURE(Test, testTdf141173_missingFrames) { createSwDoc("tdf141173_missingFrames.rtf"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Without the fix in place, almost all of the text and textboxes were missing. // Without the fix, there were only 2 shapes (mostly unseen). CPPUNIT_ASSERT_EQUAL(14, getShapes()); @@ -609,7 +609,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142404_tabOverMarginC15, "tdf142404_tabOverMargi CPPUNIT_TEST_FIXTURE(Test, testTdf142404_tabOverSpacingC15) { createSwDoc("tdf142404_tabOverSpacingC15.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Although TabOverMargin no longer applies to compatibilityMode 15 DOCX files, // it still applies to a tab over the paragraph end (inside text boundaries). // The original 3-page ODT saved as DOCX would fit on one page in MS Word 2010, but 3 in Word 2013. @@ -670,7 +670,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextframeHyperlink) // FIXME: After save&reload, the text frame should still be a text frame, and the above test should still work. // (Currently the Writer text frame becomes a text box (shape based)). See tdf#140961 - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // DML @@ -687,7 +687,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146171_invalid_change_date) // disable and check only the conversion of the invalid (zeroed) change date // 0000-00-00T00:00:00Z, resulting loss of change tracking during ODF roundtrip // reload("writer8", "tdf146171.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 @@ -703,7 +703,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146171_invalid_change_date) CPPUNIT_TEST_FIXTURE(Test, testTdf139580) { createSwDoc("tdf139580.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Without the fix in place, this test would have crashed at export time CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -719,7 +719,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149198, "tdf149198.docx") CPPUNIT_TEST_FIXTURE(Test, testFooterMarginLost) { createSwDoc("footer-margin-lost.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: // - Expected: 709 @@ -745,7 +745,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEffectExtentLineWidth) // - Actual : 561 // i.e. the upper spacing was too large, the last line of the text moved below the shape. verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -758,7 +758,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) CPPUNIT_ASSERT(getProperty(xStandard, u"RtlGutter"_ustr)); // When saving back to DOCX: - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Then make sure the section's gutter is still RTL: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -770,7 +770,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) CPPUNIT_TEST_FIXTURE(Test, testTdf140572_docDefault_superscript) { createSwDoc("tdf140572_docDefault_superscript.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // A round-trip was crashing. // Without the fix, everything was DFLT_ESC_AUTO_SUPER (default superscript) @@ -805,7 +805,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf136841, "tdf136841.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf138953) { createSwDoc("croppedAndRotated.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure the rotation is exported correctly, and size not distorted @@ -821,7 +821,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138953) CPPUNIT_TEST_FIXTURE(Test, testTdf118535) { createSwDoc("tdf118535.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(2, getPages()); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); @@ -919,7 +919,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105688, "tdf105688.docx") CPPUNIT_TEST_FIXTURE(Test, testCommentReply) { createSwDoc("CommentReply.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlComm = parseExport(u"word/comments.xml"_ustr); xmlDocUniquePtr pXmlCommExt = parseExport(u"word/commentsExtended.xml"_ustr); CPPUNIT_ASSERT(pXmlComm); @@ -938,7 +938,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentReply) CPPUNIT_TEST_FIXTURE(Test, testCommentDone) { createSwDoc("CommentDone.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlComm = parseExport(u"word/comments.xml"_ustr); assertXPath(pXmlComm, "/w:comments/w:comment[1]/w:p", 2); OUString idLastPara = getXPath(pXmlComm, "/w:comments/w:comment[1]/w:p[2]", "paraId"); @@ -1007,14 +1007,14 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentDoneModel) createSwDoc("CommentDone.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection) { createSwDoc("tdf142361ShadowDirection.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The attribute 'rotWithShape' has the default value 'true' in OOXML, so Words interprets a @@ -1031,7 +1031,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection) CPPUNIT_TEST_FIXTURE(Test, testTdf150542) { createSwDoc("tdf150542.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pSettingsDoc = parseExport(u"word/settings.xml"_ustr); // Ensure that all docvars from input are written back and with correct values. @@ -1053,7 +1053,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150542) CPPUNIT_TEST_FIXTURE(Test, testTdf139549) { createSwDoc("tdf139549.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Document contains a VML textbox, the position of the textbox was incorrect. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OUString aStyle = getXPath(pXmlDoc, "//w:pict/v:shape", "style"); @@ -1095,7 +1095,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf139549) CPPUNIT_TEST_FIXTURE(Test, testTdf143726) { createSwDoc("Simple-TOC.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); CPPUNIT_ASSERT(pXmlStyles); @@ -1107,7 +1107,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143726) CPPUNIT_TEST_FIXTURE(Test, testTdf152153) { createSwDoc("embedded_images.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), @@ -1128,7 +1128,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152153) CPPUNIT_TEST_FIXTURE(Test, testTdf152152) { createSwDoc("artistic_effects.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 627335874a4f..cac6d99b4b59 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148380_fldLocked) xField.set(xFields->nextElement(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"1/23/4567 8:9:10 PM"_ustr, xField->getPresentation(false)); CPPUNIT_ASSERT_EQUAL(u"DocInformation:Last printed (fixed)"_ustr, xField->getPresentation(true)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); getParagraph(2, u"4/5/2022 4:29:00 PM"_ustr); getParagraph(4, u"1/23/4567 8:9:10 PM"_ustr); @@ -210,7 +210,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf139759_commentHighlightBackground, "tdf139759_co CPPUNIT_TEST_FIXTURE(Test, testTdf135906) { createSwDoc("tdf135906.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // just test round-tripping. The document was exported as corrupt and didn't re-load. } @@ -225,7 +225,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146802, "tdf146802.docx") CPPUNIT_TEST_FIXTURE(Test, testParaStyleNumLevel) { createSwDoc("para-style-num-level.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -238,7 +238,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) { // Given a document with a clearing break, when saving to DOCX: createSwDoc("clearing-break.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the clearing break is not lost: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -266,7 +266,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -300,7 +300,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckboxContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -349,7 +349,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDropdownContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -389,7 +389,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -433,7 +433,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -476,7 +476,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder) xPageStyle->setPropertyValue(u"TopBorderDistance"_ustr, uno::Any(nTopBorderDistance)); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the page edge -> border space is correct: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -492,7 +492,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf148494) { createSwDoc("tdf148494.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -505,7 +505,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148494) CPPUNIT_TEST_FIXTURE(Test, testTdf137466) { createSwDoc("tdf137466.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Ensure that we have @@ -543,7 +543,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDontAddNewStyles) // When saving that document: createSwDoc("dont-add-new-styles.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that export doesn't have additional styles, Caption was one of them: xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); @@ -601,7 +601,7 @@ DECLARE_OOXMLEXPORT_TEST(TestWPGZOrder, "testWPGZOrder.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf148720) { createSwDoc("tdf148720.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pLayout = parseLayoutDump(); const char* sShapeXPaths[] = @@ -679,7 +679,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123642_BookmarkAtDocEnd) createSwDoc("tdf123642.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -877,7 +877,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148111) createSwDoc("tdf148111.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -914,7 +914,7 @@ DECLARE_OOXMLEXPORT_TEST(TestTdf73499, "tdf73499.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf81507) { createSwDoc("tdf81507.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Ensure that we have @@ -984,12 +984,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf144563, "tdf144563.docx") #if !defined(_WIN32) CPPUNIT_TEST_FIXTURE(Test, testTdf146955) { - auto const url{createFileURL(u"tdf146955.odt")}; - std::cout << url << ":\n"; - loadFromURL(url, nullptr); - save(u"Office Open XML Text"_ustr, nullptr); - std::cout << maTempFile.GetURL() << ":\n"; - loadFromURL(maTempFile.GetURL(), nullptr); + createSwDoc("tdf146955.odt"); + saveAndReload(TestFilter::DOCX); // import of a (broken?) DOCX export with dozens of frames raised a SAX exception, // when the code tried to access to a non-existent footnote uno::Reference xNotes(mxComponent, uno::UNO_QUERY); @@ -1000,7 +996,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146955) CPPUNIT_TEST_FIXTURE(Test, testTdf144668) { createSwDoc("tdf144668.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xPara1(getParagraph(1, u"level1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"[0001]"_ustr, getProperty(xPara1, u"ListLabelString"_ustr)); @@ -1017,7 +1013,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148455_1, "tdf148455_1.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf148455_2) { createSwDoc("tdf148455_2.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Find list id for restarted list @@ -1035,7 +1031,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148455_2) CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) { createSwDoc("tdf147978_enhancedPath_commandABVW.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Make sure the new implemented export for commands A,B,V and W use the correct arc between // the given two points, here the short one. for (sal_Int16 i = 1 ; i <= 4; ++i) @@ -1082,7 +1078,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154481, "tdf154481.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf149200) { createSwDoc("tdf149200.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1155,7 +1151,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149089, "tdf149089.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf139128) { createSwDoc("tdf139128.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed with: diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index d698942cf1f0..cbcdfb1ec463 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150197_predefinedNumbering) CPPUNIT_ASSERT_EQUAL(u"1."_ustr, getProperty(getParagraph(1), u"ListLabelString"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(u"1."_ustr, getProperty(getParagraph(1), u"ListLabelString"_ustr)); } @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineSdtHeader) // Without the accompanying fix in place, this test would have failed with an assertion failure, // we produced not-well-formed XML on save. createSwDoc("inline-sdt-header.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testCellSdtRedline) @@ -73,7 +73,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellSdtRedline) // Without the accompanying fix in place, this test would have failed with an assertion failure, // we produced not-well-formed XML on save. createSwDoc("cell-sdt-redline.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testTdf148956_directEndFormatting) @@ -107,7 +107,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148956_directEndFormatting) }; createSwDoc("tdf148956_directEndFormatting.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -166,7 +166,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154751_dualStrikethrough, "tdf154751_dualStriket CPPUNIT_TEST_FIXTURE(Test, testTdf154478) { createSwDoc("tdf154478.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/comments.xml"_ustr); OUString aValues[5] = { u"Comment1 seen."_ustr, u"Comment2 seen."_ustr, u"Comment3 NOTseen."_ustr, u"Comment4 NOTseen."_ustr, u"Comment5 NOTseen."_ustr }; @@ -183,7 +183,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154478) CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks) { createSwDoc("tdf153592_columnBreaks.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The two column breaks were lost on import. (I wouldn't complain if they were at 3,5) @@ -301,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePr2) createSwDoc("tdf154703_framePr2.rtf"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); // exported: framed paragraphs without a background should now have a red background @@ -316,7 +316,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePr2) CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePrWrapSpacing) { createSwDoc("tdf154703_framePrWrapSpacing.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -328,7 +328,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePrTextDirection) { createSwDoc("tdf154703_framePrTextDirection.docx"); CPPUNIT_ASSERT_EQUAL(sal_Int16(text::WritingMode2::TB_RL), getProperty(getShape(1), u"WritingMode"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(sal_Int16(text::WritingMode2::TB_RL), getProperty(getShape(1), u"WritingMode"_ustr)); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -528,7 +528,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153964_firstIndentAfterBreak14, "tdf153964_first CPPUNIT_TEST_FIXTURE(Test, testTdf148834_lineNumbering) { createSwDoc("tdf148834_lineNumbering.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pStylesXml = parseExport(u"word/styles.xml"_ustr); // user specified: do not include in line numbering @@ -542,7 +542,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148834_lineNumbering) CPPUNIT_TEST_FIXTURE(Test, testTdf157598) { createSwDoc("tdf157598.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pStylesXml = parseExport(u"word/styles.xml"_ustr); @@ -559,7 +559,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf76022_textboxWrap) CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you make wrapping sane/interoperable?", 1, getPages()); // When saving to DOCX, the table should obey the fly wrapping - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The fly takes up the whole page, so the table needs to shift down to the next page. CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) // Such shape must have vert="mongolianVert" again after saving. // Without fix the orientation was vert="vert". - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//wps:bodyPr", "vert", u"mongolianVert"); } @@ -598,7 +598,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) CPPUNIT_TEST_FIXTURE(Test, testTdf151912) { createSwDoc("tdf151912.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // For now just ensure roundtrip is successful //tdf#151548 - ensure block SDT preserves id (instead of random re-assignment) @@ -639,7 +639,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberPortionFormatFromODT) createSwDoc("number-portion-format.odt"); // When saving to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the paragraph marker's char format has that custom font size: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -657,7 +657,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaStyleCharPosition) createSwDoc("para-style-char-position.docx"); // When saving it back to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that is not turned into a normal subscript text: xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); @@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150966_regularInset) // Without fix the insets were tIns="359280" and bIns="539640". The text area had 1080Emu height // and Word displays no text at all. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathAttrs(pXmlDoc, "//wps:bodyPr", { { "tIns", u"179640" }, { "bIns", u"360000" } }); } @@ -689,7 +689,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150966_regularInset) CPPUNIT_TEST_FIXTURE(Test, testTdf152636_lostPageBreak) { createSwDoc("tdf152636_lostPageBreak.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -697,7 +697,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152636_lostPageBreak) CPPUNIT_TEST_FIXTURE(Test, testTdf152636_lostPageBreak2) { createSwDoc("tdf152636_lostPageBreak2.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -708,7 +708,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtDuplicatedId) createSwDoc("sdt-duplicated-id.docx"); // When exporting that back to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure we write 2 and no duplicates: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -722,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtDuplicatedId) CPPUNIT_TEST_FIXTURE(Test, testImageCropping) { createSwDoc("crop-roundtrip.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // the image has no cropping after roundtrip, because it has been physically cropped // NB: this test should be fixed when the core feature to show image cropped when it @@ -740,7 +740,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152200) createSwDoc("tdf152200-field+textbox.docx"); // When exporting that back to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that fldChar with type 'end' goes prior to the at-char anchored fly. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -762,7 +762,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152200) CPPUNIT_TEST_FIXTURE(Test, testTdf126477) { createSwDoc("embedded_chart.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTEOSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xAccess(xTEOSupplier->getEmbeddedObjects()); @@ -788,7 +788,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126477) CPPUNIT_TEST_FIXTURE(Test, testTdf152425) { createSwDoc("tdf152425.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Check that "List Number" and "List 5" styles don't get merged const OUString Para3Style = getProperty(getParagraph(3), u"ParaStyleName"_ustr); @@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152425) CPPUNIT_TEST_FIXTURE(Test, testTdf153104) { createSwDoc("tdf153104.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OUString numId = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId", "val"); @@ -826,7 +826,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153104) CPPUNIT_TEST_FIXTURE(Test, testTdf153128) { createSwDoc("tdf153128.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFirstLineHeight @@ -844,7 +844,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingUnknownStyleInRedline) { // This must not fail assertions createSwDoc("UnknownStyleInRedline.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Check that the original unknown style name "UnknownStyle" is roundtripped // (maybe this is wrong, because Word does not do this). xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -855,7 +855,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingUnknownStyleInRedline) CPPUNIT_TEST_FIXTURE(Test, testTdf148026) { createSwDoc("tdf148026.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -868,7 +868,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148026) CPPUNIT_TEST_FIXTURE(Test, testTdf153664) { createSwDoc("Table-of-Figures.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); CPPUNIT_ASSERT(pXmlStyles); @@ -1011,7 +1011,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159158_zOrder_zIndexMax) createSwDoc("tdf159158_zOrder_zIndexMax.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -1034,7 +1034,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159158_zOrder_zIndexDuplicate_compat15) createSwDoc("tdf159158_zOrder_zIndexDuplicate_compat15.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -1063,7 +1063,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159158_zOrder_zIndexWins) }; createSwDoc("tdf159158_zOrder_zIndexWins.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -1084,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159158_zOrder_behindDocA) createSwDoc("tdf159158_zOrder_behindDocA.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -1107,7 +1107,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159158_zOrder_behindDocB) createSwDoc("tdf159158_zOrder_behindDocB.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx index c3b9e16c94b7..5dd58fd57536 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx @@ -100,7 +100,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80555, "fdo80555.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf104418) { createSwDoc("tdf104418.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Problem was that cell property was ignored. uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), @@ -219,7 +219,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo85542, "fdo85542.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf65955) { createSwDoc("tdf65955.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), @@ -243,7 +243,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf65955) CPPUNIT_TEST_FIXTURE(Test, testTdf65955_2) { createSwDoc("tdf65955_2.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), @@ -292,7 +292,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf8255) }; createSwDoc("tdf8255.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -659,14 +659,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99140) }; createSwDoc("tdf99140.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTableMarginAdjustment) { createSwDoc("table.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Writer, (new) Word: margin 0 means table border starts at 0 // (old) Word: margin 0 means paragraph in table starts at 0 @@ -700,7 +700,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119760_tableInTablePosition) }; createSwDoc("tdf119760_tableInTablePosition.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -755,7 +755,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableCellMargin, "table-cell-margin.docx") CPPUNIT_TEST_FIXTURE(Test, TestPuzzleExport) { createSwDoc("TestPuzzleExport.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // See tdf#148342 for details // Create a metafile auto pMeta = getSwDocShell()->GetPreviewMetaFile(); @@ -861,7 +861,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107359, "tdf107359-char-pitch.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf77236_MissingSolidFill) { createSwDoc("tdf77236_MissingSolidFill.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#77236: solidFill of VML shape was not exported if the colors of line and style were the same xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath( @@ -914,7 +914,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105875_VmlShapeRotationWithFlip) CPPUNIT_TEST_FIXTURE(Test, testTdf133363) { createSwDoc("tdf133363.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // tdf#133363: remove extra auto space between first and second list elements assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing", "before", @@ -977,7 +977,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138093) createSwDoc("tdf138093.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -987,7 +987,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138093) CPPUNIT_TEST_FIXTURE(Test, testTdf138093B) { createSwDoc("tdf138093B.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:sdt", 3); @@ -1080,7 +1080,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131722) createSwDoc("tdf131722.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1113,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133560) CPPUNIT_TEST_FIXTURE(Test, testTdf150408_isLvl_RoundTrip) { createSwDoc("listWithLgl.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Second level's numbering should use Arabic numbers for first level reference auto xPara = getParagraph(1); @@ -1148,7 +1148,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156548) { // Given a document using two bookmarks with similar names longer than 40 characters createSwDoc("longBookmarkName.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // After the export, the names must be no longer than 40 characters; they must be unique; // and the hyperlinks must use the same names, to still point to the correct targets: @@ -1209,7 +1209,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157136) } // Test the same after round-trip - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { // 1st paragraph - becomes inline content control after roundtrip @@ -1240,14 +1240,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148952_2007) //Given a document with 1 image (with name, alt title and description field populated) in odt format createSwDoc("tdf148952.odt"); - OUString rFilterName = u"MS Word 2007 XML"_ustr; - //Export it to MS word 2007(.docx) format - saveAndReload(rFilterName); + saveAndReload(TestFilter::DOCX_2007); // Checks the number of images in the docx file - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xImage(getShape(1), uno::UNO_QUERY); @@ -1268,14 +1265,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148952_2010) //Given a document with 1 image (with name, alt title and description field populated) in odt format createSwDoc("tdf148952.odt"); - OUString rFilterName = u"Office Open XML Text"_ustr; - //Export it to MS word 2010-365 (.docx) format - saveAndReload(rFilterName); + saveAndReload(TestFilter::DOCX); // Checks the number of images in the docx file - const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xImage(getShape(1), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 00e695e5c69a..7eeffe610090 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -44,7 +44,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testPageGraphicBackground) { createSwDoc("page-graphic-background.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); validate(maTempFile.GetFileName(), u"Office Open XML Text"); CPPUNIT_ASSERT_EQUAL(1, getPages()); // No idea how the graphic background should be exported (seems there is no @@ -58,7 +58,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageGraphicBackground) CPPUNIT_TEST_FIXTURE(Test, testCustomProperties) { createSwDoc("custom-properties.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#133377 tdf#103987 FILESAVE XLSX: Make sure the custom/core/application // file properties are stored correctly after roundtrip to .docx @@ -163,7 +163,7 @@ CPPUNIT_TEST_FIXTURE(Test, testZoom) createSwDoc("zoom.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); // Validation test: order of elements were wrong. @@ -183,7 +183,7 @@ CPPUNIT_TEST_FIXTURE(Test, testZoom) CPPUNIT_TEST_FIXTURE(Test, defaultTabStopNotInStyles) { createSwDoc("empty.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); validate(maTempFile.GetFileName(), u"Office Open XML Text"); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The default tab stop was mistakenly exported to a style. @@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo38244) createSwDoc("fdo38244.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); validate(maTempFile.GetFileName(), u"Office Open XML Text"); } @@ -262,7 +262,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo38244) CPPUNIT_TEST_FIXTURE(Test, testCommentsNested) { createSwDoc("comments-nested.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); validate(maTempFile.GetFileName(), u"Office Open XML Text"); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xOuter = getProperty< uno::Reference >(getRun(getParagraph(1), 2), u"TextField"_ustr); @@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentsNested) CPPUNIT_TEST_FIXTURE(Test, testMathEscape) { createSwDoc("math-escape.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(u"\\{ \\[ \\] \\( \\) \\}"_ustr, getFormula(getRun(getParagraph(1), 1))); } @@ -283,14 +283,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathEscape) CPPUNIT_TEST_FIXTURE(Test, testTdf158023Export) { createSwDoc("tdf158023_export.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(u"left [ right ] left ( right ) left lbrace right rbrace"_ustr, getFormula(getRun(getParagraph(1), 1))); } CPPUNIT_TEST_FIXTURE(Test, testFdo51034) { createSwDoc("fdo51034.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that the 'l' param of the HYPERLINK field was parsed with = "#", not += "#". CPPUNIT_ASSERT_EQUAL(u"http://Www.google.com/#a"_ustr, getProperty(getRun(getParagraph(1), 1), u"HyperLinkURL"_ustr)); @@ -344,7 +344,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathMatrix, "math-matrix.docx") CPPUNIT_TEST_FIXTURE(Test, testMathMso2k7) { createSwDoc("math-mso2k7.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CHECK_FORMULA(u"A \"=\" \u03C0 {r} ^ {2}"_ustr, getFormula(getRun(getParagraph(1), 1))); // TODO check the stack/binom difference // CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (binom {n} {k} right ) {x} ^ {k} {a} ^ {n-k}}", @@ -443,7 +443,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathVerticalStacks, "math-vertical_stacks.docx") CPPUNIT_TEST_FIXTURE(Test, testTable) { createSwDoc("table.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure we write qFormat for well-known style names. xmlDocUniquePtr pXmlDocCT = parseExport(u"word/styles.xml"_ustr); @@ -527,7 +527,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableBorders, "table-borders.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo51550) { createSwDoc("fdo51550.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that we lacked the fallback to export the replacement @@ -569,7 +569,7 @@ DECLARE_OOXMLEXPORT_TEST(test1Table1Page, "1-table-1-page.docx") CPPUNIT_TEST_FIXTURE(Test, testTextFrames) { createSwDoc("textframes.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The frames were simply missing, so let's check if all 3 frames were imported back. CPPUNIT_ASSERT_EQUAL(3, getShapes()); @@ -636,7 +636,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") CPPUNIT_TEST_FIXTURE(Test, testCellBtlr) { createSwDoc("cell-btlr.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * The problem was that the exporter didn't mirror the workaround of the * importer, regarding the btLr text direction: the (mxComponent, u"RecordChanges"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(true, getProperty(mxComponent, u"RecordChanges"_ustr)); // 'Show-Changes' should not be exported - default is true. xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); @@ -860,7 +860,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo66543) CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(getParagraph( 1 ), u"ParaLineNumberStartValue"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(getParagraph( 1 ), u"ParaLineNumberStartValue"_ustr)); @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo66543) CPPUNIT_TEST_FIXTURE(Test, testN822175) { createSwDoc("n822175.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xFrame(getShape(1), uno::UNO_QUERY); @@ -906,7 +906,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66773, "fdo66773.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo58577) { createSwDoc("fdo58577.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The second frame was simply missing, so let's check if both frames were imported back. CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -915,7 +915,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58577) CPPUNIT_TEST_FIXTURE(Test, testBnc581614) { createSwDoc("bnc581614.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty(xFrame, u"FillStyle"_ustr)); } @@ -950,7 +950,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66929, "fdo66929.docx") CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2) { createSwDoc("page-borders-export-case-2.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the exporter didn't mirror the workaround of the // importer, regarding the page border's spacing : the // and the inner nodes like @@ -973,7 +973,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2) CPPUNIT_TEST_FIXTURE(Test, testGrabBag) { createSwDoc("grabbag.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"); @@ -1004,7 +1004,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo60990) { createSwDoc("fdo60990.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The shape had no background, no paragraph adjust and no font color. @@ -1161,7 +1161,7 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") CPPUNIT_TEST_FIXTURE(Test, NoFillAttrInImagedata) { createSwDoc("NoFillAttrInImagedata.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //problem was that type and color2 which are v:fill attributes were written in 'v:imagedata'. The //source file has v:fill and no v:imagedata. Same should be in the file written by LO. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1189,7 +1189,7 @@ DECLARE_OOXMLEXPORT_TEST(testBnc837302, "bnc837302.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf162070Export) { createSwDoc("tdf162070_export.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(u"{P} rsub {\"abs\"} \"~\" {B} rsub {0} \u00B2"_ustr, getFormula(getRun(getParagraph(1), 1))); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx index 102b55bcd01a..95abfb85130d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx @@ -36,7 +36,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb) { createSwDoc("fdo79969_xlsb.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This UT for DOCX embedded with binary excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -59,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb) CPPUNIT_TEST_FIXTURE(Test, testfdo80097) { createSwDoc("fdo80097.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //fdo#76635 : Table borders are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -112,7 +112,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80097) CPPUNIT_TEST_FIXTURE(Test, testTdf95033) { createSwDoc("tdf95033.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //tdf#95033 : Table borders defined by row-level tblPrEx are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -141,7 +141,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95033) CPPUNIT_TEST_FIXTURE(Test, testTdf133455) { createSwDoc("tdf133455.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); //Not disabled table cell borders @@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133455) CPPUNIT_TEST_FIXTURE(Test, testTdf138612) { createSwDoc("tdf138612.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // Row 5 Col 1 - vertically merged cell @@ -198,7 +198,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138612) CPPUNIT_TEST_FIXTURE(Test, testTdf140597) { createSwDoc("tdf140597.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // There were missing tblPrEx table exception borders @@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf140597) CPPUNIT_TEST_FIXTURE(Test, testTdf128646) { createSwDoc("tdf128646.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128646) CPPUNIT_TEST_FIXTURE(Test, testTdf119800) { createSwDoc("tdf119800.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. // (tdf#128646 solved the same only for table paragraphs) xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -267,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119800) CPPUNIT_TEST_FIXTURE(Test, testTdf131728) { createSwDoc("tdf131728.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Inline paragraphs specified by w:specVanish were loaded as not // inline paragraphs, breaking the paragraph layout. Use ODF text // frame to keep the paragraph layout, where the frame contains the @@ -281,7 +281,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131728) CPPUNIT_TEST_FIXTURE(Test, testTdf48459) { createSwDoc("tdf48459.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // export Inline Heading frame style as style separator xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -293,7 +293,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf48459) CPPUNIT_TEST_FIXTURE(Test, testTdf164901) { createSwDoc("tdf164901.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0 (lost floating table because of containing a style separator) @@ -303,7 +303,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf164901) CPPUNIT_TEST_FIXTURE(Test, testFdo77129) { createSwDoc("fdo77129.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that text after TOC field was missing if footer reference comes in field. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -341,7 +341,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129402, "fdo77129.docx") CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsm) { createSwDoc("fdo79969_xlsm.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This UT for DOCX embedded with excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -364,7 +364,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsm) CPPUNIT_TEST_FIXTURE(Test, testfdo80522) { createSwDoc("fdo80522.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, @@ -386,7 +386,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80522) CPPUNIT_TEST_FIXTURE(Test, testfdo80523_pptm) { createSwDoc("fdo80523_pptm.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, @@ -408,7 +408,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80523_pptm) CPPUNIT_TEST_FIXTURE(Test, testfdo80523_sldm) { createSwDoc("fdo80523_sldm.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, @@ -430,7 +430,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80523_sldm) CPPUNIT_TEST_FIXTURE(Test, testfdo80898) { createSwDoc("fdo80898.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This UT for DOCX embedded with binary excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -452,7 +452,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80898) CPPUNIT_TEST_FIXTURE(Test, testOleIconDrawAspect) { createSwDoc("tdf131537.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject", "DrawAspect", u"Icon"); @@ -461,7 +461,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOleIconDrawAspect) CPPUNIT_TEST_FIXTURE(Test, testTableCellWithDirectFormatting) { createSwDoc("fdo80800.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Issue was Direct Formatting for non-first Table cells was not getting preserved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -557,7 +557,7 @@ DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf148035) { createSwDoc("tdf148035.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[2]/w:t", @@ -576,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148035) CPPUNIT_TEST_FIXTURE(Test, testfdo83048) { createSwDoc("fdo83048.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Issue was wrong SDT properties were getting exported for Date SDT xmlDocUniquePtr pXmlDoc = parseExport(u"word/footer2.xml"_ustr); @@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo83048) CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) { createSwDoc("sdt-2-run.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The problem was that was closed after "first", not after "second", so the second assert failed. @@ -602,7 +602,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) CPPUNIT_TEST_FIXTURE(Test, testFD083057) { createSwDoc("fdo83057.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header2.xml"_ustr); // A fly frame was attached to a para which started with a hint (run) containing an SDT. @@ -618,7 +618,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFD083057) CPPUNIT_TEST_FIXTURE(Test, testHeaderBorder) { createSwDoc("header-border.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 0, as header margin was lost during import. assertXPath(pXmlDoc, "//w:pgMar", "header", u"720"); @@ -648,7 +648,7 @@ DECLARE_OOXMLEXPORT_TEST(testImageNoborder, "image-noborder.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf89774) { createSwDoc("tdf89774.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"docProps/app.xml"_ustr); // This was 65, as unit was seconds instead of minutes. assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:TotalTime", @@ -658,7 +658,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89774) CPPUNIT_TEST_FIXTURE(Test, testSectionProtection) { createSwDoc("sectionprot.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr/w:formProt", "val", u"true"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:formProt", "val", u"false"); @@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSectionProtection) CPPUNIT_TEST_FIXTURE(Test, testSectionProtection2) { createSwDoc("sectionprot2.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", u"true"); @@ -714,7 +714,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf66398_permissions) createSwDoc("tdf66398_permissions.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); // check document permission settings for the whole document @@ -737,7 +737,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf66398_permissions) CPPUNIT_TEST_FIXTURE(Test, tdf166173_enforcement) { createSwDoc("tdf166173_enforcement.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); // check if attribute 'enforcement' of 'documentProtection' has still '0' value. @@ -747,7 +747,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf166173_enforcement) CPPUNIT_TEST_FIXTURE(Test, tdf106843) { createSwDoc("tdf106843.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check Track Changes permission set in Writer/OpenDocument (password: "test", encoded by default encoding of Writer) xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", u"trackedChanges"); @@ -766,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf106843) CPPUNIT_TEST_FIXTURE(Test, tdf89991_revisionView) { createSwDoc("tdf89991.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check revisionView (Show Changes) import and export xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", u"0"); @@ -784,7 +784,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf89991_revisionView) CPPUNIT_TEST_FIXTURE(Test, tdf122201_editUnprotectedText) { createSwDoc("tdf122201_editUnprotectedText.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // get the document @@ -806,7 +806,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf122201_editUnprotectedText) CPPUNIT_TEST_FIXTURE(Test, testSectionHeader) { createSwDoc("sectionprot.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // this test must not be zero @@ -816,7 +816,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSectionHeader) CPPUNIT_TEST_FIXTURE(Test, testTdf146491) { createSwDoc("tdf146491.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 12 - a page style was unnecessarily created for every section. assertXPath(pXmlDoc, "//w:footerReference", 1); @@ -825,7 +825,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146491) CPPUNIT_TEST_FIXTURE(Test, testOO47778_1) { createSwDoc("ooo47778-3.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(5, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO47778_1) CPPUNIT_TEST_FIXTURE(Test, testOO47778_2) { createSwDoc("ooo47778-4.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -853,7 +853,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO47778_2) CPPUNIT_TEST_FIXTURE(Test, testOO67471) { createSwDoc("ooo67471-2.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "(//w:t)[2]", u"B"); @@ -862,7 +862,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO67471) CPPUNIT_TEST_FIXTURE(Test, testKDE302504) { createSwDoc("kde302504-1.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(Test, testKDE302504) CPPUNIT_TEST_FIXTURE(Test, testKDE216114) { createSwDoc("kde216114-1.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -882,7 +882,7 @@ CPPUNIT_TEST_FIXTURE(Test, testKDE216114) CPPUNIT_TEST_FIXTURE(Test, testOO72950) { createSwDoc("ooo72950-1.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:tbl", 1); @@ -894,7 +894,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO72950) CPPUNIT_TEST_FIXTURE(Test, fdo60957) { createSwDoc("fdo60957-2.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:tbl", 2); @@ -913,7 +913,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo60957) CPPUNIT_TEST_FIXTURE(Test, testOO106020) { createSwDoc("ooo106020-1.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:tbl", 1); } @@ -928,7 +928,7 @@ DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx") CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText) { createSwDoc("tdf131775_SpacingGroupShapeText.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#131775: Check if correct spacing. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -943,7 +943,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText) CPPUNIT_TEST_FIXTURE(Test, testTdf100581) { createSwDoc("tdf100581.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -974,7 +974,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100581) CPPUNIT_TEST_FIXTURE(Test, testTdf112287) { createSwDoc("tdf112287.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#131775: Check if correct spacing. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -988,7 +988,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287) CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor) { createSwDoc("tdf157572_defaultVAnchor.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // vAnchor wasn't defined on import. It should default to 'margin' when w:y=non-zero @@ -1000,7 +1000,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor) CPPUNIT_TEST_FIXTURE(Test, testTdf157572_insidiousCombination) { createSwDoc("tdf157572_insidiousCombination.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This is a NASTY example. In MS Word, it IMPORTS yAlign=bottom, but positions it as y=0. @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_insidiousCombination) CPPUNIT_TEST_FIXTURE(Test, testTdf157572_noVAlignAsText) { createSwDoc("tdf157572_noVAlignAsText.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", u"text"); @@ -1030,7 +1030,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_noVAlignAsText) CPPUNIT_TEST_FIXTURE(Test, testTdf112287B) { createSwDoc("tdf112287B.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", u"text"); @@ -1040,7 +1040,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287B) CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader) { createSwDoc("tdf120760_ZOrderInHeader.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#120760 Check that the Z-Order of the background is smaller than the front shape's. xmlDocUniquePtr pXml = parseExport(u"word/header2.xml"_ustr); @@ -1060,7 +1060,7 @@ CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader) CPPUNIT_TEST_FIXTURE(Test, testSvgExtensionsSupport) { createSwDoc("SvgImageTest.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocRels = parseExport(u"word/_rels/document.xml.rels"_ustr); @@ -1086,7 +1086,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSvgExtensionsSupport) CPPUNIT_TEST_FIXTURE(Test, testtdf158044) { createSwDoc("tdf158044.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // write hard attributes to prevent multiple toggle attributes from vanishing xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1134,7 +1134,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158855) CPPUNIT_ASSERT_EQUAL(OUString("Office Open XML Text"), getSwDocShell()->GetMedium()->GetFilter()->GetFilterName()); - saveAndReload(getSwDocShell()->GetMedium()->GetFilter()->GetFilterName()); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); @@ -1177,7 +1177,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158971) } // Saving must not fail assertions - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Check again CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); @@ -1202,7 +1202,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158451) { //Without the test, crash occurs when document loads createSwDoc("tdf158451.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); //Asserts document contains grouped shapes with Anchor = "As Character" CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -1221,7 +1221,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159110) { // Given a text with an URL with multiple spaces createSwDoc("multi_space_url.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); static constexpr OUString sExpectedURL = u"http://www.example.org/path%20%20with%20%20spaces"_ustr; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 92aea09ea4b0..4e1943a8d424 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161631) createSwDoc("tdf161631.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -443,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf43767_caseMapNumbering) createSwDoc("tdf43767_caseMapNumbering.odt"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -462,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156105_percentSuffix) createSwDoc("tdf156105_percentSuffix.odt"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlNum = parseExport(u"word/numbering.xml"_ustr); @@ -769,7 +769,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160814_commentOrder) { // given a document with a comment and 5 replies createSwDoc("tdf160814_commentOrder.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // make sure the order of the comments is imported and exported correctly xmlDocUniquePtr pXmlComments = parseExport(u"word/comments.xml"_ustr); @@ -787,7 +787,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); createSwDoc("personalmetadata.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:Template", 0); @@ -804,7 +804,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData) officecfg::Office::Common::Security::Scripting::KeepDocUserInfoOnSaving::set(true, pBatch); pBatch->commit(); createSwDoc("personalmetadata.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:Template", 0); @@ -827,7 +827,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf169072_illegalDates) { // Given a document that MS Word reports as corrupt createSwDoc("tdf169072_illegalDates.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Date Years MUST be greater than 1600 and less than 10,000 // so by dropping invalid entries, we have a document that MS Word can now cleanly open @@ -841,7 +841,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) { // 1. Check we have the original edit time info createSwDoc("personalmetadata.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:TotalTime", 1); @@ -852,7 +852,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRemoveOnlyEditTimeMetaData) // 2. Check edit time info is removed createSwDoc("personalmetadata.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); pAppDoc = parseExport(u"docProps/app.xml"_ustr); assertXPath(pAppDoc, "/extended-properties:Properties/extended-properties:TotalTime", 0); @@ -901,7 +901,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126533_pageBitmap) createSwDoc("tdf126533_pageBitmap.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDocRels = parseExport(u"word/_rels/document.xml.rels"_ustr); @@ -941,7 +941,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154369, "tdf154369.docx") CPPUNIT_TEST_FIXTURE(Test, testScreenTip) { createSwDoc("tdf159897.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -956,13 +956,13 @@ CPPUNIT_TEST_FIXTURE(Test, testEmptyObjectRange) // Assertion failed: isBetween(n, (SAL_MIN_INT64 + d / 2) / m, (SAL_MAX_INT64 - d / 2) / m), // file C:\lo\core\include\o3tl/unit_conversion.hxx, line 75 createSwDoc("cloud.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testTdf161509) { createSwDoc("special_styles.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); CPPUNIT_ASSERT(pXmlStyles); @@ -1112,7 +1112,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf162370) // This must not crash on save; without the fix, it would fail with // "Assertion failed: vector subscript out of range" createSwDoc("too_many_styles.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testTdf128460) @@ -1135,7 +1135,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128460) createSwDoc("tdf128460.odt"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Without the fix in place, the third ASSERT fails with // Expected: text // Actual: @@ -1154,7 +1154,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131288) uno::Reference xCursor = xText->createTextCursor(); xText->insertString(xCursor, u"test"_ustr, false); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), @@ -1169,7 +1169,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131288) xText->insertString(xCursor, u"more testing"_ustr, false); // Save again - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xNameAccess = packages::zip::ZipFileAccess::createWithURL( comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); @@ -1187,14 +1187,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89731) { // Without the fix in place this crashes on opening createSwDoc("tdf89731.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testTdf61309) { // Don't crash on import createSwDoc("tdf61309.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); } @@ -1202,7 +1202,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf162746) { // Without the fix in place this hangs (and eventually OOMs) on opening createSwDoc("tdf162746.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#162781: test the page body table vertical offset and width xmlDocUniquePtr pDump = parseLayoutDump(); // Without the fix, this would be 0 - i.e., the page body table didn't shift down @@ -1217,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf61000) { // Without the fix in place this crashes on opening createSwDoc("tdf61000.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:numFmt", @@ -1233,7 +1233,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf61000) CPPUNIT_TEST_FIXTURE(Test, testCommentWithChildrenTdf163092) { createSwDoc("comment_with_children.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // commentsExtended should exist xmlDocUniquePtr pXmlCommExt = parseExport("word/commentsExtended.xml"); CPPUNIT_ASSERT(pXmlCommExt); @@ -1264,7 +1264,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146269) } // Test also after save-and-reload: - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { auto xModifiable = mxComponent.queryThrow(); CPPUNIT_ASSERT(!xModifiable->isModified()); @@ -1274,7 +1274,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146269) CPPUNIT_TEST_FIXTURE(Test, testTdf164065) { createSwDoc("tdf164065.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1302,7 +1302,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf164474) } // Test also after save-and-reload: - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { auto xTextTablesSupplier(mxComponent.queryThrow()); auto xTables(xTextTablesSupplier->getTextTables().queryThrow()); @@ -1335,7 +1335,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMsWordUlTrailSpace) } // Test also after save-and-reload: - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { uno::Reference xFactory(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xSettings( @@ -1352,7 +1352,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMsWordUlTrailSpace) CPPUNIT_TEST_FIXTURE(Test, testTdf165059_moveFromTo) { createSwDoc("tdf165059_broken.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Without the fix, exported contains w:move* outside of move ranges // Outside move range tags ins/del are valid xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx index 79c7aab94b22..09c90c229101 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx @@ -40,7 +40,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf165642_glossaryFootnote) { createSwDoc("tdf165642_glossaryFootnote.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // round-trip'ing the settings.xml file as is, it contains footnote/endnote references xmlDocUniquePtr pXmlSettings = parseExport(u"word/glossary/settings.xml"_ustr); assertXPath(pXmlSettings, "//w:endnotePr", 1); @@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166201_simplePos) // Given a document with an image at the bottom-right placed there by simplePos createSwDoc("tdf166201_simplePos.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(css::text::RelOrientation::PAGE_FRAME, getProperty(getShape(1), u"HoriOrientRelation"_ustr)); @@ -70,7 +70,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166201_simplePosCM) // Given a document with an image at the bottom-right placed there by simplePos - in cm createSwDoc("tdf166201_simplePosCM.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(css::text::RelOrientation::PAGE_FRAME, getProperty(getShape(1), u"VertOrientRelation"_ustr)); @@ -161,7 +161,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166975) CPPUNIT_ASSERT_EQUAL(u"ccc)"_ustr, getProperty(getParagraph(6), u"ListLabelString"_ustr)); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(u"a)"_ustr, getProperty(getParagraph(2), u"ListLabelString"_ustr)); @@ -183,7 +183,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165492_exactWithBottomSpacing) // and table bottom border padding of 1.5cm... createSwDoc("tdf165492_exactWithBottomSpacing.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // When laying out that document: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -205,7 +205,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165492_atLeastWithBottomSpacing) // and table bottom border padding of 1.5cm... createSwDoc("tdf165492_atLeastWithBottomSpacing.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // When laying out that document: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -227,7 +227,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165047_consolidatedTopMargin) // which is preceded by a paragraph with a lot of lower spacing // and followed by a paragraph with even more upper spacing... createSwDoc("tdf165047_consolidatedTopMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // the upper spacing is mostly "absorbed" by the preceding lower spacing, and is barely noticed CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -247,7 +247,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165047_contextualSpacingTopMargin) // and followed by a paragraph with a lot of upper spacing, // but that paragraph says "don't add space between identical paragraph styles... createSwDoc("tdf165047_contextualSpacingTopMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // the upper spacing is ignored since the paragraph styles are the same CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -264,7 +264,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166553_paraStyleAfterBreak) { // Given a distinctively styled paragraph containing a (column) break in the middle of the para createSwDoc("tdf166553_paraStyleAfterBreak.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Note: we emulate this by creating two real paragraphs. // The paragraph style/formatting after the break must be (almost) the same as before the break @@ -337,7 +337,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167721_chUnits2) // createSwDoc("tdf167721_chUnits2.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Test the parent style ###################################################################### uno::Reference xStyle( @@ -466,7 +466,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf167721_chUnits4, "tdf167721_chUnits4.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf167721_zeroCh) { createSwDoc("tdf167721_zeroCh.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); @@ -492,7 +492,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf83844) }; fnVerify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); fnVerify(); } @@ -514,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf83844Hanging) }; fnVerify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); fnVerify(); } @@ -528,7 +528,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88908) CPPUNIT_ASSERT(!rIDSA.get(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES)); } - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { SwDoc* pDoc = getSwDoc(); @@ -538,7 +538,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88908) rIDSA.set(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES, true); } - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { SwDoc* pDoc = getSwDoc(); @@ -550,7 +550,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88908) CPPUNIT_TEST_FIXTURE(Test, testTdf165933_noDelTextOnMove) { createSwDoc("tdf165933.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); // Without the fix it fails with @@ -565,7 +565,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDelThenFormatDocxExport) // Given a document with ABC style redlines: // When exporting that document: createSwDoc("del-then-format.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure delete "under" format uses the markup: // Without the accompanying fix in place, this test would have failed with: @@ -607,7 +607,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf139418, "tdf139418.docx") CPPUNIT_TEST_FIXTURE(Test, testAnnotationRef) { createSwDoc("comment-annotationref.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Check that the exported comment also has annotationRef xmlDocUniquePtr pXmlComments = parseExport(u"word/comments.xml"_ustr); @@ -629,7 +629,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBadFormulaResult) "com.sun.star.text.TextDocument", aFilterOptions); // When saving to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the field result in the last row's last run is not empty: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -644,7 +644,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBadFormulaResult) CPPUNIT_TEST_FIXTURE(Test, testTdf166511) { createSwDoc("tdf166511.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The reproducer for tdf#166511 depends on result having footer2 and footer3.xml // Original bugdoc only has footer1.xml, and the result only started having multiples @@ -701,7 +701,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166511) CPPUNIT_TEST_FIXTURE(Test, testLineBreakInRef) { createSwDoc("line-break-in-ref.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the fix if fails with diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport23.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport23.cxx index b2f9a716d56e..01ac9461a92c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport23.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport23.cxx @@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering) properties->setPropertyValue(u"ListAutoFormat"_ustr, uno::Any(aListAutoFormat)); // Export to docx. - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Paragraph 2 should have only one w:highlight written per w:rPr. Without the fix, there were two. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering) CPPUNIT_TEST_FIXTURE(Test, testTdf132766) { createSwDoc("tdf132766.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -121,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132766) CPPUNIT_TEST_FIXTURE(Test, testTdf128245) { createSwDoc("tdf128245.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -151,7 +151,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124367, "tdf124367.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf95189) { createSwDoc("tdf95189.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { uno::Reference xPara(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"1"_ustr, getProperty(xPara, u"ListLabelString"_ustr)); @@ -185,7 +185,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95189) CPPUNIT_TEST_FIXTURE(Test, testTdf128820) { createSwDoc("tdf128820.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Import of exported DOCX failed because of wrong namespace used for wsp element // Now test the exported XML, in case we stop failing opening invalid files xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); @@ -212,7 +212,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128820) CPPUNIT_TEST_FIXTURE(Test, testTdf128889) { createSwDoc("tdf128889.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXml); // There was an w:r (with w:br) as an invalid child of first paragraph's w:pPr @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128889) CPPUNIT_TEST_FIXTURE(Test, testTdf132754) { createSwDoc("tdf132754.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { uno::Reference xPara(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"0.0.0."_ustr, getProperty(xPara, u"ListLabelString"_ustr)); @@ -270,7 +270,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129353, "tdf129353.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf77796) { createSwDoc("tdf77796.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXml); // cell paddings from table style @@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77796) CPPUNIT_TEST_FIXTURE(Test, testTdf128290) { createSwDoc("tdf128290.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXml); @@ -386,7 +386,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133605_2, "tdf133605_2.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf123757) { createSwDoc("tdf123757.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(pXml); assertXPath(pXml, "/w:document/w:body/w:tbl", 2); @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123757) CPPUNIT_TEST_FIXTURE(Test, testTdf141172) { createSwDoc("tdf141172.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/endnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); // This was 1 (lost table during copying endnote content) @@ -405,7 +405,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141172) CPPUNIT_TEST_FIXTURE(Test, testTdf141548) { createSwDoc("tdf141548.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/endnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); // This was 0 (lost text content of the run with endnoteRef) @@ -417,7 +417,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141548) CPPUNIT_TEST_FIXTURE(Test, testTdf143399) { createSwDoc("tdf143399.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/footnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); // These were 0 (lost text content of documents both with footnotes and endnotes) @@ -436,7 +436,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143399) CPPUNIT_TEST_FIXTURE(Test, testTdf143583) { createSwDoc("tdf143583_emptyParaAtEndOfFootnote.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/footnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p", 2); @@ -451,7 +451,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143583) CPPUNIT_TEST_FIXTURE(Test, testTdf152203) { createSwDoc("tdf152203.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/footnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); @@ -469,7 +469,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152203) CPPUNIT_TEST_FIXTURE(Test, testTdf152506) { createSwDoc("tdf152506.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/footnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); @@ -487,7 +487,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152506) CPPUNIT_TEST_FIXTURE(Test, testTdf153255) { createSwDoc("tdf153255.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/footnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); @@ -523,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153255) CPPUNIT_TEST_FIXTURE(Test, testTdf153804) { createSwDoc("tdf153804.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXml = parseExport(u"word/footnotes.xml"_ustr); CPPUNIT_ASSERT(pXml); @@ -568,7 +568,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130088, "tdf130088.docx") CPPUNIT_ASSERT_EQUAL(1, getPages()); // check compatibility option in ODT export/import, too - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(1, getPages()); } @@ -615,7 +615,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf160518_ODT, "tdf160518_useWord2013TrackBottomHyp CPPUNIT_ASSERT_EQUAL(3, getPages()); // check compatibility option in ODT export/import, too - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(3, getPages()); } @@ -631,7 +631,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf160518_ODT_compatible, CPPUNIT_ASSERT_EQUAL(2, getPages()); // check compatibility option in ODT export/import, too - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -640,7 +640,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_page_in_default_paragraph_style) { // default paragraph style contains hyphenation settings createSwDoc("tdf160518_page_in_default_paragraph_style.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']", @@ -653,7 +653,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_auto_in_default_paragraph_style) { // default paragraph style contains hyphenation settings createSwDoc("tdf160518_auto_in_default_paragraph_style.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']", @@ -667,7 +667,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_page_in_text_body_style) { // text body style contains hyphenation settings createSwDoc("tdf160518_page_in_text_body_style.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']", @@ -680,7 +680,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_auto_in_text_body_style) { // text body style contains hyphenation settings createSwDoc("tdf160518_auto_in_text_body_style.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']", @@ -697,7 +697,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165354) return; createSwDoc("tdf165354.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was "except that it has an at" (hyphenation at the end of the page) assertXPath(pXmlDoc, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[9]", "portion", @@ -713,7 +713,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165354) CPPUNIT_TEST_FIXTURE(Test, testHyphenationAuto) { createSwDoc("hyphenation.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Explicitly set hyphenation=auto on document level xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); @@ -735,7 +735,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyphenationAuto) CPPUNIT_TEST_FIXTURE(Test, testStrikeoutGroupShapeText) { createSwDoc("tdf131776_StrikeoutGroupShapeText.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#131776: Check if strikeout is used in shape group texts xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); @@ -797,7 +797,7 @@ CPPUNIT_TEST_FIXTURE(Test, testStrikeoutGroupShapeText) CPPUNIT_TEST_FIXTURE(Test, testTdf131539) { createSwDoc("tdf131539.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); //The positions of OLE objects were not exported, check if now it is exported correctly @@ -812,7 +812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131539) CPPUNIT_TEST_FIXTURE(Test, testLineWidthRounding) { createSwDoc("tdf126363_LineWidthRounding.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#126363: check if line with stays the same after export xmlDocUniquePtr pXml = parseExport(u"word/document.xml"_ustr); // this was 57240 (it differs from the original 57150, losing the preset line width) @@ -825,7 +825,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineWidthRounding) CPPUNIT_TEST_FIXTURE(Test, testTdf108505) { createSwDoc("tdf108505.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xParagraph = getParagraph(3); uno::Reference xText = getRun(xParagraph, 1, u"Wrong font when alone on the line"_ustr); @@ -837,7 +837,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108505) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginHasHeader) { createSwDoc("tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // tdf#123324 The height was set relative to page print area top, // but this was handled relative to page height. // Note: page print area top = margin + header height. @@ -849,7 +849,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginHasHeader) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginNoHeader) { createSwDoc("tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // tdf#123324 The height was set relative from top margin, but this was handled relative from page height. // Note: the MSO Word margin = LO margin + LO header height. // In this case the header does not exist, so MSO Word margin and LO Writer margin are the same. @@ -865,7 +865,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginNoHeader) CPPUNIT_TEST_FIXTURE(Test, testTdf64531) { createSwDoc("tdf64531.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OString sPathToTabs = "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:pPr/w:tabs/"_ostr; assertXPath(pXmlDoc, sPathToTabs + "w:tab[1]", "pos", u"720"); @@ -889,7 +889,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlLineShapeMirroredX) { // tdf#97517 The "flip:x" was not handled for VML line shapes. createSwDoc("tdf97517_testVmlLineShapeMirroredX.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OUString sStyle = getXPath( pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line", @@ -901,7 +901,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlLineShapeMirroredY) { // tdf#137678 The "flip:y" was not handled for VML line shapes. createSwDoc("tdf137678_testVmlLineShapeMirroredY.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OUString sStyle = getXPath( pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line", @@ -912,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlLineShapeMirroredY) CPPUNIT_TEST_FIXTURE(Test, testVmlLineShapeRotated) { createSwDoc("tdf137765_testVmlLineShapeRotated.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#137765 The "rotation" (in style attribute) was not handled correctly for VML line shapes. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // it was 1.55pt,279.5pt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport24.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport24.cxx index c40e11db1124..ba5056fb1728 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport24.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport24.cxx @@ -48,7 +48,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf104115) { createSwDoc("tdf104115.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This found 0 nodes: the custom geometry was not written for the Bezier // curve -> Word refused to open the document. @@ -72,7 +72,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103651, "tdf103651.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf99227) { createSwDoc("tdf99227.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // A drawing anchored as character to a footnote caused write past end of document.xml at export to docx. // After that, importing after export failed with // SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word / document.xml', @@ -261,7 +261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote) }; createSwDoc("tdf55427_footnote2endnote.odt"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -313,7 +313,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf106001_2) { createSwDoc("tdf106001-2.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // In test ODT CharScaleWidth = 900, this was not changed upon OOXML export to stay in [1..600], now it's clamped to 600 // Note: we disregard what's set in pPr / rPr and only care about r / rPr @@ -407,7 +407,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121670_columnsInSectionsOnly, CPPUNIT_TEST_FIXTURE(Test, testTdf106492) { createSwDoc("tdf106492.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 4: an additional sectPr was added to the document. assertXPath(pXmlDoc, "//w:sectPr", 3); @@ -440,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107889) }; createSwDoc("tdf107889.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } #endif @@ -448,7 +448,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107889) CPPUNIT_TEST_FIXTURE(Test, testTdf107837) { createSwDoc("tdf107837.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), @@ -461,7 +461,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107837) CPPUNIT_TEST_FIXTURE(Test, testTdf107684) { createSwDoc("tdf107684.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); // This was 1, was duplicated for Heading1. @@ -471,7 +471,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107684) CPPUNIT_TEST_FIXTURE(Test, testTdf107618) { createSwDoc("tdf107618.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This was false, header was lost on export. uno::Reference xPageStyle( getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); @@ -519,7 +519,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105095, "tdf105095.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf106062_nonHangingFootnote) { createSwDoc("tdf106062_nonHangingFootnote.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFootnotes = xFootnotesSupplier->getFootnotes(); @@ -596,7 +596,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXCheckbox, "activex_checkbox.docx") CPPUNIT_TEST_FIXTURE(Test, testActiveXControlAlign) { createSwDoc("activex_control_align.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // First check box aligned as a floating object @@ -689,7 +689,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf111964) { createSwDoc("tdf111964.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Unicode spaces that are not XML whitespace must not be trimmed assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:t", vEnSpaces); @@ -712,7 +712,7 @@ DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark-shapetype.docx") CPPUNIT_TEST_FIXTURE(Test, testActiveXControlAtRunEnd) { createSwDoc("activex_control_at_run_end.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Two issues were here: @@ -775,7 +775,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXOptionButtonGroup, "activex_option_button_gr CPPUNIT_TEST_FIXTURE(Test, tdf112169) { createSwDoc("tdf112169.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(6, getPages()); // LO crashed while export because of character background color handling @@ -790,7 +790,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf112169) CPPUNIT_TEST_FIXTURE(Test, testTdf103090) { createSwDoc("tdf103090.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -811,7 +811,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103090) CPPUNIT_TEST_FIXTURE(Test, testTdf107111) { createSwDoc("tdf107111.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Ensure that hyperlink and its properties are in place. @@ -937,7 +937,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf137593) { createSwDoc("tdf137593.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // zero auto spacing, if the first paragraph contains text boxes @@ -949,7 +949,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137593) CPPUNIT_TEST_FIXTURE(Test, testTdf115557) { createSwDoc("tdf115557.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // A chart anchored to a footnote multiplied during import xmlDocUniquePtr pXmlDoc = parseExport(u"word/footnotes.xml"_ustr); @@ -959,7 +959,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115557) CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginDML) { createSwDoc("tdf137641_RelativeFromTopMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Import as DML. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -992,7 +992,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginDML) CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginVML) { createSwDoc("tdf137642_Vertical_Alignment_toppage.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Import as VML. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1025,7 +1025,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginVML) CPPUNIT_TEST_FIXTURE(Test, testVmlShapeWithTextbox) { createSwDoc("tdf41466_testVmlShapeWithTextbox.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Import as VML. // tdf#41466: check whether VML DOCX shape with text is imported as shape with a text frame // (text box). These kind of shapes were imported only as text frames previously, losing the @@ -1043,7 +1043,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlShapeWithTextbox) CPPUNIT_TEST_FIXTURE(Test, testLayoutFlowAltAlone) { createSwDoc("layout-flow-alt-alone.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // moved from oox/qa/unit/vml.cxx // FIXME: now the DML part is checked, but we should check VML part in Fallback (too) xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx index c9442987510b..e8d29ac4e07a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx @@ -128,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf169413_asciiTheme) { // the document failed to reload without errors after a round-trip createSwDoc("tdf169413_asciiTheme.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testTdf166620) @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) // Exporting to a Word format, a tab is prepended to the endnote text. When imported, the // NoGapAfterNoteNumber compatibility flag is enabled; and the exported tab is the only thing // that separates the number and the text. The tab must not be stripped away on import. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) CPPUNIT_ASSERT_EQUAL(u"\tEndnote text"_ustr, xEndnoteText->getString()); } // Do a second round-trip. It must not duplicate the tab. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -173,7 +173,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) xEndnoteText->setString(u"Endnote text"_ustr); } // Do a third round-trip. It must not introduce the tab, because of the compatibility flag. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167082) // - Actual : Standard createSwDoc("tdf167082.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); OUString aStyleName = getProperty(getParagraph(3), u"ParaStyleName"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), aStyleName); @@ -205,7 +205,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableAnchorPosExport) // Given a document with two floating tables after each other: // When saving that document to DOCX: createSwDoc("floattable-anchorpos.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the dummy anchor of the first floating table is not written to the export // result: @@ -239,7 +239,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167297) }; fnVerify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); fnVerify(); } @@ -258,7 +258,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167583) fnVerify(true); // Check that the value is persisted across save-reload - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); fnVerify(true); // Unset the compat flag @@ -270,7 +270,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167583) } fnVerify(false); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); fnVerify(false); } @@ -286,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150822) }; fnVerify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); fnVerify(); } @@ -294,7 +294,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWNumDuplication) { // Given a document that changes a lot between a few numbering styles and overrides: createSwDoc("mixednumberings.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that we export a reasonable number of "w:num" elements: xmlDocUniquePtr pXmlNum = parseExport(u"word/numbering.xml"_ustr); @@ -307,7 +307,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWNumDuplication) CPPUNIT_TEST_FIXTURE(Test, testTdf169274) { createSwDoc("tdf169274.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); const OString sPath = "//w:body/w:tbl/w:tr/w:tc/w:p/w:sdt/"_ostr; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index c3256b3f7679..73449804e5fd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -77,7 +77,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92470_footnoteRestart, "tdf92470_footnoteRestart CPPUNIT_TEST_FIXTURE(Test, testTdf108944_footnoteSeparator2) { createSwDoc("tdf108944_footnoteSeparator2.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xPageStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); //This was zero. The comment was causing the bHasFtnSep flag to be reset to false, so the separator was missing. @@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108944_footnoteSeparator2) CPPUNIT_TEST_FIXTURE(Test, testCharacterBorder) { createSwDoc("charborder.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xRun(getRun(getParagraph(1),1), uno::UNO_QUERY); // OOXML has just one border attribute () for text border so all side has @@ -142,7 +142,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCharacterBorder) CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance) { createSwDoc("style-inheritance.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Check that now styleId's are more like what MSO produces xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); @@ -243,7 +243,7 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance) CPPUNIT_TEST_FIXTURE(Test, testCalendar1) { createSwDoc("calendar1.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Document has a non-trivial table style, test the roundtrip of it. xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:basedOn", "val", u"TableNormal"); @@ -291,7 +291,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCalendar2) createSwDoc("calendar2.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); // This paragraph property was missing in table style. @@ -358,7 +358,7 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar5, "calendar5.docx") CPPUNIT_TEST_FIXTURE(Test, testTcBorders) { createSwDoc("testTcBorders.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //fdo#76635 : Table borders are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -377,7 +377,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTcBorders) CPPUNIT_TEST_FIXTURE(Test, testQuicktables) { createSwDoc("quicktables.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); // These were missing in the Calendar3 table style. @@ -407,7 +407,7 @@ CPPUNIT_TEST_FIXTURE(Test, testQuicktables) CPPUNIT_TEST_FIXTURE(Test, testFdo71302) { createSwDoc("fdo71302.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); // This got renamed to "Strong Emphasis" without a good reason. @@ -502,7 +502,7 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") CPPUNIT_TEST_FIXTURE(Test, testFontNameIsEmpty) { createSwDoc("font-name-is-empty.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Check no empty font name is exported // This test does not fail, if the document contains a font with empty name. @@ -523,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontNameIsEmpty) CPPUNIT_TEST_FIXTURE(Test, testMultiColumnLineSeparator) { createSwDoc("multi-column-line-separator-SAVED.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Check for the Column Separator value.It should be FALSE as the document does not contain separator line. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols","sep",u"false"); @@ -561,7 +561,7 @@ DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx") CPPUNIT_TEST_FIXTURE(Test, testCustomXmlRelationships) { createSwDoc("customxml.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"customXml/_rels/item1.xml.rels"_ustr); // Check there is a relation to itemProps1.xml. @@ -572,7 +572,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomXmlRelationships) CPPUNIT_TEST_FIXTURE(Test, testFdo69644) { createSwDoc("fdo69644.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the exporter exported the table definition // with only 3 columns, instead of 5 columns. // Check that the table grid is exported with 5 columns @@ -589,7 +589,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx") CPPUNIT_TEST_FIXTURE(Test, testPgMargin) { createSwDoc("testPgMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", u"1440"); } @@ -703,7 +703,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextBoxGradientAngle, "fdo65295.docx") CPPUNIT_TEST_FIXTURE(Test, testCellGridSpan) { createSwDoc("cell-grid-span.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was during export gridSpan value for 1st & 2nd cells for test document // used to get set wrongly to 5 and 65532 respectively which was the reason for crash during save operation // Verifying gridSpan element is not present in RoundTripped Document (As it's Default value is 1). @@ -727,7 +727,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx") CPPUNIT_TEST_FIXTURE(Test, testParaAutoSpacing) { createSwDoc("para-auto-spacing.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing",u"1"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "afterAutospacing",u"1"); @@ -789,7 +789,7 @@ DECLARE_OOXMLEXPORT_TEST(testPNGImageCrop, "test_PNG_ImageCrop.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf41542_imagePadding) { createSwDoc("tdf41542_imagePadding.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // borderlessImage - image WITHOUT BORDERS : simulate padding with -crop @@ -812,7 +812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf41542_imagePadding) CPPUNIT_TEST_FIXTURE(Test, testFootnoteParagraphTag) { createSwDoc("testFootnote.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* In footnotes.xml, the paragraph tag inside was getting written into document.xml. * Check for, paragraph tag is correctly written into footnotes.xml. */ @@ -824,7 +824,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFootnoteParagraphTag) CPPUNIT_TEST_FIXTURE(Test, testSpacingLineRule) { createSwDoc("table_lineRule.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "lineRule", u"auto"); } @@ -832,7 +832,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSpacingLineRule) CPPUNIT_TEST_FIXTURE(Test, testTableLineSpacing) { createSwDoc("table_atleast.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:spacing", "line", u"320"); } @@ -853,7 +853,7 @@ DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") CPPUNIT_TEST_FIXTURE(Test, testThemePreservation) { createSwDoc("theme-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check default font theme values have been preserved xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", u"minorHAnsi"); @@ -904,7 +904,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemePreservation) CPPUNIT_TEST_FIXTURE(Test, testTableThemePreservation) { createSwDoc("table-theme-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // check cell theme colors have been preserved @@ -958,7 +958,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableThemePreservation) CPPUNIT_TEST_FIXTURE(Test, testcantSplit) { createSwDoc("2_table_doc.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // if Split table value is true for a table then during export do not write // in table row property,As default row prop is allow row to break across page. // writing during export was causing problem that all the cell data used to come on same page @@ -970,7 +970,7 @@ CPPUNIT_TEST_FIXTURE(Test, testcantSplit) CPPUNIT_TEST_FIXTURE(Test, testDontSplitTable) { createSwDoc("tdf101589_dontSplitTable.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); //single row tables need to prevent split by setting row to no split xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -1001,7 +1001,7 @@ DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx") CPPUNIT_TEST_FIXTURE(Test, testcolumnbreak) { createSwDoc("columnbreak.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty(getParagraph(5, u"This is first line after col brk."_ustr), u"BreakType"_ustr)); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[1]/w:br", "type", u"column"); @@ -1010,7 +1010,7 @@ CPPUNIT_TEST_FIXTURE(Test, testcolumnbreak) CPPUNIT_TEST_FIXTURE(Test, testGlossary) { createSwDoc("testGlossary.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/glossary/document.xml"_ustr); assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", u"w14 wp14"); } @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGlossaryWithEmail) { // tdf#152289 createSwDoc("glossaryWithEmail.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/glossary/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId4' " "and @Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' " @@ -1040,7 +1040,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx") CPPUNIT_TEST_FIXTURE(Test, testCrashWhileSave) { createSwDoc("testCrashWhileSave.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/footer1.xml"_ustr); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle", "val").match("Normal")); } @@ -1048,7 +1048,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCrashWhileSave) CPPUNIT_TEST_FIXTURE(Test, testFileOpenInputOutputError) { createSwDoc("floatingtbl_with_formula.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Docx containing Floating table with formula was giving "General input/output error" while opening in LibreOffice xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", u"Normal"); @@ -1060,7 +1060,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFileOpenInputOutputError) CPPUNIT_TEST_FIXTURE(Test, testSingleCellTableBorders) { createSwDoc("tdf124399_SingleCellTableBorders.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#124399: Extra borders on single cell tables fixed. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1071,7 +1071,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSingleCellTableBorders) CPPUNIT_TEST_FIXTURE(Test, testInsideBorders) { createSwDoc("tdf129242_InsideBorders.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#129242: Don't remove inside borders if the table has more than one cells. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1083,7 +1083,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsideBorders) CPPUNIT_TEST_FIXTURE(Test, testRightBorder) { createSwDoc("tdf129442_RightBorder.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#129442: Right border of a one column table was missing. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1095,7 +1095,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRightBorder) CPPUNIT_TEST_FIXTURE(Test, testBottomBorder) { createSwDoc("tdf129450_BottomBorder.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#129450: Missing bottom border in one row table. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1107,7 +1107,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBottomBorder) CPPUNIT_TEST_FIXTURE(Test, testBottomBorders) { createSwDoc("tdf129452_BottomBorders.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#129452: Do not omit bottom borders when a column in a table is vertically merged and // the inside borders are turned off. @@ -1123,7 +1123,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBottomBorders) CPPUNIT_TEST_FIXTURE(Test, testFontTypes) { createSwDoc("tdf120344_FontTypes.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#120344: Font type of numbering symbols can be different than the font type of the text. // Check the font type of the text, should be Consolas. @@ -1138,7 +1138,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontTypes) CPPUNIT_TEST_FIXTURE(Test, testNumberingLevels) { createSwDoc("tdf95495.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // tdf#95495: set list level of the custom style based on the setting of the parent style @@ -1158,7 +1158,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingLevels) CPPUNIT_TEST_FIXTURE(Test, testVerticalBorders) { createSwDoc("calendar3.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#130799: Inside vertical borders of a table should not be missing. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1169,7 +1169,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVerticalBorders) CPPUNIT_TEST_FIXTURE(Test, testArrowFlipXY) { createSwDoc("tdf100751_arrowBothFlip.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#100751: Both x and y flip should happen. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1184,7 +1184,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArrowFlipXY) CPPUNIT_TEST_FIXTURE(Test, testArrowPosition) { createSwDoc("tdf104565_ArrowPosition.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#104565: Test correct position. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1196,7 +1196,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArrowPosition) CPPUNIT_TEST_FIXTURE(Test, testArrowMarker) { createSwDoc("tdf123346_ArrowMarker.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#123346: Check arrow marker. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1208,7 +1208,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArrowMarker) CPPUNIT_TEST_FIXTURE(Test, testShapeLineWidth) { createSwDoc("tdf92526_ShapeLineWidth.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#92526: Make sure that line with stays 0. @@ -1222,7 +1222,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeLineWidth) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromLeftMargin) { createSwDoc("tdf132976_testRelativeAnchorWidthFromLeftMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#132976 The size of the width of this shape should come from the size of the left margin. // It was set to the size of the width of the entire page before. xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -1232,7 +1232,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromLeftMargin) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromInsideOutsideMargin) { createSwDoc("tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#133863 tdf#133864 The sizes of the width of these shapes depend on the sizes of the inside and outside margins. // The open book: outside --text-- inside | inside --text-- outside xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -1249,7 +1249,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromInsideOutsideMargin) CPPUNIT_TEST_FIXTURE(Test, testBodyPrUpright) { createSwDoc("tdf123610_handle_upright.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#123610: Check grab-bag attribute upright to keep text upright regardless of shape rotation. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1261,7 +1261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBodyPrUpright) CPPUNIT_TEST_FIXTURE(Test, testLostArrow) { createSwDoc("tdf99810-lost-arrow.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#99810: check whether we use normal shape instead of connector shape if the XML namespace diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 1b9090dbacb3..20e33b03801a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -64,14 +64,14 @@ CPPUNIT_TEST_FIXTURE(Test, testRelorientation) createSwDoc("relorientation.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testBezier) { createSwDoc("bezier.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Check that no shape got lost: a bezier, a line and a text shape. CPPUNIT_ASSERT_EQUAL(3, getShapes()); @@ -105,7 +105,7 @@ DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx") CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedParagraphMark) { createSwDoc("testTrackChangesDeletedParagraphMark.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); } @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedParagraphMark) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedParagraphMark) { createSwDoc("testTrackChangesInsertedParagraphMark.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins"); } @@ -121,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedParagraphMark) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableRow) { createSwDoc("testTrackChangesDeletedTableRow.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:del"); } @@ -129,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableRow) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableRow) { createSwDoc("testTrackChangesInsertedTableRow.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins"); } @@ -137,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableRow) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableCell) { createSwDoc("testTrackChangesDeletedTableCell.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellDel"); } @@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableCell) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableCell) { createSwDoc("testTrackChangesInsertedTableCell.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellIns"); } @@ -168,7 +168,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextBoxPictureFill, "textbox_picturefill.docx") CPPUNIT_TEST_FIXTURE(Test, testFDO73034) { createSwDoc("FDO73034.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:u", "val").match("single")); } @@ -176,7 +176,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO73034) CPPUNIT_TEST_FIXTURE(Test, testFDO71834) { createSwDoc("fdo71834.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", u"dxa"); } @@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO71834) CPPUNIT_TEST_FIXTURE(Test, testTrackChangesParagraphProperties) { createSwDoc("testTrackChangesParagraphProperties.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0); } @@ -192,7 +192,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesParagraphProperties) CPPUNIT_TEST_FIXTURE(Test, testMsoSpt180) { createSwDoc("mso-spt180.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xGroup(getShape(1), uno::UNO_QUERY); const uno::Sequence aProps = getProperty< uno::Sequence >(xGroup->getByIndex(0), u"CustomShapeGeometry"_ustr); OUString aType; @@ -206,7 +206,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMsoSpt180) CPPUNIT_TEST_FIXTURE(Test, testFdo73550) { createSwDoc("fdo73550.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // This was wrap="none". assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts"); @@ -249,7 +249,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableRowDataDisplayedTwice, "table-row-data-display CPPUNIT_TEST_FIXTURE(Test, testFdo73556) { createSwDoc("fdo73556.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * The file contains a table with 3 columns * the gridcols are as follows: {1210, 1331, 1210} @@ -270,7 +270,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73556) CPPUNIT_TEST_FIXTURE(Test, testSegFaultWhileSave) { createSwDoc("test_segfault_while_save.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // fdo#74499 xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT_EQUAL(static_cast(6138), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32()); @@ -279,7 +279,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSegFaultWhileSave) CPPUNIT_TEST_FIXTURE(Test, fdo69656) { createSwDoc("Table_cell_auto_width_fdo69656.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Changed the UT to check "dxa" instead of "auto" // For this particular issue file few cells have width type "auto" // LO supports VARIABLE and FIXED width type. @@ -295,7 +295,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo69656) CPPUNIT_TEST_FIXTURE(Test, testFdo76741) { createSwDoc("fdo76741.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // There are two issue related to table in the saved(exported) file // - the table alignment in saved file is "left" instead of "center" @@ -311,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76741) CPPUNIT_TEST_FIXTURE(Test, testFdo73541) { createSwDoc("fdo73541.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // fdo#73541: The mirrored margins were not imported and mapped correctly in Page Layout // Hence tag was not exported back in settings.xml xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); @@ -321,7 +321,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73541) CPPUNIT_TEST_FIXTURE(Test, testFdo106029) { createSwDoc("fdo106029.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn"); } @@ -329,7 +329,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo106029) CPPUNIT_TEST_FIXTURE(Test, testTdf146515) { createSwDoc("tdf146515.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:usePrinterMetrics"); } @@ -337,7 +337,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146515) CPPUNIT_TEST_FIXTURE(Test, testFDO74106) { createSwDoc("FDO74106.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val",u"hebrew1"); } @@ -345,7 +345,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO74106) CPPUNIT_TEST_FIXTURE(Test, testFDO74215) { createSwDoc("FDO74215.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); // tdf#106849 NumPicBullet xShape should not be resized. @@ -383,7 +383,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnBreak_ColumnCountIsZero) * The was missing after roundtrip */ createSwDoc("fdo74153.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br", "type", u"column"); @@ -410,7 +410,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90697_complexBreaksHeaders,"tdf90697_complexBrea CPPUNIT_TEST_FIXTURE(Test, testIndentation) { createSwDoc("test_indentation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // fdo#74141 :There was a problem that in style.xml and document.xml in tag "right" & "left" margin // attributes gets added(w:right=0 & w:left=0) if these attributes are not set in original document. // This test is to verify does not contain w:right attribute. @@ -421,7 +421,7 @@ CPPUNIT_TEST_FIXTURE(Test, testIndentation) CPPUNIT_TEST_FIXTURE(Test, testChartInFooter) { createSwDoc("chart-in-footer.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // fdo#73872: document contains chart in footer. // The problem was that footer1.xml.rels files for footer1.xml // files were missing from docx file after roundtrip. @@ -458,7 +458,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChartInFooter) CPPUNIT_TEST_FIXTURE(Test, testNestedTextFrames) { createSwDoc("nested-text-frames.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // First problem was LO crashed during export (crash test) @@ -494,7 +494,7 @@ DECLARE_OOXMLEXPORT_TEST(testFloatingTablePosition, "floating-table-position.doc CPPUNIT_TEST_FIXTURE(Test, testAbi11739) { createSwDoc("abi11739.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Validation test: order of elements were wrong. xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); // Order was: uiPriority, link, basedOn. @@ -515,7 +515,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedXlsx) createSwDoc("embedded-xlsx.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); // check the objects are present in the exported document.xml @@ -541,7 +541,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedXlsx) CPPUNIT_TEST_FIXTURE(Test, testNumberedLists_StartingWithZero) { createSwDoc("FDO74105.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Issue : Numbered lists Starting with value '0' is not preserved after RT. * In numbering.xml, an XML tag is optional. If not mentioned, * the Numbered list should start from 0. @@ -556,7 +556,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberedLists_StartingWithZero) CPPUNIT_TEST_FIXTURE(Test, testPageBreak) { createSwDoc("fdo74566.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); /* Break to next page was written into wrong paragraph as . * LO was not preserving Page Break as . * Now after fix , LO writes Page Break as the new paragraph and also @@ -575,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBreak) CPPUNIT_TEST_FIXTURE(Test, testOleObject) { createSwDoc("test_ole_object.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata", @@ -604,7 +604,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOleObject) CPPUNIT_TEST_FIXTURE(Test, testFdo74792) { createSwDoc("fdo74792.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * fdo#74792 : The images associated with smart-art data[i].xml * were not preserved on exporting to DOCX format @@ -623,7 +623,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74792) CPPUNIT_TEST_FIXTURE(Test, testFdo77718) { createSwDoc("fdo77718.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //in case of multiple smart arts the names for images were getting //repeated and thereby causing a data loss as the binary stream was //getting over written. This test case ensures that unique names are @@ -650,7 +650,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77718) CPPUNIT_TEST_FIXTURE(Test, testTableCurruption) { createSwDoc("tableCurrupt.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header2.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc) ; assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]",1); @@ -669,7 +669,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCurruption) CPPUNIT_TEST_FIXTURE(Test, testDateControl) { createSwDoc("date-control.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check XML xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", u"2014-03-05T00:00:00Z"); @@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateControl) CPPUNIT_TEST_FIXTURE(Test, test_Tdf115030) { createSwDoc("tdf115030.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:acc/m:accPr/m:chr", "val", u"\u02D9"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[2]/m:acc/m:accPr/m:chr", "val", u"\u00A8"); @@ -691,7 +691,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_Tdf115030) CPPUNIT_TEST_FIXTURE(Test, test_OpeningBrace) { createSwDoc("2120112713_OpenBrace.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Checking for OpeningBrace tag assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[1]/m:dPr[1]/m:begChr[1]","val",u""); @@ -700,7 +700,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_OpeningBrace) CPPUNIT_TEST_FIXTURE(Test, test_Tdf132305) { createSwDoc("tdf132305.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:bar/m:barPr/m:pos","val",u"top"); } @@ -743,7 +743,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_Tdf132305) CPPUNIT_TEST_FIXTURE(Test, testTdf38778) { createSwDoc("tdf38778_properties_in_run_for_field.doc"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); static constexpr std::u16string_view psz(u"20"); @@ -779,7 +779,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf38778) CPPUNIT_TEST_FIXTURE(Test, testFDO76312) { createSwDoc("FDO76312.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]"); @@ -823,7 +823,7 @@ void Test::verifyComboBoxExport(bool aComboBoxAsDropDown) CPPUNIT_TEST_FIXTURE(Test, testComboBoxControl) { createSwDoc("combobox-control.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check XML xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", u"manolo"); @@ -861,7 +861,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_false) CPPUNIT_TEST_FIXTURE(Test, testCheckBoxControl) { createSwDoc("checkbox-control.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check XML xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", u"1"); @@ -874,7 +874,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckBoxControl) CPPUNIT_TEST_FIXTURE(Test, testParagraphWithComments) { createSwDoc("paragraphWithComments.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Comment id's were getting overwritten for annotation mark(s), which was causing a mismatch in the relationship for comment id's in document.xml and comment.xml @@ -890,7 +890,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphWithComments) CPPUNIT_TEST_FIXTURE(Test, testTdf104707_urlComment) { createSwDoc("tdf104707_urlComment.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -907,7 +907,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104707_urlComment) CPPUNIT_TEST_FIXTURE(Test, testOLEObjectinHeader) { createSwDoc("2129393649.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // fdo#76015 : Document contains oleobject in header xml. // Problem was relationship entry for oleobject from header was // exported into document.xml.rels file because of this rels file @@ -940,7 +940,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOLEObjectinHeader) CPPUNIT_TEST_FIXTURE(Test, test_ClosingBrace) { createSwDoc("2120112713.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Checking for ClosingBrace tag assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[2]/m:dPr[1]/m:endChr[1]","val",u""); @@ -954,7 +954,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_ClosingBrace) CPPUNIT_TEST_FIXTURE(Test, testlvlPicBulletId) { createSwDoc("lvlPicBulletId.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]", 0); } @@ -962,7 +962,7 @@ CPPUNIT_TEST_FIXTURE(Test, testlvlPicBulletId) CPPUNIT_TEST_FIXTURE(Test, testSdtContent) { createSwDoc("SdtContent.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header1.xml"_ustr); // assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt/w:sdtContent[1]/w:del[1]"); } @@ -974,7 +974,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtContent) CPPUNIT_TEST_FIXTURE(Test, testFdo76016) { createSwDoc("fdo76016.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check XML xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1"); @@ -985,7 +985,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76016) CPPUNIT_TEST_FIXTURE(Test, testFileWithInvalidImageLink) { createSwDoc("FileWithInvalidImageLink.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* In case if the original file has an image whose link is invalid, then the RT file used to result in corruption since the exported image would be an empty image. @@ -1001,7 +1001,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFileWithInvalidImageLink) CPPUNIT_TEST_FIXTURE(Test, testContentTypeDOCX) { createSwDoc("fdo80410.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, @@ -1025,7 +1025,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeDOCX) CPPUNIT_TEST_FIXTURE(Test, testContentTypeXLSM) { createSwDoc("fdo76098.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "ContentType", u"application/vnd.ms-excel.sheet.macroEnabled.12"); @@ -1047,7 +1047,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeXLSM) CPPUNIT_TEST_FIXTURE(Test, test76108) { createSwDoc("test76108.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); //docx file after RT is getting corrupted. assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]", "fldCharType", u"begin"); @@ -1056,7 +1056,7 @@ CPPUNIT_TEST_FIXTURE(Test, test76108) CPPUNIT_TEST_FIXTURE(Test, testTCTagMisMatch) { createSwDoc("TCTagMisMatch.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // TCTagMisMatch.docx : This document contains an empty table with borders. // there was a TC tag mismatch which resulted into a crash. @@ -1068,7 +1068,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTCTagMisMatch) CPPUNIT_TEST_FIXTURE(Test, testFDO78292) { createSwDoc("FDO78292.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //text node is a leaf node, it should not have any children xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0); @@ -1077,7 +1077,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78292) CPPUNIT_TEST_FIXTURE(Test, testSimpleSdts) { createSwDoc("simple-sdts.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text", 1); @@ -1091,7 +1091,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSimpleSdts) CPPUNIT_TEST_FIXTURE(Test, testEmbeddedExcelChart) { createSwDoc("EmbeddedExcelChart.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, @@ -1117,7 +1117,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedExcelChart) CPPUNIT_TEST_FIXTURE(Test, testTdf83227) { createSwDoc("tdf83227.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Bug document contains a rotated image, which is handled as a draw shape (not as a Writer image) on export. uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName(u"word/media/image1.png"_ustr))); @@ -1128,7 +1128,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf83227) CPPUNIT_TEST_FIXTURE(Test, testTdf103001) { createSwDoc("tdf103001.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The same image is featured in the header and in the body text, make sure // the header relation is still written, even when caching is enabled. uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); @@ -1140,7 +1140,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103001) CPPUNIT_TEST_FIXTURE(Test, testTdf92521) { createSwDoc("tdf92521.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // There should be a section break that's in the middle of the document: right after the table. @@ -1188,7 +1188,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf99090_pgbrkAfterTable) { createSwDoc("tdf99090_pgbrkAfterTable.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // There should be a regular page break that's in the middle of the document: right after the table. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); @@ -1283,7 +1283,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original, "tdf81345.docx") CPPUNIT_TEST_FIXTURE(Test, testDocxTablePosition) { createSwDoc("floating-table-position.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // the exported positions were wrong due to some missing shifting in the export code @@ -1295,7 +1295,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxTablePosition) CPPUNIT_TEST_FIXTURE(Test, testUnderlineGroupShapeText) { createSwDoc("tdf123351_UnderlineGroupSapeText.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#123351: Check if correct underline is used. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1349,7 +1349,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnderlineGroupShapeText) CPPUNIT_TEST_FIXTURE(Test, testUnderlineColorGroupedShapes) { createSwDoc("tdf132491_UnderlineColorGroupedShapes.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#132491 : Check if correct color is used for underline. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" @@ -1363,7 +1363,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnderlineColorGroupedShapes) CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromRightMargin) { createSwDoc("tdf133670_testRelativeAnchorWidthFromRightMargin.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#133670 The width was set relative from right margin, but this was handled relative from page width. xmlDocUniquePtr pXmlDoc = parseLayoutDump(); auto nWidth = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width").toInt32(); @@ -1373,7 +1373,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromRightMargin) CPPUNIT_TEST_FIXTURE(Test, testAutoFitForLegacyShapes) { createSwDoc("tdf112312_AutoFitForLegacyShapes.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // tdf#112312: check if noAutoFit is used instead of spAutoFit even if the TextAutoGrowHeight is set xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 04d3b11d37d8..a473364369dd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -29,7 +29,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testFDO76248) { createSwDoc("FDO76248.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // In two cases the a:graphicData elements had no children, which is invalid. assertXPath(pXmlDoc, "//a:graphicData[not(*)]", 0); @@ -77,7 +77,7 @@ DECLARE_OOXMLEXPORT_TEST(testTscp, "tscp.docx") CPPUNIT_TEST_FIXTURE(Test, testfdo76589 ) { createSwDoc("fdo76589.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Numbered list was not preserve after RT. * In numbering.xml, when NumberingType is "decimal" and level is zero, * w:val of w:lvlText was empty. @@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo76589 ) CPPUNIT_TEST_FIXTURE(Test, testDecimalNumberingNoLeveltext) { createSwDoc("decimal-numbering-no-leveltext.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This was "%1", not empty: we turned a kind-of-none numbering into a decimal one. xmlDocUniquePtr pXmlDoc = parseExport(u"word/numbering.xml"_ustr); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val",u""); @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDecimalNumberingNoLeveltext) CPPUNIT_TEST_FIXTURE(Test, testNoDuplicateAttributeExport) { createSwDoc("duplicate-east-asia.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // File asserting while saving in LO. @@ -110,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoDuplicateAttributeExport) CPPUNIT_TEST_FIXTURE(Test, testfdo79008) { createSwDoc("fdo79008.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); /* File crashing while saving in LO. * Check if document.xml file is created after fix */ @@ -130,7 +130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120852_readOnlyProtection) // Read-only is set, so Enforcement must enable it. CPPUNIT_ASSERT(getSwDocShell()->IsSecurityOptOpenReadOnly()); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT(getSwDocShell()->IsSecurityOptOpenReadOnly()); @@ -168,14 +168,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120852_readOnlyUnProtected) createSwDoc("tdf120852_readOnlyUnProtected.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testAuthorPropertySdt) { createSwDoc("author-property.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", u"/ns1:coreProperties[1]/ns0:creator[1]"); @@ -188,7 +188,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAuthorPropertySdt) CPPUNIT_TEST_FIXTURE(Test, testFDO76586) { createSwDoc("fdo76586.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * In the test file gridCol had only one value for entire table width * while there are two cells in a table row. @@ -204,7 +204,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76586) CPPUNIT_TEST_FIXTURE(Test, testFDO76587 ) { createSwDoc("fdo76587.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "line", u"240"); assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "lineRule", u"auto"); @@ -213,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76587 ) CPPUNIT_TEST_FIXTURE(Test, testFDO77890 ) { createSwDoc("fdo77890.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Ensure that the page break is preserved i.e it should not be converted to a section break, in case if the different first page is set for the pages in the document. @@ -226,7 +226,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77890 ) CPPUNIT_TEST_FIXTURE(Test, testNumberedList) { createSwDoc("NumberedList.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); //fdo74150:In document.xml, for pStyle = "NumberedList1", iLvl and numId was not preserved xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:pStyle", "val", u"NumberedList1"); @@ -241,7 +241,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberedList) CPPUNIT_TEST_FIXTURE(Test, testTdf131819) { createSwDoc("NumberedList.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // keep width of fixed size cells in the nested table xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 4030 and 4249. @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131819) CPPUNIT_TEST_FIXTURE(Test, testTdf131959) { createSwDoc("NumberedList.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // import tblInd from table style xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 0. @@ -263,7 +263,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131959) CPPUNIT_TEST_FIXTURE(Test, testTdf131203) { createSwDoc("tdf131203.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // loading thrown divide_by_zero() assertXPath(pXmlDoc, "//w:tbl", 2); @@ -272,7 +272,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131203) CPPUNIT_TEST_FIXTURE(Test, testFDO76597) { createSwDoc("fdo76597.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // check XML xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", u"96"); @@ -282,7 +282,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76597) CPPUNIT_TEST_FIXTURE(Test, testContentTypeTIF) { createSwDoc("fdo77476.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tiff']", "PartName", u"/word/media/image1.tif"); @@ -299,7 +299,7 @@ DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx") CPPUNIT_TEST_FIXTURE(Test, testFloatingTable) { createSwDoc("fdo77887.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "horzAnchor", u"margin"); @@ -316,7 +316,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTable) CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeRight) { createSwDoc("tdf90681-1.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -329,7 +329,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeRight) CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeleft) { createSwDoc("tdf90681-2.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -340,7 +340,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeleft) CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeTableInTable) { createSwDoc("ooo96040-2.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); parseExport(u"word/document.xml"_ustr); // Check tdf#161202 - this document has all kinds of tables inside hidden sections. @@ -353,7 +353,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeTableInTable) CPPUNIT_TEST_FIXTURE(Test, testHyperlinkContainingPlaceholderField) { createSwDoc("hyperlink-field.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); parseExport(u"word/document.xml"_ustr); @@ -366,7 +366,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkContainingPlaceholderField) CPPUNIT_TEST_FIXTURE(Test, testTablePreferredWidth) { createSwDoc("tablePreferredWidth.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Problem :If the table preferred width is in percent, then after RT it changes to 0 & width type changes @@ -378,7 +378,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTablePreferredWidth) CPPUNIT_TEST_FIXTURE(Test, testFDO75431) { createSwDoc("fdo75431.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:tbl", 2); @@ -388,7 +388,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO75431) CPPUNIT_TEST_FIXTURE(Test, testFDO77725) { createSwDoc("fdo77725.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlFootnotes = parseExport(u"word/footnotes.xml"_ustr); assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]", 0); @@ -399,7 +399,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77725) CPPUNIT_TEST_FIXTURE(Test, testFieldRotation) { createSwDoc("field-rotated.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference const xRun(getRun(uno::Reference(getParagraphOrTable(1), uno::UNO_QUERY), 1)); uno::Reference const xField(getProperty>(xRun, u"TextField"_ustr)); CPPUNIT_ASSERT(xField.is()); @@ -412,7 +412,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldRotation) CPPUNIT_TEST_FIXTURE(Test, testFootnoteSeparator) { createSwDoc("footnotesep.fodt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // footnote separator definitions - taken from default page style xmlDocUniquePtr pXmlFootnotes = parseExport(u"word/footnotes.xml"_ustr); assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "id", u"0"); @@ -433,7 +433,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFootnoteSeparator) CPPUNIT_TEST_FIXTURE(Test, testTdf121441) { createSwDoc("tdf121441.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlFootnotes = parseExport(u"word/footnotes.xml"_ustr); assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[1]/w:rPr/w:rStyle", 1); assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rStyle", 0); @@ -449,7 +449,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121441) CPPUNIT_TEST_FIXTURE(Test, testFDO77812) { createSwDoc("fdo77812.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Additional sectPr was getting inserted and hence Column properties * were getting added into this additional sectPr instead of Default setPr. */ @@ -467,7 +467,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77812) CPPUNIT_TEST_FIXTURE(Test, testContentTypeOLE) { createSwDoc("fdo77759.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, @@ -492,7 +492,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeOLE) CPPUNIT_TEST_FIXTURE(Test, testfdo78420) { createSwDoc("fdo78420.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlHeader = parseExport(u"word/header2.xml"_ustr); xmlDocUniquePtr pXmlHeaderRels = parseExport(u"word/_rels/header2.xml.rels"_ustr); @@ -504,7 +504,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78420) CPPUNIT_TEST_FIXTURE(Test, testPageBreakInFirstPara) { createSwDoc("fdo77727.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); /* Break to next page was not exported if it is in first paragraph of the section. * Now after fix , LO writes Next Page Break and also preserves tag. */ @@ -516,7 +516,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBreakInFirstPara) CPPUNIT_TEST_FIXTURE(Test, testFDO78284) { createSwDoc("fdo78284.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Default[@Extension='png']", "ContentType", @@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78284) CPPUNIT_TEST_FIXTURE(Test, testFDO78384) { createSwDoc("fdo78384.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii",u"Wingdings"); } @@ -534,7 +534,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78384) CPPUNIT_TEST_FIXTURE(Test, testfdo78469) { createSwDoc("fdo78469.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header1.xml"_ustr); // make sure dataBinding & text tags not present in sdtcontent assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:dataBinding[1]",0); @@ -544,7 +544,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78469) CPPUNIT_TEST_FIXTURE(Test, testFDO78887) { createSwDoc("fdo78887.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1]", 1); @@ -555,7 +555,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78887) CPPUNIT_TEST_FIXTURE(Test, testFDO78887b) { createSwDoc("missing_newline.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -568,7 +568,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78887b) CPPUNIT_TEST_FIXTURE(Test, testFdo78651) { createSwDoc("fdo78651.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // ensure that there are only two tables assertXPath(pXmlDoc, "//w:tbl", 2); @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78651) CPPUNIT_TEST_FIXTURE(Test, testfdo78882) { createSwDoc("fdo78882.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Ensure that Section Break is getting written inside second paragraph @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78882) CPPUNIT_TEST_FIXTURE(Test, testfdo76934) { createSwDoc("fdo76934.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Issue was, AutoSpacing property if present inside styles.xml, LO was not able to * preserve it. */ @@ -604,7 +604,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo76934) CPPUNIT_TEST_FIXTURE(Test, testfdo79540) { createSwDoc("fdo79540.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Issue was, was getting written inside . * So postpone the writing of Inner Drawing tag. * MS Office does not allow nesting of drawing tags. @@ -620,7 +620,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79540) CPPUNIT_TEST_FIXTURE(Test, testFDO79062) { createSwDoc("fdo79062.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlFootNotes = parseExport(u"word/footnotes.xml"_ustr); assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", u"w14 wp14 w15"); @@ -667,7 +667,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123262_textFootnoteSeparators, "tdf123262_textFo CPPUNIT_TEST_FIXTURE(Test, testfdo79668) { createSwDoc("fdo79668.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#79668: Document was Crashing on DebugUtil build while Saving // because of repeated attribute value in same element. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -680,7 +680,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79668) CPPUNIT_TEST_FIXTURE(Test, testfdo78907) { createSwDoc("fdo78907.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", u"page" ); @@ -691,7 +691,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78907) CPPUNIT_TEST_FIXTURE(Test, tdf118702) { createSwDoc("tdf118702.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:type", "val", u"nextPage" ); @@ -701,7 +701,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf118702) CPPUNIT_TEST_FIXTURE(Test, testfdo79822) { createSwDoc("fdo79822.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* File getting crash while saving in LO. * The Docx contain smartart and the file was created in ms word 2007 */ @@ -711,7 +711,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79822) CPPUNIT_TEST_FIXTURE(Test, testFDO79915) { createSwDoc("fdo79915.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[9]/w:t", u"How much buoyancy does the water provide?"); @@ -720,7 +720,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO79915) CPPUNIT_TEST_FIXTURE(Test, testfdo79817) { createSwDoc("fdo79817.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID", u"{9222E47B-A68B-4AEB-9855-21C912B9D3D2}"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", u"/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]"); @@ -730,7 +730,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79817) CPPUNIT_TEST_FIXTURE(Test, testfdo79968_sldx) { createSwDoc("fdo79968.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // This UT for DOCX embedded with powerpoint slide xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); @@ -757,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLostFooterStyle) { // Given a document with many numberings and a Footer para style: createSwDoc("lost-footer-style.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // When saving that to DOCX and checking the Footer style: xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index cffc1bb0e19c..c20424ba73c1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -36,7 +36,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf133701) { createSwDoc("tdf133701.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "hSpace", u"567"); @@ -52,7 +52,7 @@ DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx") CPPUNIT_TEST_FIXTURE(Test, testDmlZorder) { createSwDoc("dml-zorder.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlZorder) CPPUNIT_TEST_FIXTURE(Test, testDmlShapeRelsize) { createSwDoc("dml-shape-relsize.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Relative size wasn't exported all, then relativeFrom was "page", not "margin". assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", u"margin"); @@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlShapeRelsize) CPPUNIT_TEST_FIXTURE(Test, testDmlPictureInTextframe) { createSwDoc("dml-picture-in-textframe.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName(u"word/media/image1.gif"_ustr))); // This was also true, image was written twice. @@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlPictureInTextframe) CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapeRelsize) { createSwDoc("dml-groupshape-relsize.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Relative size wasn't imported. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", u"margin"); @@ -121,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlTextshape) createSwDoc("dml-textshape.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -129,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlTextshape) CPPUNIT_TEST_FIXTURE(Test, testDmlTextshapeB) { createSwDoc("dml-textshapeB.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xGroup(getShape(1), uno::UNO_QUERY); uno::Reference xShape(xGroup->getByIndex(3), uno::UNO_QUERY); // Connector was incorrectly shifted towards the top left corner, X was 192, Y was -5743. @@ -159,7 +159,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLSolidfillAlpha, "dml-solidfill-alpha.docx") CPPUNIT_TEST_FIXTURE(Test, testDMLTextFrameNoFill) { createSwDoc("frame.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Problem is that default text frame background is white in Writer and transparent in Word uno::Reference xShape1(getShape(1), uno::UNO_QUERY); // it is re-imported as solid @@ -389,14 +389,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDMLGroupShapeChildPosition) createSwDoc("dml-groupshape-childposition.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testDMLGradientFillTheme) { createSwDoc("dml-gradientfill-theme.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Problem was when a fill gradient was imported from a theme, (fillRef in ooxml) // not just the theme was written out but the explicit values too // Besides the duplication of values it causes problems with writing out @@ -492,7 +492,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableFloatingMargins) createSwDoc("table-floating-margins.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table. @@ -503,7 +503,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableFloatingMargins) CPPUNIT_TEST_FIXTURE(Test, testTdf127814) { createSwDoc("tdf127814.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Paragraph top margin was 0 in a table started on a new page xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "before", u"0"); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127814) CPPUNIT_TEST_FIXTURE(Test, testTdf128752) { createSwDoc("tdf128752.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Paragraph bottom margin was 200, docDefault instead of table style setting xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", u"0"); @@ -521,7 +521,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128752) CPPUNIT_TEST_FIXTURE(Test, testTdf119054) { createSwDoc("tdf119054.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Don't overwrite before and after spacing of Heading2 by table style. // Heading2 overrides table style's values from DocDefaults. @@ -534,7 +534,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119054) CPPUNIT_TEST_FIXTURE(Test, testTdf131258) { createSwDoc("tdf131258.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Use table style based bottom margin instead of the docDefaults in empty tables, too assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", u"0"); @@ -543,7 +543,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131258) CPPUNIT_TEST_FIXTURE(Test, testTdf132514) { createSwDoc("tdf132514.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Keep table style setting, when the footer also contain a table assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "before", u"0"); @@ -558,7 +558,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153891, "tdf153891.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo69636) { createSwDoc("fdo69636.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * The problem was that the exporter didn't mirror the workaround of the * importer, regarding the btLr text frame direction: the @@ -574,7 +574,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69636) CPPUNIT_TEST_FIXTURE(Test, testVMLData) { createSwDoc("TestVMLData.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was exporter was exporting vml data for shape in w:rPr element. // vml data should not come under w:rPr element. xmlDocUniquePtr pXmlDoc = parseExport(u"word/header3.xml"_ustr); @@ -584,7 +584,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLData) CPPUNIT_TEST_FIXTURE(Test, testImageData) { createSwDoc("image_data.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was exporter was exporting v:imagedata data for shape in w:pict as v:fill w element. xmlDocUniquePtr pXmlDoc = parseExport(u"word/header3.xml"_ustr); @@ -594,7 +594,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageData) CPPUNIT_TEST_FIXTURE(Test, testFdo70838) { createSwDoc("fdo70838.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that VMLExport::Commit didn't save the correct width and height, // and ImplEESdrWriter::ImplFlipBoundingBox made a mistake calculating the position @@ -720,7 +720,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70838) CPPUNIT_TEST_FIXTURE(Test, testFdo73215) { createSwDoc("fdo73215.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // 'rect' was 'pictureFrame', which isn't valid. assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:prstGeom", @@ -733,7 +733,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73215) CPPUNIT_TEST_FIXTURE(Test, testBehinddoc) { createSwDoc("behinddoc.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was "0", shape was in the foreground. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "behindDoc", u"1"); @@ -742,7 +742,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBehinddoc) CPPUNIT_TEST_FIXTURE(Test, testSmartArtAnchoredInline) { createSwDoc("fdo73227.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Given file contains 3 DrawingML objects as 1Picture,1SmartArt and 1Shape. * Check for SmartArt. * SmartArt should get written as "Floating Object" i.e. inside tag. @@ -764,7 +764,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSmartArtAnchoredInline) CPPUNIT_TEST_FIXTURE(Test, testFdo65833) { createSwDoc("fdo65833.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The "editas" attribute for vml group shape was not preserved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group", "editas", u"canvas"); @@ -773,7 +773,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo65833) CPPUNIT_TEST_FIXTURE(Test, testFdo73247) { createSwDoc("fdo73247.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm", @@ -783,7 +783,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73247) CPPUNIT_TEST_FIXTURE(Test, testFdo70942) { createSwDoc("fdo70942.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom", "prst", u"ellipse"); @@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70942) CPPUNIT_TEST_FIXTURE(Test, testDrawinglayerPicPos) { createSwDoc("drawinglayer-pic-pos.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the position of the picture was incorrect, it was shifted towards the bottom right corner. xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -806,7 +806,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawinglayerPicPos) CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation) { createSwDoc("shape-theme-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // check shape style has been preserved @@ -918,7 +918,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation) CPPUNIT_TEST_FIXTURE(Test, testFDO73546) { createSwDoc("FDO73546.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header2.xml"_ustr); assertXPath(pXmlDoc, "/w:hdr/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "distL",u"0"); } @@ -926,7 +926,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO73546) CPPUNIT_TEST_FIXTURE(Test, testFdo69616) { createSwDoc("fdo69616.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // VML // FIXME: VML needs correction, because DrawingML WPG shapes from now imported as @@ -937,7 +937,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69616) CPPUNIT_TEST_FIXTURE(Test, testAlignForShape) { createSwDoc("Shape.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); //fdo73545:Shape Horizontal and vertical orientation is wrong //The wp:align tag is missing after roundtrip xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -948,7 +948,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAlignForShape) CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType) { createSwDoc("LineStyle_DashType.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* DOCX containing Shape with LineStyle as Dash Type should get preserved inside * an XML tag with value "dash", "sysDot", "lgDot", etc. */ @@ -966,7 +966,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType) CPPUNIT_TEST_FIXTURE(Test, testGradientFillPreservation) { createSwDoc("gradient-fill-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // check rgb colors for every step in the gradient of the first shape @@ -1005,7 +1005,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGradientFillPreservation) CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType_VML) { createSwDoc("LineStyle_DashType_VML.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* DOCX containing "Shape with text inside" having Line Style as "Dash Type" should get * preserved inside an XML tag with attribute dashstyle having value "dash". */ @@ -1016,7 +1016,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType_VML) CPPUNIT_TEST_FIXTURE(Test, testFdo74110) { createSwDoc("fdo74110.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); /* The File contains word art which is being exported as shape and the mapping is defaulted to shape type rect since the actual shape type(s) is/are commented out for some reason. @@ -1032,7 +1032,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74110) CPPUNIT_TEST_FIXTURE(Test, testOuterShdw) { createSwDoc("testOuterShdw.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:effectLst[1]/a:outerShdw[1]", "dist", u"1041400"); } @@ -1040,7 +1040,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOuterShdw) CPPUNIT_TEST_FIXTURE(Test, testExtentValue) { createSwDoc("fdo74605.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); sal_Int32 nX = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent", "cx").toInt32(); // This was negative. @@ -1056,7 +1056,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExtentValue) CPPUNIT_TEST_FIXTURE(Test, testSyncedRelativePercent) { createSwDoc("tdf93676-1.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1075,7 +1075,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107119, "tdf107119.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf133457) { createSwDoc("tdf133457.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr", "vAnchor", u"text"); @@ -1084,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133457) CPPUNIT_TEST_FIXTURE(Test, testTdf133924) { createSwDoc("tdf133924.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "wrap", u"around"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 8697e17cfd14..064e434ab9f4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -47,7 +47,7 @@ protected: CPPUNIT_TEST_FIXTURE(Test, testChildNodesOfCubicBezierTo) { createSwDoc("FDO74774.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Number of children required by cubicBexTo is 3 of type "pt". While exporting, sometimes the child nodes are less than 3. The test case ensures that there are 3 child nodes of type "pt" @@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChildNodesOfCubicBezierTo) CPPUNIT_TEST_FIXTURE(Test, testMSwordHang) { createSwDoc("test_msword_hang.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // fdo#74771: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r[2]/w:drawing/wp:inline", "distT", u"0"); @@ -81,7 +81,7 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapeThemeFont, "groupshape-theme-font.docx") CPPUNIT_TEST_FIXTURE(Test, testAnchorIdForWP14AndW14) { createSwDoc("AnchorId.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline", "anchorId", u"78735EFD"); @@ -100,7 +100,7 @@ DECLARE_OOXMLEXPORT_TEST(testDkVert, "dkvert.docx") CPPUNIT_TEST_FIXTURE(Test, testTextWatermark) { createSwDoc("textWatermark.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //The problem was that the watermark ID was not preserved, //and Word uses the object ID to identify if it is a watermark. //It has to have the 'PowerPlusWaterMarkObject' string in it @@ -116,7 +116,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextWatermark) CPPUNIT_TEST_FIXTURE(Test, testPictureWatermark) { createSwDoc("pictureWatermark.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); //The problem was that the watermark ID was not preserved, //and Word uses the object ID to identify if it is a watermark. //It has to have the 'WordPictureWaterMarkObject' string in it @@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureWatermark) CPPUNIT_TEST_FIXTURE(Test, testFdo76249) { createSwDoc("fdo76249.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * The Locked Canvas is imported correctly, but while exporting * the drawing element is exported inside a textbox. However the drawing has to exported @@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76249) CPPUNIT_TEST_FIXTURE(Test, testFdo76979) { createSwDoc("fdo76979.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that black was exported as "auto" fill color, resulting in well-formed, but invalid XML. xmlDocUniquePtr pXmlDoc = parseExport(u"word/header2.xml"_ustr); // This was "auto", not "FFFFFF". @@ -155,7 +155,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76979) CPPUNIT_TEST_FIXTURE(Test, testTdf104539) { createSwDoc("tdf104539.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -167,7 +167,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104539) CPPUNIT_TEST_FIXTURE(Test, testShapeEffectPreservation) { createSwDoc("shape-effect-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // first shape with outer shadow, rgb color @@ -303,7 +303,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeEffectPreservation) CPPUNIT_TEST_FIXTURE(Test, testShape3DEffectPreservation) { createSwDoc("shape-3d-effect-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // first shape: extrusion and shift on z, rotated camera with zoom, rotated light rig @@ -414,7 +414,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShape3DEffectPreservation) CPPUNIT_TEST_FIXTURE(Test, testPictureEffectPreservation) { createSwDoc("picture-effects-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // first picture: glow effect with theme color and transformations, 3d rotation and extrusion @@ -470,7 +470,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureEffectPreservation) CPPUNIT_TEST_FIXTURE(Test, testPictureArtisticEffectPreservation) { createSwDoc("picture-artistic-effects-preservation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); xmlDocUniquePtr pRelsDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); @@ -569,7 +569,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureArtisticEffectPreservation) CPPUNIT_TEST_FIXTURE(Test, fdo77719) { createSwDoc("fdo77719.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:custGeom[1]", 1); } @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo77719) CPPUNIT_TEST_FIXTURE(Test, testNestedAlternateContent) { createSwDoc("nestedAlternateContent.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // We check alternateContent could not contains alternateContent (i.e. nested alternateContent) assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[2]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]",0); @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNestedAlternateContent) CPPUNIT_TEST_FIXTURE(Test, test76317) { createSwDoc("test76317.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]", "prst", "hexagon"); } @@ -600,7 +600,7 @@ CPPUNIT_TEST_FIXTURE(Test, test76317) CPPUNIT_TEST_FIXTURE(Test, fdo76591) { createSwDoc("fdo76591.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "relativeHeight", u"3"); } @@ -608,7 +608,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo76591) CPPUNIT_TEST_FIXTURE(Test, test76317_2K10) { createSwDoc("test76317_2K10.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]", "name", u"adj"); } @@ -616,7 +616,7 @@ CPPUNIT_TEST_FIXTURE(Test, test76317_2K10) CPPUNIT_TEST_FIXTURE(Test, testFDO77122) { createSwDoc("LinkedTextBoxes.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); //ensure that the text box links are preserved. assertXPath(pXmlDoc, "//wps:txbx[1]", "id", u"1"); @@ -626,7 +626,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77122) CPPUNIT_TEST_FIXTURE(Test, test76734_2K7) { createSwDoc("test76734_2K7.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", u"wps"); } @@ -634,7 +634,7 @@ CPPUNIT_TEST_FIXTURE(Test, test76734_2K7) CPPUNIT_TEST_FIXTURE(Test, test77219) { createSwDoc("test77219.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", u"1"); } @@ -719,7 +719,7 @@ DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo76101) { createSwDoc("fdo76101.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:styles/w:style"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; @@ -730,7 +730,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76101) CPPUNIT_TEST_FIXTURE(Test, testSdtAndShapeOverlapping) { createSwDoc("ShapeOverlappingWithSdt.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]"); @@ -739,7 +739,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtAndShapeOverlapping) CPPUNIT_TEST_FIXTURE(Test, testLockedCanvas) { createSwDoc("fdo78658.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Checking for lockedCanvas tag assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/lc:lockedCanvas", 1); @@ -748,7 +748,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLockedCanvas) CPPUNIT_TEST_FIXTURE(Test, fdo78474) { createSwDoc("fdo78474.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc1 = parseExport(u"word/document.xml"_ustr); //docx file after RT is getting corrupted. assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", u"rId2"); @@ -760,7 +760,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo78474) CPPUNIT_TEST_FIXTURE(Test, testAbsolutePositionOffsetValue) { createSwDoc("fdo78432.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); xmlXPathObjectPtr pXmlObjs[6]; @@ -786,14 +786,14 @@ CPPUNIT_TEST_FIXTURE(Test, testAbsolutePositionOffsetValue) CPPUNIT_TEST_FIXTURE(Test, testRubyHyperlink) { createSwDoc("rubyhyperlink.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // test that export doesn't assert with overlapping ruby / hyperlink attr } CPPUNIT_TEST_FIXTURE(Test, testfdo78300) { createSwDoc("fdo78300.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r[1]/w:drawing[1]", @@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78300) CPPUNIT_TEST_FIXTURE(Test, testWordArtWithinDraingtool) { createSwDoc("testWordArtWithinDraingtool.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * Within a file, there is a 2007 wordArt enclosed in a drawing tool * LO was exporting it as below: * Sample XML as in Original file: @@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWordArtWithinDraingtool) CPPUNIT_TEST_FIXTURE(Test, testfdo78663) { createSwDoc("fdo78663.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* * A 2007 word art tool is enclosed in a 2010 drawing toolWithin a file, * Originally the file has the following xml tag hierarchy. * @@ -845,7 +845,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78663) CPPUNIT_TEST_FIXTURE(Test, testFdo78957) { createSwDoc("fdo78957.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlHeader = parseExport(u"word/header2.xml"_ustr); const sal_Int64 IntMax = SAL_MAX_INT32; @@ -860,7 +860,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78957) CPPUNIT_TEST_FIXTURE(Test, testfdo79256) { createSwDoc("fdo79256.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* corruption issue also solved by fixing tdf#108064: * since that LO keeps MSO preset dash styles during OOXML export */ @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79256) CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDash1000thOfPercent) { createSwDoc("dashed_line_custdash_1000th_of_percent.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Make sure that preset line is exported correctly as "1000th of a percent". * This test-file has a CUSTOM dash-line that is defined as '1000th of a percent'. * This should be imported by LO as-is, and exported back with the same values. @@ -892,7 +892,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDash1000thOfPercent) CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDashPercentage) { createSwDoc("dashed_line_custdash_percentage.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Make sure that preset line is exported correctly as "1000th of a percent". * This test-file has a CUSTOM dash-line that is defined as percentages. * This should be imported by LO as '1000th of a percent', and exported back @@ -913,7 +913,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDashPercentage) CPPUNIT_TEST_FIXTURE(Test, testCommentInitials) { createSwDoc("comment_initials.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/comments.xml"_ustr); @@ -938,7 +938,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.doc CPPUNIT_TEST_FIXTURE(Test, testfdo79591) { createSwDoc("fdo79591.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); /* Values set for docPr name and shape ID attributes * in RT file were not valid as per UTF-8 encoding format * and hence was showing RT document as corrupt with error @@ -959,7 +959,7 @@ DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo80894) { createSwDoc("TextFrameRotation.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Rotation value was not roundtripped for textframe. @@ -975,7 +975,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80894) CPPUNIT_TEST_FIXTURE(Test, testfdo80895) { createSwDoc("fdo80895.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // DML shapes in header and footer were not getting rendered in LO and the same were not preserved after RT. // In actual there was a shape but because of fetching wrong theme for header.xml or footer.xml // resultant shape was with prop in hence was not visible. @@ -993,7 +993,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80895) CPPUNIT_TEST_FIXTURE(Test, testTdf118242) { createSwDoc("tdf118242.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118242) CPPUNIT_TEST_FIXTURE(Test, testWrapTightThrough) { createSwDoc("wrap-tight-through.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // These were wrapSquare without a wrap polygon before. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The first shape should be wrapThrough with a wrap polygon (was wrapSquare). @@ -1042,7 +1042,7 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.docx") CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeGrayscale) { createSwDoc("picture_colormode_grayscale.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // The problem was that the grayscale was not exported xmlDocUniquePtr pXmlDoc = parseExport (u"word/document.xml"_ustr); @@ -1052,7 +1052,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeGrayscale) CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeBlackWhite) { createSwDoc("picture_colormode_black_white.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport (u"word/document.xml"_ustr); @@ -1063,7 +1063,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeBlackWhite) CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeWatermark) { createSwDoc("picture_colormode_watermark.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport (u"word/document.xml"_ustr); @@ -1075,7 +1075,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeWatermark) CPPUNIT_TEST_FIXTURE(Test, testExportShadow) { createSwDoc("bnc637947.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML @@ -1090,7 +1090,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportShadow) CPPUNIT_TEST_FIXTURE(Test, testExportAdjustmentValue) { createSwDoc("tdf91429.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd", "fmla", u"val 50000"); @@ -1188,7 +1188,7 @@ DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx") CPPUNIT_TEST_FIXTURE(Test, testTDF93675) { createSwDoc("no-numlevel-but-indented.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:ind", "start", u"1418"); @@ -1199,7 +1199,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTDF93675) CPPUNIT_TEST_FIXTURE(Test, testFlipAndRotateCustomShape) { createSwDoc("flip_and_rotate.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1232,7 +1232,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFlipAndRotateCustomShape) CPPUNIT_TEST_FIXTURE(Test, testTdf92335) { createSwDoc("tdf92335.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Don't export redundant ListLabel character styles xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index bc297aea7cdd..7c9a318af7dc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -56,7 +56,7 @@ DECLARE_OOXMLEXPORT_TEST(testN751054, "n751054.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf48569) { createSwDoc("tdf48569.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // File crashing while saving in LO @@ -439,7 +439,7 @@ DECLARE_OOXMLEXPORT_TEST(testTDF91122, "tdf91122.docx") CPPUNIT_TEST_FIXTURE(Test, testFdo76803) { createSwDoc("fdo76803.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The ContourPolyPolygon was wrong uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); @@ -721,7 +721,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN779642) }; createSwDoc("n779642.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } @@ -992,7 +992,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN820509) } CPPUNIT_ASSERT_EQUAL(u"M.d.yyyy"_ustr, sDateFormat); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 9006243b1f26..c6c2fe739319 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -55,7 +55,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo55381, "fdo55381.docx") CPPUNIT_TEST_FIXTURE(Test, testDocm) { createSwDoc("hello.docm"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Make sure that we check the name of the export filter. // This was application/vnd.ms-word.document.macroEnabled.main+xml when the // name of the import filter was checked. @@ -69,7 +69,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocm) CPPUNIT_TEST_FIXTURE(Test, testDefaultContentTypes) { createSwDoc("fdo55381.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Default[@Extension='xml']", @@ -98,7 +98,7 @@ CPPUNIT_TEST_FIXTURE(DocmTest, testDocmSave) // application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, // we used the wrong content type for .docm files. createSwDoc("hello.docm"); - save(u"MS Word 2007 XML VBA"_ustr); + save(TestFilter::DOCM); xmlDocUniquePtr pXmlDoc = parseExport(u"[Content_Types].xml"_ustr); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']", @@ -112,7 +112,7 @@ CPPUNIT_TEST_FIXTURE(DocmTest, testBadDocm) // This was 'MS Word 2007 XML', broken docm files were not recognized. CPPUNIT_ASSERT_EQUAL(u"MS Word 2007 XML VBA"_ustr, getSwDocShell()->GetMedium()->GetFilter()->GetName()); - saveAndReload(u"MS Word 2007 XML VBA"_ustr); + saveAndReload(TestFilter::DOCM); // This was 'MS Word 2007 XML', broken docm files were not recognized. CPPUNIT_ASSERT_EQUAL(u"MS Word 2007 XML VBA"_ustr, getSwDocShell()->GetMedium()->GetFilter()->GetName()); } @@ -130,14 +130,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109063) }; createSwDoc("tdf109063.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(DocmTest, testTdf108269) { createSwDoc("tdf108269.docm"); - saveAndReload(u"MS Word 2007 XML VBA"_ustr); + saveAndReload(TestFilter::DOCM); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); // This failed: VBA streams were not roundtripped via the doc-level // grab-bag. @@ -148,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(DocmTest, testTdf108269) CPPUNIT_TEST_FIXTURE(Test, testTdf125338) { createSwDoc("tdf125338.docm"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); // docm files should not retain macros when saved as docx CPPUNIT_ASSERT(!xNameAccess->hasByName(u"word/vbaProject.bin"_ustr)); @@ -202,7 +202,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122342, "tdf122342.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf132802) { createSwDoc("tdf132802.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "after", u"0"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "after", u"0"); @@ -220,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132802) CPPUNIT_TEST_FIXTURE(Test, testTdf132807) { createSwDoc("tdf132807.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "before", u"280"); // This was 240 (list auto spacing is zero in lists) @@ -240,7 +240,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132807) CPPUNIT_TEST_FIXTURE(Test, testTdf133052) { createSwDoc("tdf133052.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // These were 240 (top auto spacing of list subitems are zero) assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", u"0"); @@ -255,7 +255,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133052) CPPUNIT_TEST_FIXTURE(Test, testTdf134648) { createSwDoc("tdf134648.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // list item with direct top auto spacing @@ -333,7 +333,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129575_docDefault, "tdf129575-docDefault.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf118812) { createSwDoc("tdf118812_tableStyles-comprehensive.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // cell A1 assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:pStyle", "val", u"Normal"); @@ -425,7 +425,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118812) CPPUNIT_TEST_FIXTURE(Test, testTdf107626) { createSwDoc("tdf107626.odt"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 2 (missing trailing cell in merged cell range) @@ -451,7 +451,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79272_strictDxa) createSwDoc("tdf79272_strictDxa.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); @@ -506,7 +506,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104420, "tdf104420_lostParagraph.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf41542_borderlessPadding) { createSwDoc("tdf41542_borderlessPadding.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // the page style's borderless padding should force this to 3 pages, not 1 CPPUNIT_ASSERT_EQUAL( 3, getPages() ); } @@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97648_relativeWidth) createSwDoc("tdf97648_relativeWidth.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -594,7 +594,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, "tdf46940_do CPPUNIT_TEST_FIXTURE(Test, testTdf98700_keepWithNext) { createSwDoc("tdf98700_keepWithNext.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading style keeps with next", true, getProperty(getParagraph(1), u"ParaKeepTogether"_ustr)); CPPUNIT_ASSERT_EQUAL_MESSAGE("Default style doesn't keep with next", false, getProperty(getParagraph(2), u"ParaKeepTogether"_ustr)); @@ -703,7 +703,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, "tdf112352_nextPageColum CPPUNIT_TEST_FIXTURE(Test, testTdf109310_endnoteStyleForMSO) { createSwDoc("tdf109310_endnoteStyleForMSO.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/endnotes.xml"_ustr); // It is important that EndnoteCharacters exists, and is not duplicated on each round-trip assertXPath(pXmlDoc, "/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "val", @@ -713,7 +713,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109310_endnoteStyleForMSO) CPPUNIT_TEST_FIXTURE(Test, testTdf103389) { createSwDoc("tdf103389.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // No geometry was exported for the second canvas // Check both canvases' geometry @@ -784,14 +784,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79329) }; createSwDoc("tdf79329.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf103982) { createSwDoc("tdf103982.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor", "distB").toInt32(); // This was -260350, which is not a valid value for an unsigned type. diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx index a59ed8e7e7c9..04d6e8703e69 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx @@ -22,7 +22,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testSaveAsDotX) { createSwDoc("sample.dotx"); - saveAndReload(u"MS Word 2007 XML Template"_ustr); + saveAndReload(TestFilter::DOTX); xmlDocUniquePtr pXmlDocCT = parseExport(u"[Content_Types].xml"_ustr); // Ensure that document has correct content type diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index e3cd1307192a..f2fbc775d98b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -61,7 +61,7 @@ DECLARE_OOXMLEXPORT_TEST(testN789482, "n789482.docx") CPPUNIT_TEST_FIXTURE(Test, testBnc834035) { createSwDoc("bnc834035.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(3, getPages()); // Illustration index had wrong hyperlinks: anchor was using Writer's @@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc834035) CPPUNIT_TEST_FIXTURE(Test, testCp1000015) { createSwDoc("cp1000015.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Redline and hyperlink end got exported in an incorrect order. getParagraph(1, u"Hello."_ustr); @@ -84,7 +84,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCp1000015) CPPUNIT_TEST_FIXTURE(Test, testHyperlineIsEnd) { createSwDoc("hyperlink.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Check that the document.xml contents all the tag properly closed. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // If document.xml miss any ending tag then parseExport() returns NULL which fail the test case. @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlineIsEnd) CPPUNIT_TEST_FIXTURE(Test, testFdo69649) { createSwDoc("fdo69649.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The DOCX containing the Table of Contents was not exported with correct page nos xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69649) CPPUNIT_TEST_FIXTURE(Test, testFieldFlagO) { createSwDoc("TOC_field_f.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This test case is to verify \o flag should come once. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldFlagO) CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_f) { createSwDoc("toc_doc.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Export logic for all TOC field flags was enclosed inside // if( SwTOXElement::Mark & pTOX->GetCreateType() ) in ww8atr.cxx which gets true for \f, // this was the reason if there is \f flag present in original doc then only other flags like @@ -135,7 +135,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_f) CPPUNIT_TEST_FIXTURE(Test, testPreserveZfield) { createSwDoc("preserve_Z_field_TOC.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", u" TOC \\z \\f \\o \"1-3\" \\h"); @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPreserveZfield) CPPUNIT_TEST_FIXTURE(Test, testPreserveWfieldTOC) { createSwDoc("PreserveWfieldTOC.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", u" TOC \\z \\w \\f \\o \"1-3\" \\h"); @@ -153,7 +153,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPreserveWfieldTOC) CPPUNIT_TEST_FIXTURE(Test, testFieldFlagB) { createSwDoc("TOC_field_b.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This test case is to verify \b flag. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -165,7 +165,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldFlagB) CPPUNIT_TEST_FIXTURE(Test, testPreserveXfieldTOC) { createSwDoc("PreserveXfieldTOC.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", u" TOC \\x \\f \\o \"1-3\" \\h"); @@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPreserveXfieldTOC) CPPUNIT_TEST_FIXTURE(Test, testFDO77715) { createSwDoc("FDO77715.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // tdf#153090 check that para style is preserved @@ -195,7 +195,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77715) CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_u) { createSwDoc("testTOCFlag_u.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // DOCX containing TOC should preserve code field '\u'. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_u) CPPUNIT_TEST_FIXTURE(Test, testfdo73596_RunInStyle) { createSwDoc("fdo73596_RunInStyle.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // INDEX should be preserved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -217,7 +217,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo73596_RunInStyle) CPPUNIT_TEST_FIXTURE(Test, testfdo73596_AlphaSeparator) { createSwDoc("fdo73596_AlphaSeparator.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // INDEX flag \h "A" should be preserved. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -227,7 +227,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo73596_AlphaSeparator) CPPUNIT_TEST_FIXTURE(Test, testCaption1) { createSwDoc("EquationAsScientificNumbering.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#74431 : This test case is to verify the Captions are coming properly // earlier it was coming as "SEQ "scientific"\*ROMAN now it is SEQ scientific\* ROMAN" @@ -239,7 +239,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption1) CPPUNIT_TEST_FIXTURE(Test, testCaption2) { createSwDoc("EquationWithAboveAndBelowCaption.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside tag. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -250,7 +250,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption2) CPPUNIT_TEST_FIXTURE(Test, testCaption3) { createSwDoc("FigureAsLabelPicture.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside tag. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -261,7 +261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption3) CPPUNIT_TEST_FIXTURE(Test, testCaption4) { createSwDoc("TableWithAboveCaptions.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside tag. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -272,7 +272,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption4) CPPUNIT_TEST_FIXTURE(Test, testFooterContainHyperlink) { createSwDoc("footer-contain-hyperlink.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Problem is that footer1.xml.rels contains the empty // Target due to which the file get corrupted // in MS Office 2007. @@ -285,7 +285,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterContainHyperlink) CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_MultipleColumns) { createSwDoc("alphabeticalIndex_MultipleColumns.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Bug :: fdo#73596 /* * Index with multiple columns was not imported correctly and @@ -308,7 +308,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_MultipleColumns) CPPUNIT_TEST_FIXTURE(Test, testPageref) { createSwDoc("testPageref.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#72563 : There was a problem that in case of TOC,PAGEREF field tag was not preserved during Roundtrip // This test case is to verify that PAGEREF tag is coming with proper values inside tag. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageref) CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_AutoColumn) { createSwDoc("alphabeticalIndex_AutoColumn.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Bug :: fdo#73596 /* * When the columns in Index are 0; i.e not specified by the @@ -337,7 +337,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_AutoColumn) CPPUNIT_TEST_FIXTURE(Test, testIndexFieldFlagF) { createSwDoc("IndexFieldFlagF.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // This test case is to verify the Index field flag '\f' with some // Specific Entry Type (ex. "Syn" in our case). xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -352,7 +352,7 @@ CPPUNIT_TEST_FIXTURE(Test, testIndexFieldFlagF) CPPUNIT_TEST_FIXTURE(Test, testBibliography) { createSwDoc("FDO75133.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", u" BIBLIOGRAPHY "); @@ -363,7 +363,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBibliography) CPPUNIT_TEST_FIXTURE(Test, testGenericTextField) { createSwDoc("Unsupportedtextfields.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // fdo#75158 : This test case is to verify the unsupported textfields are exported properly. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -378,7 +378,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGenericTextField) CPPUNIT_TEST_FIXTURE(Test, test_FieldType) { createSwDoc("99_Fields.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Checking for three field types (BIBLIOGRAPHY, BIDIOUTLINE, CITATION) in sequence assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText"); @@ -389,7 +389,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_FieldType) CPPUNIT_TEST_FIXTURE(Test, testCitation) { createSwDoc("FDO74775.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:instrText", u" CITATION Kra06 \\l 1033 "); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[4]/w:t", u"(Kramer & Chen, 2006)"); @@ -398,7 +398,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCitation) CPPUNIT_TEST_FIXTURE(Test, testHyperLinkTagEnded) { createSwDoc("fdo76316.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); /* XML tag was not getting closed when its inside another * tag. */ @@ -411,7 +411,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperLinkTagEnded) CPPUNIT_TEST_FIXTURE(Test, testFDO76163 ) { createSwDoc("fdo76163.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); //docx file after RT is getting corrupted. assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[10]/w:fldChar", "fldCharType", u"end" ); @@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76163 ) CPPUNIT_TEST_FIXTURE(Test, testFDO78659) { createSwDoc("fdo78659.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]", 0); @@ -429,7 +429,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78659) CPPUNIT_TEST_FIXTURE(Test, testFDO78654 ) { createSwDoc("fdo78654.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // In case of two "Hyperlink" tags in one paragraph and one of them // contains "PAGEREF" field then field end tag was missing from hyperlink. @@ -440,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78654 ) CPPUNIT_TEST_FIXTURE(Test, testfdo78599) { createSwDoc("fdo78599.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); //docx file after RT is getting corrupted. assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar", "fldCharType", u"end" ); @@ -454,7 +454,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78599) CPPUNIT_TEST_FIXTURE(Test, testfdo78886) { createSwDoc("fdo78886.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]", 0); @@ -463,7 +463,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78886) CPPUNIT_TEST_FIXTURE(Test, testFdo78910) { createSwDoc("fdo78910.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This is to ensure that the fld starts and ends inside a hyperlink... @@ -474,7 +474,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78910) CPPUNIT_TEST_FIXTURE(Test, testFDO78590) { createSwDoc("FDO78590.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This is to ensure that the fld starts and ends inside a hyperlink... @@ -485,7 +485,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78590) CPPUNIT_TEST_FIXTURE(Test, testSdtCitationRun) { createSwDoc("sdt-citation-run.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The problem was that the SDT was around the whole paragraph, not only around the citation field. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t", u"Before sdt."); @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtCitationRun) CPPUNIT_TEST_FIXTURE(Test, testParagraphSdt) { createSwDoc("paragraph-sdt.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // The problem was that the SDT was around the run only, not the whole paragraph. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The path to w:sdt contained a w:p. @@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSdt) CPPUNIT_TEST_FIXTURE(Test, testTdf158661_blockSDT) { createSwDoc("tdf158661_blockSDT.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); @@ -568,7 +568,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158661_blockSDT) CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) { createSwDoc("sdt-2-para.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // The problem was that was closed after "first", not after "second", so the second assert failed. assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t", u"first"); @@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) CPPUNIT_TEST_FIXTURE(Test, test2Id) { createSwDoc("2-id.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // This was 2, but only one w:id is allowed. assertXPath(pXmlDoc, "//w:sdtPr/w:id", 1); @@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(Test, test2Id) CPPUNIT_TEST_FIXTURE(Test, testTableStart2Sdt) { createSwDoc("table-start-2-sdt.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // w:docPartGallery should be a child of , make sure it's not a child of w:text. assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery", 0); @@ -643,14 +643,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtDateDuplicate) createSwDoc("sdt-date-duplicate.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testFdo81492) { createSwDoc("fdo81492.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:instrText", u"ADDIN EN.CITE.DATA"); } @@ -658,7 +658,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81492) CPPUNIT_TEST_FIXTURE(Test, testEditTime) { createSwDoc("fdo81341.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); /* Issue was LO was not able to Import and Export EditTime in seconds format. * It was supporting Time in "HH:MM" format. But if DOCX contains Time in seconds, * then LO was not able to display time in "HH:MM:SS" format. @@ -675,7 +675,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEditTime) CPPUNIT_TEST_FIXTURE(Test, testFlyFieldmark) { createSwDoc("fly_fieldmark.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // the problem was that the flys were written after the field start xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // run 1 contains 2 shapes, one was at-page, one was at-char @@ -689,7 +689,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFlyFieldmark) CPPUNIT_TEST_FIXTURE(Test, testFdo81945) { createSwDoc("fdo81945.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//w:sdt//w:sdt", 0); @@ -698,7 +698,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81945) CPPUNIT_TEST_FIXTURE(Test, testfdo82123) { createSwDoc("fdo82123.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // make sure there is only one run inside first SDT after RT as in the Original file. @@ -709,7 +709,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo82123) CPPUNIT_TEST_FIXTURE(Test, testSdtBeforeField) { createSwDoc("sdt-before-field.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Make sure the field doesn't sneak inside the SDT: the SDT should contain only a single run (there were 6 ones). assertXPath(pXmlDoc, "//w:p/w:sdt/w:sdtContent/w:r/w:t", 1); @@ -719,7 +719,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtBeforeField) CPPUNIT_TEST_FIXTURE(Test, testfdo81946) { createSwDoc("fdo81946.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/header1.xml"_ustr); // make sure AlternateContent should not present in sdt assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:r[2]/mc:AlternateContent[1]",0); @@ -728,7 +728,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo81946) CPPUNIT_TEST_FIXTURE(Test, testfdo82492) { createSwDoc("fdo82492.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // make sure there is only one run inside first SDT after RT as in the Original file. @@ -739,7 +739,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo82492) CPPUNIT_TEST_FIXTURE(Test, testSdtHeader) { createSwDoc("sdt-header.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Problem was that w:sdt elements in headers were lost on import. xmlDocUniquePtr pXmlDoc = parseExport(u"word/header2.xml"_ustr); // This was 0, w:sdt (and then w:date) was missing. @@ -749,7 +749,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtHeader) CPPUNIT_TEST_FIXTURE(Test, testSdtCompanyMultipara) { createSwDoc("sdt-company-multipara.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Here is just a simple text node, so there should be either one or zero paragraph // (in this case sdt element is inside paragraph) @@ -775,7 +775,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFixedDateFields) createSwDoc("fixed-date-field.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -787,14 +787,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFixedDateFields) CPPUNIT_TEST_FIXTURE(Test, testToxmarkHyperlink) { createSwDoc("toxmarkhyperlink.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // test that export doesn't assert with overlapping fields / hyperlink attr } CPPUNIT_TEST_FIXTURE(Test, testOO34469) { createSwDoc("ooo34469-1.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", u"2.9.2.Creating_New_files|outline"); @@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO34469) CPPUNIT_TEST_FIXTURE(Test, testOO39845) { createSwDoc("ooo39845-7.odt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", u"Figure4|graphic"); @@ -818,7 +818,7 @@ DECLARE_OOXMLEXPORT_TEST( testTdf85161, "tdf85161.docx" ) CPPUNIT_TEST_FIXTURE(Test, testTdf66401) { createSwDoc("tdf66401.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", 1); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", "ascii", u"Arial Black"); @@ -867,7 +867,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateFieldInShape) createSwDoc("date_field_in_shape.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -908,7 +908,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateFieldAtEndOfParagraph) createSwDoc("date_field_at_end_of_paragraph.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } @@ -941,14 +941,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDropDownFieldEntryLimit) createSwDoc("tdf126792.odt" ); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); } CPPUNIT_TEST_FIXTURE(Test, testTdf132185) { createSwDoc("tdf132185.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/footer2.xml"_ustr); // Since the default (without xml:space attribute) is to ignore leading and trailing spaces, // " PAGE \\* roman " will get imported as "PAGE \\* roman". This is also valid, and must be @@ -959,7 +959,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132185) CPPUNIT_TEST_FIXTURE(Test, testConditionalText) { createSwDoc("conditional-text.fodt"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Load a document which has a conditional text field in it. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); std::u16string_view aExpected(u" IF 1 < 2 \"True\" \"- 'False' -\""); @@ -974,7 +974,7 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText) CPPUNIT_TEST_FIXTURE(Test, testConditionalText2) { createSwDoc("tdf114537_conditional-text2.doc"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Load a document which has a conditional text field in it. xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); std::u16string_view aExpected(u" IF 1 = 1 \"test1\" \"test2\""); @@ -986,7 +986,7 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText2) CPPUNIT_TEST_FIXTURE(Test, testConditionalText3) { createSwDoc("tdf125038_conditionalText3.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // It is unclear what the purpose of all the conditional IF statements is, // but the end result should not produce any output. // Previously, the fields were being displayed as text @@ -997,7 +997,7 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText3) CPPUNIT_TEST_FIXTURE(Test, testConditionalText4) { createSwDoc("tdf125038_conditionalText_DOCPROPERTY.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); getParagraph(1, u"customized field"_ustr); } @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142464_ampm) createSwDoc("tdf142464_ampm.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verify(); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -1035,7 +1035,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtDatePicker) { // Check that roundtrip for date picker field does not lose essential data createSwDoc("test_sdt_datepicker.docx"); - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Placeholder is here @@ -1064,7 +1064,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag) // When exporting that document back to DOCX: // Then make sure that completes without an assertion failure, which would mean not-well-formed // output was produced: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testContentControlShape) @@ -1075,7 +1075,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlShape) // When exporting that document back to DOCX: // Then make sure that completes without an assertion failure, which would mean not-well-formed // output was produced, since the was conditional but the was unconditional: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testTdf104823) @@ -1105,7 +1105,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104823) xContentControl2->setString(u"New Extended Property Value"_ustr); // Save and check saved data - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlCustomPropsDoc = parseExport(u"customXml/item1.xml"_ustr); CPPUNIT_ASSERT(pXmlCustomPropsDoc); // FIXME: strange it won't run simple /employees/employee/name xpath query. Does not like namespaces? diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx index 42a3ea931031..e292d1773ca2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx @@ -121,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeToRelativeExport) SetAbsolute(USE_RELATIVE); createSwDoc("relative-link.docx"); UseTempDir(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", @@ -133,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeToAbsoluteExport) SetAbsolute(USE_ABSOLUTE); createSwDoc("relative-link.docx"); // Don't modify link. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target"); @@ -146,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAbsoluteToRelativeExport) SetAbsolute(USE_RELATIVE); createSwDoc("absolute-link.docx"); UseTempDir(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", u"test.docx"); @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAbsoluteToAbsoluteExport) SetAbsolute(USE_ABSOLUTE); createSwDoc("absolute-link.docx"); // Don't modify link. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target"); @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123627_export) SetAbsolute(USE_RELATIVE); createSwDoc("tdf123627.docx"); UseTempDir(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", @@ -182,7 +182,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126590_export) SetAbsolute(USE_ABSOLUTE); createSwDoc("tdf126590.docx"); // Don't modify link. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); // in the original file: Target="file:///C:\TEMP\test.docx" => invalid file URI assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126768_export) SetAbsolute(USE_ABSOLUTE); createSwDoc("tdf126768.docx"); // Don't modify link. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); // in the original file: "file:///C:\\TEMP\\test.docx" => invalid file URI assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", @@ -206,7 +206,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNon_ascii_link_export) SetAbsolute(USE_ABSOLUTE); createSwDoc("non_ascii_link.docx"); // Don't modify link. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/_rels/document.xml.rels"_ustr); assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target", diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx index 59f835b1eea4..3e3a4e928f0b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx @@ -19,7 +19,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_GlowShadowReflection) { createSwDoc("TextEffects_Glow_Shadow_Reflection.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow", "rad").match("63500")); @@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_GlowShadowReflection) CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextOutline) { createSwDoc("TextEffects_TextOutline.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Paragraph 1 @@ -145,7 +145,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextOutline) CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextFill) { createSwDoc("TextEffects_TextFill.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Paragraph 1 has no textFill @@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextFill) CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing) { createSwDoc("TextEffects_Props3d_Ligatures_NumForm_NumSpacing.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Paragraph 1 - w14:props3d @@ -231,7 +231,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_StylisticSets_CntxtAlts) { createSwDoc("TextEffects_StylisticSets_CntxtAlts.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Paragraph 1 - w14:stylisticSets @@ -249,7 +249,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_StylisticSets_CntxtAlts) CPPUNIT_TEST_FIXTURE(Test, Test_McIgnorable) { createSwDoc("TextEffects_StylisticSets_CntxtAlts.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDocument, "/w:document", "Ignorable", u"w14 wp14 w15"); @@ -262,7 +262,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_McIgnorable) CPPUNIT_TEST_FIXTURE(Test, Test_CompatSettingsForW14) { createSwDoc("TextEffects_StylisticSets_CntxtAlts.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting", 5); @@ -291,7 +291,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_CompatSettingsForW14) CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Groupshapes) { createSwDoc("TextEffects_Groupshapes.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OString sPathToWGP = "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp"_ostr; @@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Groupshapes) CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_InStyleXml) { createSwDoc("TextEffects_InStyle.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/styles.xml"_ustr); OString sPathToCharacterStyle = "/w:styles/w:style[3]"_ostr; @@ -635,7 +635,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_InStyleXml) CPPUNIT_TEST_FIXTURE(Test, Test_no_tag_if_no_fill) { createSwDoc("tdf112103_tablebgnofill.docx"); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:shd", 0); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 6aaf45402b17..a71cdbea494e 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -767,7 +767,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158023Import) createSwDoc("tdf158023_import.docx"); verify(); - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); verifyReload(); } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index e216aa1c4f4a..280afd2170e0 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -59,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(Test, testZoom) }; createSwDoc("zoom.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -68,7 +68,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo38176) auto verify = [this]() { CPPUNIT_ASSERT_EQUAL(u"foo ‑­bar"_ustr, getBodyText()); }; createSwDoc("fdo38176.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -86,7 +86,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49683) }; createSwDoc("fdo49683.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -104,7 +104,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo50087) }; createSwDoc("fdo50087.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -122,14 +122,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo50831) }; createSwDoc("fdo50831.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testFdo48335) { createSwDoc("fdo48335.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(3, getPages()); /* * The problem was that we exported a fake pagebreak, make sure it's just a soft one now. @@ -188,14 +188,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo38244) }; createSwDoc("fdo38244.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testCommentsNested) { createSwDoc("comments-nested.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xOuter = getProperty>( getRun(getParagraph(1), 2), u"TextField"_ustr); @@ -217,14 +217,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathAccents) }; createSwDoc("math-accents.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testMathEqarray) { createSwDoc("math-eqarray.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL( u"y \"=\" left lbrace stack { 0 , x \"<\" 0 # 1 , x \"=\" 0 # {x} ^ {2} , x \">\" 0 } right none"_ustr, @@ -244,14 +244,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathD) }; createSwDoc("math-d.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testMathEscaping) { createSwDoc("math-escaping.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(u"\u00E1 \\{"_ustr, aActual); } @@ -259,7 +259,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathEscaping) CPPUNIT_TEST_FIXTURE(Test, testMathLim) { createSwDoc("math-lim.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(u"lim from {x \u2192 1} {x}"_ustr, aActual); } @@ -272,7 +272,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathMatrix) }; createSwDoc("math-matrix.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -284,14 +284,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathBox) }; createSwDoc("math-mbox.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testMathMso2007) { createSwDoc("math-mso2007.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected(u"A \"=\" \u03C0 {r} ^ {2}"_ustr); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -343,7 +343,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathMso2007) CPPUNIT_TEST_FIXTURE(Test, testMathNary) { createSwDoc("math-nary.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL( u"lllint from {1} to {2} {x \"+\" 1} prod from {a} {b} sum to {2} {x}"_ustr, aActual); @@ -360,7 +360,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathLimupp) }; createSwDoc("math-limupp.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -372,7 +372,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathStrikeh) }; createSwDoc("math-strikeh.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -384,14 +384,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathPlaceholders) }; createSwDoc("math-placeholders.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testMathRad) { createSwDoc("math-rad.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(u"sqrt {4} nroot {3} {x \"+\" 1}"_ustr, aActual); } @@ -404,7 +404,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathSepchr) }; createSwDoc("math-sepchr.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -420,14 +420,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathSubscripts) }; createSwDoc("math-subscripts.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testMathVerticalstacks) { createSwDoc("math-vertical-stacks.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(u"{a} over {b}"_ustr, getFormula(getRun(getParagraph(1), 1))); CPPUNIT_ASSERT_EQUAL(u"{a} / {b}"_ustr, getFormula(getRun(getParagraph(2), 1))); CPPUNIT_ASSERT_EQUAL(u"stack { a # b }"_ustr, getFormula(getRun(getParagraph(3), 1))); @@ -469,14 +469,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf49073) }; createSwDoc("tdf49073.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testMathRuns) { createSwDoc("math-runs.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // was [](){}, i.e. first curly bracket had an incorrect position CPPUNIT_ASSERT_EQUAL(u"\\{ \\[ \\] \\( \\) \\}"_ustr, getFormula(getRun(getParagraph(1), 1))); } @@ -485,7 +485,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMathRuns) CPPUNIT_TEST_FIXTURE(Test, testTdf158023_rtf) { createSwDoc("tdf158023.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(u"left [a right ] left (b right ) left lbrace c right rbrace"_ustr, getFormula(getRun(getParagraph(1), 1))); } @@ -493,7 +493,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158023_rtf) CPPUNIT_TEST_FIXTURE(Test, testFdo77979) { createSwDoc("fdo77979.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); // font name is encoded with \fcharset of font CPPUNIT_ASSERT_EQUAL(u"\u5FAE\u8F6F\u96C5\u9ED1"_ustr, @@ -503,7 +503,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77979) CPPUNIT_TEST_FIXTURE(Test, testFdo53113) { createSwDoc("fdo53113.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); /* @@ -539,7 +539,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo53113) CPPUNIT_TEST_FIXTURE(Test, testFdo55939) { createSwDoc("fdo55939.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that the exported RTF was invalid. // Also, the 'Footnote text.' had an additional newline at its end. @@ -558,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo55939) CPPUNIT_TEST_FIXTURE(Test, testTextFrames) { createSwDoc("textframes.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The output was simply invalid, so let's check if all 3 frames were imported back. @@ -571,7 +571,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextFrames) CPPUNIT_TEST_FIXTURE(Test, testFdo53604) { createSwDoc("fdo53604.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Invalid output on empty footnote. uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); @@ -582,7 +582,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo53604) CPPUNIT_TEST_FIXTURE(Test, testFdo52286) { createSwDoc("fdo52286.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that font size wasn't reduced in sub/super script. CPPUNIT_ASSERT_EQUAL(sal_Int32(58), getProperty(getRun(getParagraph(1), 2), @@ -612,7 +612,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo61507) }; createSwDoc("fdo61507.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -628,14 +628,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo30983) }; createSwDoc("fdo30983.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testPlaceholder) { createSwDoc("placeholder.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Only the field text was exported, make sure we still have a field with the correct Hint text. uno::Reference xRun(getRun(getParagraph(1), 2)); @@ -656,7 +656,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMnor) }; createSwDoc("mnor.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -686,7 +686,7 @@ CPPUNIT_TEST_FIXTURE(Test, testI120928) }; createSwDoc("i120928.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -700,7 +700,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBookmark) }; createSwDoc("bookmark.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -719,7 +719,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlink) }; createSwDoc("hyperlink.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -739,7 +739,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkTdf100105) }; createSwDoc("hyperlink_empty.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -759,7 +759,7 @@ CPPUNIT_TEST_FIXTURE(Test, test78758) }; createSwDoc("fdo78758.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -784,7 +784,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextFrameBorders) }; createSwDoc("textframe-borders.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -822,7 +822,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextframeGradient) }; createSwDoc("textframe-gradient.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -830,7 +830,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_axialGradient) { // given a frame with an axial gradient (white - green - white) createSwDoc("tdf159824_axialGradient.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), @@ -854,7 +854,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRecordChanges) }; createSwDoc("record-changes.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -875,7 +875,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextframeTable) }; createSwDoc("textframe-table.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -900,7 +900,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo66682) }; createSwDoc("fdo66682.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -916,14 +916,14 @@ CPPUNIT_TEST_FIXTURE(Test, testParaShadow) }; createSwDoc("para-shadow.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testCharacterBorder) { createSwDoc("charborder.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); // RTF has just one border attribute (chbrdr) for text border so all side has @@ -979,7 +979,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo66743) }; createSwDoc("fdo66743.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -994,7 +994,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo68787) }; createSwDoc("fdo68787.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1008,14 +1008,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74709) }; createSwDoc("fdo74709.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf84832) { createSwDoc("tdf84832.docx"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); uno::Reference xCell = getCell(getParagraphOrTable(2), u"A1"_ustr); // This was 0, as left padding wasn't exported. CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(108)), @@ -1035,7 +1035,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelsize) }; createSwDoc("relsize.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1051,7 +1051,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineNumbering) }; createSwDoc("linenumbering.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1064,7 +1064,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77600) }; createSwDoc("fdo77600.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1076,14 +1076,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80167) }; createSwDoc("fdo80167.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testFdo32613) { createSwDoc("fdo32613.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // This was AS_CHARACTER, RTF export did not support writing anchored pictures. diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 74bdb5593007..a32c0bd4e774 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -73,7 +73,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45553) }; createSwDoc("fdo45553.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -102,7 +102,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN192129) }; createSwDoc("n192129.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -111,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45543) auto verify = [this]() { CPPUNIT_ASSERT_EQUAL(u"この文書は"_ustr, getBodyText()); }; createSwDoc("fdo45543.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -120,7 +120,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo42465) auto verify = [this]() { CPPUNIT_ASSERT_EQUAL(u"kód"_ustr, getBodyText()); }; createSwDoc("fdo42465.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45187) }; createSwDoc("fdo45187.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -163,7 +163,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN750757) }; createSwDoc("n750757.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45563) }; createSwDoc("fdo45563.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo43965) }; createSwDoc("fdo43965.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -234,7 +234,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN751020) }; createSwDoc("n751020.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -247,7 +247,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo79384) }; createSwDoc("fdo79384.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -259,7 +259,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47326) }; createSwDoc("fdo47326.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo46955) }; createSwDoc("fdo46955.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -307,7 +307,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81892) }; createSwDoc("fdo81892.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -327,7 +327,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45394) }; createSwDoc("fdo45394.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -336,7 +336,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48104) auto verify = [this]() { CPPUNIT_ASSERT_EQUAL(2, getPages()); }; createSwDoc("fdo48104.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -350,7 +350,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47107) }; createSwDoc("fdo47107.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -367,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44176) }; createSwDoc("fdo44176.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -386,7 +386,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo39053) }; createSwDoc("fdo39053.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -408,7 +408,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48356) }; createSwDoc("fdo48356.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -431,7 +431,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48023) createSwDoc("fdo48023.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48876) }; createSwDoc("fdo48876.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -459,7 +459,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48193) auto verify = [this]() { CPPUNIT_ASSERT_EQUAL(u"foo1bar"_ustr, getBodyText()); }; createSwDoc("fdo48193.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -479,7 +479,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44211) createSwDoc("fdo44211.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48037) }; createSwDoc("fdo48037.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -518,7 +518,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47764) }; createSwDoc("fdo47764.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -534,7 +534,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo38786) }; createSwDoc("fdo38786.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -547,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN757651) }; createSwDoc("n757651.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -566,7 +566,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49501) }; createSwDoc("fdo49501.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49271) }; createSwDoc("fdo49271.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo50539) }; createSwDoc("fdo50539.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -605,7 +605,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo50665) }; createSwDoc("fdo50665.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -626,7 +626,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49659) }; createSwDoc("fdo49659.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -645,7 +645,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo46966) }; createSwDoc("fdo46966.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -660,7 +660,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76633) }; createSwDoc("fdo76633.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48033) }; createSwDoc("fdo48033.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -724,7 +724,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo53594) }; createSwDoc("fdo53594.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -736,7 +736,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo36089) }; createSwDoc("fdo36089.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -745,7 +745,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48446) auto verify = [this]() { getParagraph(1, u"\u0418\u043C\u044F"_ustr); }; createSwDoc("fdo48446.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -758,7 +758,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47495) }; createSwDoc("fdo47495.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -770,7 +770,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAllGapsWord) }; createSwDoc("all_gaps_word.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -782,7 +782,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo52389) }; createSwDoc("fdo52389.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -802,7 +802,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49655) }; createSwDoc("fdo49655.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -821,7 +821,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo62805) }; createSwDoc("fdo62805.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -834,7 +834,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo52475) }; createSwDoc("fdo52475.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -847,7 +847,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo55493) }; createSwDoc("fdo55493.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -910,7 +910,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69384) }; createSwDoc("fdo69384-paste.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -959,7 +959,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShptxtPard) }; createSwDoc("shptxt-pard.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -984,7 +984,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDoDhgt) }; createSwDoc("do-dhgt.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -997,7 +997,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDplinehollow) }; createSwDoc("dplinehollow.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1012,7 +1012,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLeftmarginDefault) }; createSwDoc("leftmargin-default.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1024,7 +1024,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDppolyline) }; createSwDoc("dppolyline.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1040,7 +1040,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo56512) }; createSwDoc("fdo56512.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1057,7 +1057,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo52989) }; createSwDoc("fdo52989.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1074,7 +1074,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo54473) }; createSwDoc("fdo54473.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1086,7 +1086,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49934) }; createSwDoc("fdo49934.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1099,7 +1099,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo57886) }; createSwDoc("fdo57886.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1116,7 +1116,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58076) }; createSwDoc("fdo58076.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1131,7 +1131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo57678) }; createSwDoc("fdo57678.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1143,7 +1143,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo54612) }; createSwDoc("fdo54612.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1160,7 +1160,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58933) }; createSwDoc("fdo58933.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1182,7 +1182,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44053) }; createSwDoc("fdo44053.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1194,7 +1194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48440) }; createSwDoc("fdo48440.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1206,7 +1206,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58646line) }; createSwDoc("fdo58646line.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1218,7 +1218,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78502) }; createSwDoc("fdo78502.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1230,7 +1230,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58646) }; createSwDoc("fdo58646.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1245,7 +1245,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo59419) }; createSwDoc("fdo59419.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1261,7 +1261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHexCRLF) }; createSwDoc("hexcrlf.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1274,7 +1274,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58076_2) }; createSwDoc("fdo58076-2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1303,7 +1303,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo59638) }; createSwDoc("fdo59638.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1326,7 +1326,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo60722) }; createSwDoc("fdo60722.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1349,7 +1349,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDoDhgtOld) }; createSwDoc("do-dhgt-old.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1364,7 +1364,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo61909) }; createSwDoc("fdo61909.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1385,7 +1385,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo62288) }; createSwDoc("fdo62288.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1402,7 +1402,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo37716) }; createSwDoc("fdo37716.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1410,7 +1410,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo51916) { // Complex nested table caused a crash. createSwDoc("fdo51916.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); } } // end of anonymous namespace diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 40e004becf45..d01458c1a59f 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -60,7 +60,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100961_fixedDateTime) }; createSwDoc("tdf100961_fixedDateTime.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -84,7 +84,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108949) }; createSwDoc("tdf108949_footnoteCharFormat.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -99,7 +99,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141964_numId0) }; createSwDoc("tdf141964_numId0.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -121,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108949_footnote) }; createSwDoc("tdf108949_footnote.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -147,7 +147,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130817) }; createSwDoc("tdf130817.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -160,7 +160,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154129_transparentFrame) }; createSwDoc("tdf154129_transparentFrame.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -173,7 +173,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137683_charHighlightNone) }; createSwDoc("tdf137683_charHighlightNone.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -196,7 +196,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116436_tableBackground) }; createSwDoc("tdf116436_tableBackground.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(/*bIsExport*/ true); } @@ -219,7 +219,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf164945) }; createSwDoc("noparaborder.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -237,7 +237,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122589_firstSection) }; createSwDoc("tdf122589_firstSection.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -253,7 +253,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104035) }; createSwDoc("tdf104035.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -265,7 +265,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGraphicObjectFliph) }; createSwDoc("graphic-object-fliph.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -283,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114333) }; createSwDoc("tdf114333.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -308,7 +308,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115180) }; createSwDoc("tdf115180.docx"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -322,7 +322,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116841) }; createSwDoc("tdf116841.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -367,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf117268) }; createSwDoc("tdf117268.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -384,7 +384,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf117505) getProperty(xFirstPage, u"HeaderHeight"_ustr)); } // When saving to rtf: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -402,7 +402,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf117505) CPPUNIT_TEST_FIXTURE(Test, testTdf112520) { createSwDoc("tdf112520.docx"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Assert that the white shape is on top of the yellow one. CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getProperty(getShape(2), u"FillColor"_ustr)); @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNestedHyperlink) // assertion failed // - Expression: xComponent.is() // i.e. the RTF output was not well-formed, loading failed. - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure both hyperlinks are have the correct URLs. uno::Reference xParagraph = getParagraph(1); @@ -472,7 +472,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121623) }; createSwDoc("tdf121623.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -487,7 +487,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66543) }; createSwDoc("tdf66543.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -499,7 +499,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUlw) }; createSwDoc("ulw.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -514,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122455) }; createSwDoc("tdf122455.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -528,7 +528,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125719_case_1) }; createSwDoc("tdf125719_case_1.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -544,7 +544,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125719_case_2) }; createSwDoc("tdf125719_case_2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -560,7 +560,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTabs) }; createSwDoc("tabs.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123703) }; createSwDoc("tdf123703.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -589,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123703_stshfdbch) }; createSwDoc("tdf123703_stshfdbch.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -606,7 +606,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123703_compatible) }; createSwDoc("tdf123703_compatible.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -618,7 +618,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128428_monospaced) }; createSwDoc("tdf128428_monospaced.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -630,7 +630,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128428_compatible_monospaced) }; createSwDoc("tdf128428_compatible_monospaced.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128428_dntblnsbdb) }; createSwDoc("tdf128428_dntblnsbdb.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -657,7 +657,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDontBreakWrappedTables) } // When saving to rtf: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure \nobrkwrptbl is not written: SwDoc* pDoc = getSwDoc(); @@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) // Then make sure the section's gutter is still RTL: // Without the accompanying fix in place, this test would have failed as \rtlgutter was missing. verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -712,7 +712,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder) } // When saving that document to RTF: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure that the border distance is negative, so the first line of body text appears // on top of the page border: @@ -747,7 +747,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127806) CPPUNIT_ASSERT_EQUAL(static_cast(600), aSize.Height); CPPUNIT_ASSERT_EQUAL(static_cast(635), aSize.Width); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); // FIXME: We lost one shape on export, that's sucks xImage = getShape(1); @@ -782,7 +782,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148578) }; createSwDoc("tdf148578.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -797,7 +797,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInvalidParagraphStyle) }; createSwDoc("invalidParagraphStyle.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -812,7 +812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152784_1) }; createSwDoc("tdf152784_1.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -844,7 +844,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableExport) xFrame->setPropertyValue(u"RightMargin"_ustr, uno::Any(static_cast(71))); // When saving to RTF: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure the floating table is there & has the expected properties: uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); @@ -909,7 +909,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverRTFExport) } // When saving to RTF: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure that the overlap=never markup is written: SwDoc* pDoc = getSwDoc(); @@ -931,7 +931,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158409) }; createSwDoc("tdf158409.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -957,7 +957,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering) createSwDoc("listWithLgl.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index bd4ebe389b7c..b50ab24ec9c0 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -54,7 +54,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist12) }; createSwDoc("cjklist12.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -66,7 +66,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist13) }; createSwDoc("cjklist13.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -78,7 +78,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist16) }; createSwDoc("cjklist16.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist20) }; createSwDoc("cjklist20.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -102,7 +102,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist21) }; createSwDoc("cjklist21.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist24) }; createSwDoc("cjklist24.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist25) }; createSwDoc("cjklist25.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist30) }; createSwDoc("cjklist30.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -150,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist31) }; createSwDoc("cjklist31.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -172,7 +172,7 @@ CPPUNIT_TEST_FIXTURE(Test, test148518) }; createSwDoc("FORMDROPDOWN.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(Test, test150269) }; createSwDoc("hidden-linebreaks.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -242,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(Test, test129758) }; createSwDoc("tdf129631_lostBorders3.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -310,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(Test, test150382) }; createSwDoc("para-border.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAnchoredAtSamePosition) }; createSwDoc("anchor.fodt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(/*bIsExport*/ true); } @@ -380,7 +380,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineInsdel) }; createSwDoc("redline-insdel.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaAdjustDistribute) }; createSwDoc("para-adjust-distribute.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -425,7 +425,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129574) }; createSwDoc("mw00_table_of_contents_templates.doc"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -437,7 +437,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist34) }; createSwDoc("cjklist34.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -474,7 +474,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146489) }; createSwDoc("tdf146489.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -486,7 +486,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCjklist38) }; createSwDoc("cjklist38.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -513,7 +513,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrCell) }; createSwDoc("btlr-cell.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -531,7 +531,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114303) }; createSwDoc("tdf114303.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -550,7 +550,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTbrlFrame) }; createSwDoc("tbrl-frame.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -569,7 +569,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) }; createSwDoc("btlr-frame.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -584,7 +584,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129578_lostBI) }; createSwDoc("tdf129578_lostBI.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -610,7 +610,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129631_lostBorders) }; createSwDoc("tdf129631_lostBorders.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -666,7 +666,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129522_removeShadowStyle) }; createSwDoc("tdf129522_removeShadowStyle.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(/*bIsExport*/ true); } @@ -686,7 +686,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136587_noStyleName) }; createSwDoc("tdf136587_noStyleName.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -722,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTbrlPage) }; createSwDoc("tbrl-page.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -752,14 +752,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116358) }; createSwDoc("tdf116358.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testGutterLeft) { createSwDoc("gutter-left.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); uno::Reference xPageStyle; getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr) >>= xPageStyle; sal_Int32 nGutterMargin{}; @@ -774,7 +774,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterLeft) CPPUNIT_TEST_FIXTURE(Test, testGutterTop) { createSwDoc("gutter-top.rtf"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xSettings( xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY); @@ -812,7 +812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) createSwDoc("clearing-break.rtf"); // Then make sure that the clear property of the break is not ignored: verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Make sure that the clear property of the break is not ignored during export: verify(); } @@ -880,7 +880,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95706) }; createSwDoc("tdf95706.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -899,7 +899,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95706_2) }; createSwDoc("tdf95706_2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -941,7 +941,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf111851) }; createSwDoc("tdf111851.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -988,7 +988,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf139948) }; createSwDoc("tdf139948.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1038,7 +1038,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103956) }; createSwDoc("tdf103956.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1064,7 +1064,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148515) }; createSwDoc("tdf148515.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index deb68ff4d73d..4620120b787f 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -52,7 +52,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo63023) }; createSwDoc("fdo63023.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo42109) }; createSwDoc("fdo42109.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -84,7 +84,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo62977) }; createSwDoc("fdo62977.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN818997) }; createSwDoc("n818997.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -108,7 +108,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN818997B) }; createSwDoc("n818997B.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -124,7 +124,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153613_anchoredAfterPgBreak) }; createSwDoc("tdf153613_anchoredAfterPgBreak.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -140,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153613_anchoredAfterPgBreak2) }; createSwDoc("tdf153613_anchoredAfterPgBreak2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153613_anchoredAfterPgBreak4) }; createSwDoc("tdf153613_anchoredAfterPgBreak4.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -174,7 +174,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153613_anchoredAfterPgBreak5) }; createSwDoc("tdf153613_anchoredAfterPgBreak5.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -190,7 +190,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153613_inlineAfterPgBreak) }; createSwDoc("tdf153613_inlineAfterPgBreak.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -208,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153613_inlineAfterPgBreak2) }; createSwDoc("tdf153613_inlineAfterPgBreak2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -220,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo64671) }; createSwDoc("fdo64671.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -255,7 +255,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70578) }; createSwDoc("fdo70578.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -273,7 +273,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN825305) }; createSwDoc("n825305.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -290,7 +290,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106953) }; createSwDoc("tdf106953.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -303,7 +303,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112208) }; createSwDoc("tdf112208_hangingIndent.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -327,7 +327,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaBottomMargin) }; createSwDoc("para-bottom-margin.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -390,7 +390,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo66040) }; createSwDoc("fdo66040.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -422,7 +422,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77996) }; createSwDoc("fdo77996.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -434,7 +434,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47802) }; createSwDoc("fdo47802.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -446,7 +446,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo39001) }; createSwDoc("fdo39001.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -465,7 +465,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo54900) }; createSwDoc("fdo54900.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -482,7 +482,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo64637) }; createSwDoc("fdo64637.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN820504) }; createSwDoc("n820504.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -511,7 +511,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo67498) }; createSwDoc("fdo67498.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44715) }; createSwDoc("fdo44715.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -538,7 +538,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo68076) }; createSwDoc("fdo68076.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -550,7 +550,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70221) }; createSwDoc("fdo70221.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -569,7 +569,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCp1000018) }; createSwDoc("cp1000018.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -581,7 +581,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo94835) }; createSwDoc("fdo94835.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testNestedTable) @@ -640,7 +640,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNestedTable) }; createSwDoc("rhbz1065629.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -660,7 +660,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterPara) }; createSwDoc("footer-para.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -703,7 +703,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107413) }; createSwDoc("tdf107413.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -715,7 +715,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCp1000016) }; createSwDoc("hello.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -735,7 +735,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo65090) }; createSwDoc("fdo65090.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -803,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableBorderDefaults) }; createSwDoc("fdo68779.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -818,7 +818,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShpzDhgt) }; createSwDoc("shpz-dhgt.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -854,7 +854,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLevelfollow) }; createSwDoc("levelfollow.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -867,7 +867,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCharColor) }; createSwDoc("char-color.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -887,7 +887,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69289) }; createSwDoc("fdo69289.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -900,7 +900,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDptxbxRelation) }; createSwDoc("dptxbx-relation.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -914,7 +914,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDprectAnchor) }; createSwDoc("dprect-anchor.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -933,7 +933,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76628) }; createSwDoc("fdo76628.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -947,7 +947,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77267) }; createSwDoc("fdo77267.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -961,7 +961,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75735) }; createSwDoc("fdo75735.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -974,7 +974,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontOverride) }; createSwDoc("font-override.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -986,7 +986,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73241) }; createSwDoc("fdo73241.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1003,7 +1003,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80905) }; createSwDoc("fdo80905.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1015,7 +1015,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82106) }; createSwDoc("fdo82106.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1033,7 +1033,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74229) }; createSwDoc("fdo74229.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1046,7 +1046,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo79959) }; createSwDoc("fdo79959.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1059,7 +1059,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82078) }; createSwDoc("fdo82078.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1072,7 +1072,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCsBold) }; createSwDoc("cs-bold.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1092,7 +1092,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo84679) }; createSwDoc("fdo84679.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1112,7 +1112,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123393) }; createSwDoc("tdf123393.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1130,7 +1130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo83464) }; createSwDoc("fdo83464.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1144,7 +1144,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo86761) }; createSwDoc("fdo86761.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1156,7 +1156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82859) }; createSwDoc("fdo82859.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1177,7 +1177,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82076) }; createSwDoc("fdo82076.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1190,7 +1190,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo83204) }; createSwDoc("fdo83204.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } diff --git a/sw/qa/extras/rtfexport/rtfexport6.cxx b/sw/qa/extras/rtfexport/rtfexport6.cxx index 3499c54e1977..0dfd65569a38 100644 --- a/sw/qa/extras/rtfexport/rtfexport6.cxx +++ b/sw/qa/extras/rtfexport/rtfexport6.cxx @@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo85889pc) }; createSwDoc("fdo85889-pc.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -69,7 +69,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo85889pca) }; createSwDoc("fdo85889-pca.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo85889mac) }; createSwDoc("fdo85889-mac.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo72031) createSwDoc("fdo72031.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo86750) }; createSwDoc("fdo86750.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88811) }; createSwDoc("tdf88811.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -143,7 +143,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49893_2) }; createSwDoc("fdo49893-2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo89496) }; createSwDoc("fdo89496.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -168,7 +168,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75614) }; createSwDoc("tdf75614.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(Test, mathtype) }; createSwDoc("mathtype.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -193,7 +193,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf86182) }; createSwDoc("tdf86182.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -208,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf91074) }; createSwDoc("tdf91074.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -231,7 +231,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf86814) }; createSwDoc("tdf86814.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108505_fieldCharFormat) }; createSwDoc("tdf108505_fieldCharFormat.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -278,7 +278,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108505_fieldCharFormat2) }; createSwDoc("tdf108505_fieldCharFormat2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(/*bIsExport*/ true); } @@ -300,7 +300,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150267) }; createSwDoc("tdf150267.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -324,7 +324,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf151370) }; createSwDoc("tdf151370.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -340,7 +340,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108416) }; createSwDoc("tdf108416.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -352,7 +352,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBinSkipping) }; createSwDoc("bin-skipping.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -364,7 +364,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92061) }; createSwDoc("tdf92061.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -377,7 +377,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92481) }; createSwDoc("tdf92481.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94456) }; createSwDoc("tdf94456.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -409,7 +409,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94435) }; createSwDoc("tdf94435.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -427,7 +427,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf54584) }; createSwDoc("tdf54584.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -443,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96308Deftab) }; createSwDoc("tdf96308-deftab.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -484,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLandscape) }; createSwDoc("landscape.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -505,7 +505,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97035) }; createSwDoc("tdf97035.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -518,7 +518,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf87034) }; createSwDoc("tdf87034.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -548,7 +548,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95707) }; createSwDoc("tdf95707.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -564,7 +564,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96275) }; createSwDoc("tdf96275.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -578,7 +578,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf82073) }; createSwDoc("tdf82073.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -598,7 +598,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf74795) }; createSwDoc("tdf74795.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -621,7 +621,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137085) }; createSwDoc("tdf137085.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -634,7 +634,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77349) }; createSwDoc("tdf77349.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -649,7 +649,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf50821) }; createSwDoc("tdf50821.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -662,7 +662,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100507) }; createSwDoc("tdf100507.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf44986) }; createSwDoc("tdf44986.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -694,7 +694,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf90697) }; createSwDoc("tdf90697.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -706,7 +706,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104317) }; createSwDoc("tdf104317.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -722,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104744) }; createSwDoc("tdf104744.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -745,7 +745,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testChicagoNumberingFootnote) uno::UNO_QUERY); xTextContentAppend->appendTextContent(xFootnote, {}); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); xFootnotesSupplier.set(mxComponent, uno::UNO_QUERY); sal_uInt16 nExpected = style::NumberingType::SYMBOL_CHICAGO; auto nActual @@ -780,7 +780,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105852) }; createSwDoc("tdf105852.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -794,7 +794,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104287) }; createSwDoc("tdf104287.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -808,7 +808,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105729) }; createSwDoc("tdf105729.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106694) }; createSwDoc("tdf106694.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -836,7 +836,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107116) }; createSwDoc("tdf107116.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -853,14 +853,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106950) }; createSwDoc("tdf106950.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf116371) { createSwDoc("tdf116371.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); auto xShape(getShape(1)); @@ -888,14 +888,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133437) }; createSwDoc("tdf133437.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf128320) { createSwDoc("tdf128320.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Shape does exist in RTF output @@ -934,7 +934,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129513) }; createSwDoc("tdf129513.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -948,14 +948,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138210) }; createSwDoc("tdf138210.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf137894) { createSwDoc("tdf137894.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); lang::Locale locale1( getProperty(getRun(getParagraph(1), 1), u"CharLocaleAsian"_ustr)); @@ -978,7 +978,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137894) CPPUNIT_TEST_FIXTURE(Test, testTdf138779) { createSwDoc("tdf138779.docx"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // The text "2. Kozuka Mincho Pro, 8 pt Ruby ..." has font size 11pt ( was 20pt ). CPPUNIT_ASSERT_EQUAL(11.f, getProperty(getRun(getParagraph(2), 14), u"CharHeight"_ustr)); } @@ -986,7 +986,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138779) CPPUNIT_TEST_FIXTURE(Test, testTdf144437) { createSwDoc("tdf144437.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); OString aRtfContent(read_uInt8s_ToOString(*pStream, pStream->TellEnd())); @@ -1024,7 +1024,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131234) }; createSwDoc("tdf131234.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1048,7 +1048,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118047) }; createSwDoc("tdf118047.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1072,7 +1072,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158950) }; createSwDoc("tdf158950.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1094,7 +1094,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104390) }; createSwDoc("tdf104390.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1117,7 +1117,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153681) }; createSwDoc("tdf153681.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx b/sw/qa/extras/rtfexport/rtfexport7.cxx index e8dc43a2cd7a..9031140e00cc 100644 --- a/sw/qa/extras/rtfexport/rtfexport7.cxx +++ b/sw/qa/extras/rtfexport/rtfexport7.cxx @@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureWrapPolygon) }; createSwDoc("picture-wrap-polygon.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -76,14 +76,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113408) }; createSwDoc("tdf113408.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testAbi10039) { createSwDoc("abi10039.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure we don't just crash on export, and additionally the shape should not be inline (as it's at-page anchored originally). @@ -94,7 +94,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAbi10039) CPPUNIT_TEST_FIXTURE(Test, testAbi10076) { createSwDoc("abi10076.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(2, getPages()); // Just make sure that we don't crash after exporting a fully calculated layout. } @@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEm) }; createSwDoc("em.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -138,14 +138,14 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingFont) }; createSwDoc("numbering-font.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testFdo82860) { createSwDoc("fdo82860.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that: @@ -159,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82860) CPPUNIT_TEST_FIXTURE(Test, testFdo82858) { createSwDoc("fdo82858.docx"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // This was table::BorderLineStyle::SOLID, exporter failed to write explicit no line when line color was written. CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, getProperty(getShape(1), u"TopBorder"_ustr).LineStyle); @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104936) }; createSwDoc("tdf104936.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -197,7 +197,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableRtl) }; createSwDoc("table-rtl.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumOverrideStart) }; createSwDoc("num-override-start.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -237,7 +237,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82006) }; createSwDoc("fdo82006.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -252,14 +252,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104081) }; createSwDoc("tdf104081.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf88583) { createSwDoc("tdf88583.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); CPPUNIT_ASSERT_EQUAL(1, getPages()); // This was FillStyle_NONE, as background color was missing from the color table during export. CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, @@ -279,7 +279,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMargmirror) }; createSwDoc("margmirror.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -296,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSautoupd) }; createSwDoc("sautoupd.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -307,7 +307,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyphauto) }; createSwDoc("hyphauto.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyphpar) }; createSwDoc("hyphpar.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -334,7 +334,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108955) }; createSwDoc("tdf108955.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -354,7 +354,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80708) }; createSwDoc("tdf80708.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -364,7 +364,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkWithoutURL) // Change the hyperlink, so its URL is empty. uno::Reference xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); xRun->setPropertyValue(u"HyperLinkURL"_ustr, uno::Any(OUString())); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); SvMemoryStream aMemoryStream; SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); aStream.ReadStream(aMemoryStream); @@ -376,7 +376,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkWithoutURL) CPPUNIT_TEST_FIXTURE(Test, testTdf92521) { createSwDoc("tdf92521.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // There should be a page break that's in the middle of the document: right after the table. // But there wasn't, so this was 1. CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114309) }; createSwDoc("tdf114309.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -414,7 +414,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94043) }; createSwDoc("tdf94043.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -439,7 +439,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94377) }; createSwDoc("tdf94377.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -462,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104079) }; createSwDoc("tdf104079.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -476,7 +476,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBackground) }; createSwDoc("page-background.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96175) }; createSwDoc("tdf96175.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedline) }; createSwDoc("redline.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomDocProps) }; createSwDoc("custom-doc-props.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -578,7 +578,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf65642) }; createSwDoc("tdf65642.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -600,7 +600,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPgnlcltr) }; createSwDoc("pgnlcltr.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -622,7 +622,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPgnucrm) }; createSwDoc("pgnucrm.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -644,7 +644,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPgnlcrm) }; createSwDoc("pgnlcrm.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -671,7 +671,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPgndec) }; createSwDoc("pgndec.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -686,14 +686,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf98806) }; createSwDoc("tdf98806.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf61901) { createSwDoc("tdf61901.rtf"); - save(u"Rich Text Format"_ustr); + save(TestFilter::RTF); // Test the file directly, as current RTF import gives the correct font name with and without the fix. SvStream* pStream = maTempFile.GetStream(StreamMode::READ); OString sLine; @@ -718,7 +718,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103925) }; createSwDoc("tdf103925.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -735,7 +735,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104228) }; createSwDoc("tdf104228.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -757,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104085) }; createSwDoc("tdf104085.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -774,7 +774,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113550) }; createSwDoc("tdf113550.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -802,7 +802,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLeveljcCenter) }; createSwDoc("leveljc-center.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -815,14 +815,14 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkTarget) }; createSwDoc("hyperlink-target.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf107620) { createSwDoc("tdf107620.docx"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // This failed, RTF export didn't write the \htmautsp compat flag, the // original bugdoc resulting in 2 pages instead of 1. uno::Reference xFactory(mxComponent, uno::UNO_QUERY); @@ -851,7 +851,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104937) }; createSwDoc("tdf104937.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -872,7 +872,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112507) }; createSwDoc("tdf112507.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -891,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107480) }; createSwDoc("tdf107480.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -919,7 +919,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermark) }; createSwDoc("watermark.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -937,7 +937,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153194Compat) }; createSwDoc("page-break-emptyparas.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -955,7 +955,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153194New) }; createSwDoc("page-break-emptyparas-spltpgpar.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -970,7 +970,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153178) }; createSwDoc("tdf153178.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -986,7 +986,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109790) }; createSwDoc("tdf109790.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1002,7 +1002,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112211) }; createSwDoc("tdf112211.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1014,7 +1014,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113202) }; createSwDoc("tdf113202.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1063,7 +1063,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156030) }; createSwDoc("tdf156030.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1084,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153195) }; createSwDoc("tdf153195.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -1102,7 +1102,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158762) }; createSwDoc("tdf158762.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index 02acdd8b5f70..136b614ab125 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155663) }; createSwDoc("piccrop.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(/*bIsExport*/ true); } @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_0) }; createSwDoc("tdf158586_pageBreak0.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_0B) }; createSwDoc("tdf158586_pageBreak0B.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -137,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_1) }; createSwDoc("tdf158586_pageBreak1.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_1header) }; createSwDoc("tdf158586_pageBreak1_header.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -173,7 +173,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_lostFrame) }; createSwDoc("tdf158586_lostFrame.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -212,7 +212,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166953) }; createSwDoc("Tpl-2min3_s1.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -236,7 +236,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndRTF) } // When saving to DOC: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure the endnote position is section end: SwDoc* pDoc = getSwDoc(); @@ -269,7 +269,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158983) }; createSwDoc("fdo55504-1-min.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -292,7 +292,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAnnotationPar) }; createSwDoc("tdf136445-1-min.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -309,7 +309,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158826_extraCR) }; createSwDoc("tdf158826_extraCR.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -317,7 +317,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_axialGradient) { // given a frame with an axial gradient (white - green - white) createSwDoc("tdf159824_axialGradient.odt"); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), @@ -360,7 +360,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle1) }; createSwDoc("tdf159824_gradientAngle1.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -391,7 +391,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle2) }; createSwDoc("tdf159824_gradientAngle2.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -421,7 +421,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle3) }; createSwDoc("tdf159824_gradientAngle3.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -452,7 +452,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle4) }; createSwDoc("tdf159824_gradientAngle4.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -471,7 +471,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160976_headerFooter) }; createSwDoc("tdf160976_headerFooter.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(/*IsExported*/ true); //tdf#164748: export must have the all same footer settings as the first page @@ -502,7 +502,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160976_headerFooter2) }; createSwDoc("tdf160976_headerFooter2.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -520,7 +520,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160976_headerFooter3) }; createSwDoc("tdf160976_headerFooter3.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -531,7 +531,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSectionBreakAfterSection) createSwDoc("section-break-after-section.rtf"); // When saving that document to RTF: - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Then make sure the 2nd paragraph starts on a new page after export, too: uno::Reference xParagraph = getParagraph(2); @@ -558,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158830) }; createSwDoc("tdf158830.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -578,7 +578,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158978) }; createSwDoc("tdf158978.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNotesAuthorDate) // Remove all personal info officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -616,7 +616,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChangesAuthor) // Remove all personal info officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); pBatch->commit(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); SvStream* pStream = maTempFile.GetStream(StreamMode::READ); CPPUNIT_ASSERT(pStream); @@ -649,7 +649,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158982) }; createSwDoc("tdf158982.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -672,7 +672,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161864) }; createSwDoc("tdf161864.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -690,7 +690,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161878) }; createSwDoc("tdf161878.rtf"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -704,7 +704,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165564) }; createSwDoc("tdf165564.odt"); verify(); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); verify(); } @@ -721,7 +721,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) // Exporting to a Word format, a tab is prepended to the endnote text. When imported, the // NoGapAfterNoteNumber compatibility flag is enabled; and the exported tab is the only thing // that separates the number and the text. The tab must not be stripped away on import. - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -734,7 +734,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) CPPUNIT_ASSERT_EQUAL(u"\tEndnote text"_ustr, xEndnoteText->getString()); } // Do a second round-trip. It must not duplicate the tab. - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -750,7 +750,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) xEndnoteText->setString(u"Endnote text"_ustr); } // Do a third round-trip. It must not introduce the tab, because of the compatibility flag. - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -781,7 +781,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155835) CPPUNIT_ASSERT_EQUAL(u"Текст сноски"_ustr, xEndnoteText->getString()); } // Check export, too - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { auto xSupplier = mxComponent.queryThrow(); auto xFootnotes = xSupplier->getFootnotes(); @@ -811,7 +811,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121493) assertXPath(pLayout, "//tab[3]['pass 1']/row/cell[2]/infos/bounds", "width", u"1000"); } // Check export, too - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { xmlDocUniquePtr pLayout = parseLayoutDump(); // Rounding (or maybe off-by-one?) errors sadly hit the test @@ -861,7 +861,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167169) assertXPath(pLayout, "//tab[4]['pass 1']/row/cell[2]/infos/bounds", "width", u"1000"); } // Check export, too - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { xmlDocUniquePtr pLayout = parseLayoutDump(); assertXPath(pLayout, "//tab", 4); @@ -919,7 +919,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167185) assertXPath(pLayout, "//tab['pass 1']/row[5]/cell[2]/infos/bounds", "width", u"1517"); } // Check export, too - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { xmlDocUniquePtr pLayout = parseLayoutDump(); assertXPath(pLayout, "//tab['pass 2']", 1); @@ -964,7 +964,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167512) CPPUNIT_ASSERT(getProperty(xParagraph, u"ListId"_ustr).isEmpty()); } // Check export - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { CPPUNIT_ASSERT_EQUAL(1, getShapes()); auto xTextBox = getShape(1).queryThrow(); @@ -1008,7 +1008,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167569) // After round-tripping the RTF, the marker properties must not get lost; previously, the // bullets became large, which additionally increased overall line height. - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { comphelper::SequenceAsHashMap markerProperties; @@ -1041,7 +1041,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167660) CPPUNIT_ASSERT(getSwDocShell()->GetWrtShell()); getSwDocShell()->GetWrtShell()->Insert(u"\uFB02"_ustr); - save(u"Rich Text Format"_ustr); + save(TestFilter::RTF); // Test that the character is exported as a negative integer OString rtf = read_uInt8s_ToOString(*maTempFile.GetStream(StreamMode::READ), SAL_MAX_INT32); @@ -1065,7 +1065,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167661) CPPUNIT_ASSERT_EQUAL(u"Wingdings"_ustr, level1[u"BulletFontName"_ustr].get()); } - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { // Check that the font of the bullet is not lost @@ -1130,7 +1130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167679) } // Check that after export to RTF, the area in the middle still has no border - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { auto xRun = getRun(getParagraph(1), 1, u"s"_ustr); @@ -1194,7 +1194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167569_2) assertXPath(pLayout, "//anchored/fly/txt[13]/infos/bounds", "height", lineHeight); } - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // 2. After round-tripping the RTF, the lines must keep the same height. @@ -1247,7 +1247,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf162342) assertXPath(pLayout, "//page[3]['pass 1']/infos/prtBounds", "height", u"6497"); } - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); { xmlDocUniquePtr pLayout = parseLayoutDump(); @@ -1292,7 +1292,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf168181) .queryThrow() ->setPropertyValue(u"HyperLinkURL"_ustr, uno::Any(u"c:\\\\temp\\doc1.doc"_ustr)); - saveAndReload(u"Rich Text Format"_ustr); + saveAndReload(TestFilter::RTF); // Test that the imported target string has correct expected number of backslashes. // Without the fix, this returned with single backslashes, because there was no proper diff --git a/sw/qa/extras/txtencexport/txtencexport.cxx b/sw/qa/extras/txtencexport/txtencexport.cxx index f1c3bb8d04ad..3871a62bb747 100644 --- a/sw/qa/extras/txtencexport/txtencexport.cxx +++ b/sw/qa/extras/txtencexport/txtencexport.cxx @@ -40,7 +40,7 @@ CPPUNIT_TEST_FIXTURE(TxtEncExportTest, testBulletsNotHidden) { createSwDoc("bullets.odt"); setFilterOptions(u"UTF8,,,,"_ustr); - save(u"Text (encoded)"_ustr); + save(TestFilter::TEXT_ENCODED); OString aData = readExportedFile(); OUString aString = OStringToOUString( @@ -69,7 +69,7 @@ CPPUNIT_TEST_FIXTURE(TxtEncExportTest, testBulletsHidden) { createSwDoc("bullets.odt"); setFilterOptions(u"UTF8,,,,,false"_ustr); - save(u"Text (encoded)"_ustr); + save(TestFilter::TEXT_ENCODED); OString aData = readExportedFile(); OUString aString = OStringToOUString( diff --git a/sw/qa/extras/txtexport/txtexport.cxx b/sw/qa/extras/txtexport/txtexport.cxx index 135586a5295f..7bd29d16207f 100644 --- a/sw/qa/extras/txtexport/txtexport.cxx +++ b/sw/qa/extras/txtexport/txtexport.cxx @@ -55,7 +55,7 @@ protected: CPPUNIT_TEST_FIXTURE(TxtExportTest, testBullets) { createSwDoc("bullets.odt"); - save(u"Text"_ustr); + save(TestFilter::TEXT); OString aData = readExportedFile(); OUString aString = OStringToOUString( @@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testBullets) CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf120574_utf8bom) { createSwDoc("UTF8BOMCRLF.txt"); - save(u"Text"_ustr); + save(TestFilter::TEXT); std::vector aMemStream = readMemoryStream(); OString aData(std::string_view(aMemStream.data(), aMemStream.size())); CPPUNIT_ASSERT_EQUAL(u8"\uFEFFAB\r\nCD\r\n"_ostr, aData); @@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf120574_utf8bom) CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf120574_utf16lebom) { createSwDoc("UTF16LEBOMCRLF.txt"); - save(u"Text"_ustr); + save(TestFilter::TEXT); std::vector aMemStream = readMemoryStream(); OUString aData(aMemStream.data(), aMemStream.size()); CPPUNIT_ASSERT_EQUAL(u"\uFEFFAB\r\nCD\r\n"_ustr, aData); @@ -105,7 +105,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf120574_utf16lebom) CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf142669_utf8) { createSwDoc("UTF8CRLF.txt"); - save(u"Text"_ustr); + save(TestFilter::TEXT); std::vector aMemStream = readMemoryStream(); OString aData(std::string_view(aMemStream.data(), aMemStream.size())); CPPUNIT_ASSERT_EQUAL(u8"AB\r\nCD\r\n"_ostr, aData); @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf142669_utf8) CPPUNIT_TEST_FIXTURE(TxtExportTest, testTdf142669_utf16le) { createSwDoc("UTF16LECRLF.txt"); - save(u"Text"_ustr); + save(TestFilter::TEXT); std::vector aMemStream = readMemoryStream(); OUString aData(aMemStream.data(), aMemStream.size()); CPPUNIT_ASSERT_EQUAL(u"AB\r\nCD\r\n"_ustr, aData); @@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testClearingBreakExport) xText->insertString(xCursor, u"bar"_ustr, /*bAbsorb=*/false); // When exporting to plain text: - save(u"Text"_ustr); + save(TestFilter::TEXT); // Then make sure that the newline is not lost: OString aActual = readExportedFile(); diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx index 994a9ece75fe..4f681693fd72 100644 --- a/sw/qa/extras/txtimport/txtimport.cxx +++ b/sw/qa/extras/txtimport/txtimport.cxx @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf70423) OUString aResStr = s.makeStringAndClear(); pWrtShell->Insert(aResStr); - saveAndReload(u"Text"_ustr); //Reloading the file again + saveAndReload(TestFilter::TEXT); //Reloading the file again // Without the fix, this test would have failed with: // - Expected: 1 diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index f6e2b98febed..28f950f65854 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1453,7 +1453,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo85554) xDrawPage->add(xShape); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // This was 1, we lost a shape on export. CPPUNIT_ASSERT_EQUAL(2, getShapes()); diff --git a/sw/qa/extras/uiwriter/uiwriter10.cxx b/sw/qa/extras/uiwriter/uiwriter10.cxx index 1ee3144b5a62..84ad9e5178d9 100644 --- a/sw/qa/extras/uiwriter/uiwriter10.cxx +++ b/sw/qa/extras/uiwriter/uiwriter10.cxx @@ -81,7 +81,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport) assertXPath(pXmlDoc, "//page[1]//body/tab"); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pDoc = getSwDoc(); // accept the deletion of the content of the first cell @@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport) // Save it to a DOCX and load it back. // Exporting change tracking of the row wasn't supported. // Also Manage Changes for the import. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); pDoc = getSwDoc(); // accept the deletion of the content of the first cell @@ -1025,7 +1025,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pDoc = getSwDoc(); // accept the deletion of the content of the first cell @@ -1107,7 +1107,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletionWithDOCXExpo // Save it to a DOCX and load it back. // Exporting change tracking of the cell wasn't supported. // Also Manage Changes for the import. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); pDoc = getSwDoc(); // accept the deletion of the content of the first cell @@ -1152,7 +1152,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155341_RedlineTableColumnInsertionW assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 3); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pDoc = getSwDoc(); // reject the insertion of the hidden content of the cell @@ -1228,7 +1228,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject) assertXPath(pXmlDoc, "//page[1]//body/tab"); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pDoc = getSwDoc(); // reject the deletion of the content of the first cell @@ -1343,7 +1343,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX dispatchCommand(mxComponent, u".uno:InsertRowsAfter"_ustr, {}); // save it to DOCX - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); SwViewShell* pViewShell = getSwDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); pViewShell->Reformat(); pXmlDoc = parseLayoutDump(); @@ -1527,7 +1527,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145091) CPPUNIT_ASSERT(pEditShell->GetRedlineCount() > 0); // save it to DOCX - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); SwViewShell* pViewShell = getSwDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); pViewShell->Reformat(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 2eb1c1156a61..b2c62c36e8ad 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -79,7 +79,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf47471_paraStyleBackground) getProperty(getParagraph(3), u"ParaStyleName"_ustr)); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT_EQUAL(Color(0xdedce6), getProperty(getParagraph(2), u"FillColor"_ustr)); // on round-trip, the paragraph style name was lost @@ -127,7 +127,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat) "height", u"260"); // save it to DOCX - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); pViewShell = getSwDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); pViewShell->Reformat(); pXmlDoc = parseLayoutDump(); @@ -2279,7 +2279,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817_round_trip) createSwDoc("tdf76817.fodt"); // save it to DOCX - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); SwViewShell* pViewShell = getSwDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); pViewShell->Reformat(); @@ -2583,7 +2583,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRTLparaStyle_LocaleArabic) createSwDoc(); // new, empty doc - everything defaults to RTL with Arabic locale // Save it and load it back. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xPageStyle( getStyles(u"ParagraphStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY_THROW); @@ -2700,7 +2700,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122942) const auto& rFormats = *pDoc->GetSpzFrameFormats(); CPPUNIT_ASSERT_EQUAL(static_cast(2), rFormats.size()); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pDoc = getSwDoc(); const auto& rFormats2 = *pDoc->GetSpzFrameFormats(); CPPUNIT_ASSERT_EQUAL(static_cast(2), rFormats2.size()); @@ -3229,7 +3229,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testConditionalHiddenSectionIssue) } // PDF export - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); auto pPdfDocument = parsePDFExport(); auto pPdfPage = pPdfDocument->openPage(0); diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index 706529715e52..914586cade41 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -603,7 +603,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96479) // Actually not needed, but the bug symptom of a missing bookmark // occurred because a broken bookmark was saved and loading silently // dropped the broken bookmark! - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pDoc = getSwDoc(); // Lookup "replacement" bookmark @@ -648,7 +648,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testBookmarkCollapsed) createSwDoc("collapsed_bookmark.odt"); // save original document - save(u"writer8"_ustr); + save(TestFilter::ODT); // load only content.xml from the resaved document xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -720,7 +720,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkText) } // save document - save(u"writer8"_ustr); + save(TestFilter::ODT); // load only content.xml from the resaved document xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -819,7 +819,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNew) } // save document - save(u"writer8"_ustr); + save(TestFilter::ODT); // load only content.xml from the resaved document xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -883,7 +883,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNewAfterReload } // save original document - save(u"writer8"_ustr); + save(TestFilter::ODT); // load only content.xml from the resaved document xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1345,7 +1345,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf91292) xPropertySet->setPropertyValue(u"FillStyle"_ustr, uno::Any(drawing::FillStyle_NONE)); // Save it and load it back. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xPropertySet.set(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE("No background color", drawing::FillStyle_NONE, @@ -2211,7 +2211,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testCreateDocxAnnotation) dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aPropertyValues); // Save it as DOCX & load it again - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // get the annotation uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx index 53b18f94d35d..8bbe4d9588af 100644 --- a/sw/qa/extras/uiwriter/uiwriter5.cxx +++ b/sw/qa/extras/uiwriter/uiwriter5.cxx @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf140982) CPPUNIT_ASSERT_EQUAL(u"Lorem ipsum dolor sit amet..."_ustr, getParagraph(1)->getString()); // Save it and load it back. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Test comment range feature on tracked deletion. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); @@ -1142,7 +1142,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDocxAttributeTableExport) xShape->setPropertyValue(u"HoriOrientRelation"_ustr, uno::Any(static_cast(0))); } // save it to docx - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xShape(getShape(1), uno::UNO_QUERY); diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index f2b673a8c84a..c5360822246d 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -659,7 +659,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113790) pWrtShell->Paste(aClipboard); // Save it as DOCX & load it again - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157937) @@ -972,7 +972,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf115013) pWrtShell->InsertField2(aField); } // Save it as DOCX & load it again - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); pDoc = getSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2339,7 +2339,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInconsistentBookmark) // save document and verify the bookmark scoup { // save document - save(u"writer8"_ustr); + save(TestFilter::ODT); // load only content.xml xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -3021,7 +3021,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInsertPdf) dispatchCommand(mxComponent, u".uno:InsertGraphic"_ustr, aArgs); // Save and load cycle - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xShape = getShape(1); // Assert that we have a replacement graphics @@ -3057,7 +3057,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143760WrapContourToOff) CPPUNIT_ASSERT_EQUAL(false, getProperty(getShape(1), u"SurroundContour"_ustr)); // Without fix this had failed, because the shape was written to file with contour. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(false, getProperty(getShape(1), u"SurroundContour"_ustr)); } @@ -3081,7 +3081,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testHatchFill) xDrawPage->add(xShape); // Save it as DOCX and load it again. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); CPPUNIT_ASSERT_EQUAL(1, getShapes()); // tdf#127989 Without fix this had failed, because the background of the hatch was not set as 'no background'. @@ -3140,7 +3140,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCrashOnExit) // save and reload // Before the fix this crashed here and could not reopen. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCaptionShape) @@ -3158,7 +3158,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCaptionShape) xDrawPage->add(xShape); // Save it as DOCX and load it again. - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); // Without fix in place, the shape was lost on export. CPPUNIT_ASSERT_EQUAL(1, getShapes()); diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index af749d10bd75..f7369414f232 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -1352,7 +1352,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf74230) { createSwDoc(); //exporting the empty document to ODT via TempFile - save(u"writer8"_ustr); + save(TestFilter::ODT); CPPUNIT_ASSERT(maTempFile.IsValid()); //loading an XML DOM of the "styles.xml" of the TempFile xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -2182,7 +2182,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testEmbeddedDataSource) xConnection->close(); // Reload: should still have a component and a data source, too. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); CPPUNIT_ASSERT(xDatabaseContext->hasByName(u"calc-data-source"_ustr)); // Data source has a table named Sheet1 after saving to a different directory. @@ -2897,7 +2897,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149184) // [CUT] sw_uiwriter7 // Segmentation fault (core dumped) // [_RUN_____] testTdf149184::TestBody - save(u"MS Word 97"_ustr); + save(TestFilter::DOC); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149089) diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 28e798df4fac..f91a0db7e1b1 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -626,7 +626,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf135014) dispatchCommand(mxComponent, u".uno:StyleNewByExample"_ustr, aArgs2); // Without the fix in place, this test would have failed here - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); xmlDocUniquePtr pXmlStyles = parseExport(u"word/styles.xml"_ustr); assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NewNumberingStyle']/w:qFormat", 1); @@ -2972,7 +2972,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899) getParagraph(3, u"c"_ustr); // Save it as DOCX & load it again - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); uno::Reference xNumberingRules = getProperty>(getParagraph(1), u"NumberingRules"_ustr); @@ -3042,7 +3042,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf153636) { createSwDoc("tdf153636.odt"); dispatchCommand(mxComponent, u".uno:UpdateAllIndexes"_ustr, {}); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); @@ -3178,7 +3178,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf73483) CPPUNIT_ASSERT_EQUAL(u"Right Page"_ustr, pWrtShell->GetCurPageStyle().toString()); // Make sure that the page break with page style survives ODF save-and-reload - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xmlDocUniquePtr pXml = parseExport(u"content.xml"_ustr); CPPUNIT_ASSERT(pXml); diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index e7fb8e2ba8cd..79f707aff78e 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -177,7 +177,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testHiddenSectionShape) CPPUNIT_ASSERT_EQUAL(0, getShapes()); // this would assert/crash because the shape was anchored to SwEndNode - save(u"writer8"_ustr); + save(TestFilter::ODT); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testSetStringDeletesShape) @@ -392,7 +392,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testSplitFloatingTable) } // now check that these round-trip as floating tables - saveAndReload(u"Office Open XML Text"_ustr); + saveAndReload(TestFilter::DOCX); { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -1872,7 +1872,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf71583) } { - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); checkDocument(); } } diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index f30253d6be30..9161980a6cbe 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -1554,7 +1554,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf164921) xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); } { - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xSFS(mxComponent, uno::UNO_QUERY); uno::Reference xListStyles( diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 3d929771944b..0eea4f3ec8da 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -765,7 +765,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112346) }; createSwDoc("tdf112346.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -865,7 +865,7 @@ DECLARE_WW8EXPORT_TEST(testTscp, "tscp.doc") CPPUNIT_TEST_FIXTURE(Test, testFdo45724) { createSwDoc("fdo45724.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The text and background color of the control shape was not correct. @@ -878,7 +878,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45724) CPPUNIT_TEST_FIXTURE(Test, testTdf136620) { createSwDoc("tdf136620.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -897,7 +897,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136620) CPPUNIT_TEST_FIXTURE(Test, testFdo46020) { createSwDoc("fdo46020.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The footnote in that document wasn't exported, check that it is actually exported uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); @@ -944,7 +944,7 @@ DECLARE_WW8EXPORT_TEST(testNewPageStylesTable, "new-page-styles.doc") CPPUNIT_TEST_FIXTURE(Test, testFdo42144) { createSwDoc("fdo42144.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Footer wasn't disabled -- instead empty footer was exported. uno::Reference xStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); @@ -954,7 +954,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo42144) CPPUNIT_TEST_FIXTURE(Test, testCharacterBorder) { createSwDoc("charborder.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xRun(getRun(getParagraph(1),1), uno::UNO_QUERY); // WW8 has just one border attribute (sprmCBrc) for text border so all side has @@ -993,7 +993,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCharacterBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf41542_imagePadding) { createSwDoc("tdf41542_imagePadding.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // borderlessImage - image WITHOUT BORDERS : simulate padding with -crop @@ -1090,7 +1090,7 @@ DECLARE_WW8EXPORT_TEST(testCommentsNested, "comments-nested.doc") CPPUNIT_TEST_FIXTURE(Test, testBorderColoursExport) { createSwDoc("bordercolours.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // This is very close to testBorderColours in ww8import.cxx, but for export @@ -1219,7 +1219,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBorderColoursExport) CPPUNIT_TEST_FIXTURE(Test, testRedlineExport1) { createSwDoc("redline-export-1.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xParagraph = getParagraph(1); uno::Reference xRunEnumAccess(xParagraph, uno::UNO_QUERY); @@ -1235,7 +1235,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineExport1) CPPUNIT_TEST_FIXTURE(Test, testRedlineExport2) { createSwDoc("redline-export-2.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); //there must be redline information on the first portion of the third paragraph before and after reloading CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(3), 1), u"RedlineType"_ustr)); @@ -1244,7 +1244,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineExport2) CPPUNIT_TEST_FIXTURE(Test, testRedlineExport3) { createSwDoc("redline-export-3.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); //there must be redline information just on the para-break boundary between para one and two CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(1), 1), u"RedlineType"_ustr)); @@ -1256,7 +1256,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineExport3) CPPUNIT_TEST_FIXTURE(Test, testCellBgColor) { createSwDoc("cell-bg-color.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -1382,7 +1382,7 @@ DECLARE_WW8EXPORT_TEST(testRES_MIRROR_GRAPH_BOTH, "tdf56321_flipImage_both.doc") CPPUNIT_TEST_FIXTURE(Test, testCommentExport) { createSwDoc("comment-export.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); struct TextPortionInfo { OUString sKind; @@ -1460,7 +1460,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentExport) CPPUNIT_TEST_FIXTURE(Test, testTableKeep) { createSwDoc("tdf91083.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(7, getPages()); //emulate table "keep with next" -do not split table xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -1472,7 +1472,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableKeep) CPPUNIT_TEST_FIXTURE(Test, tesTdf91083_tableKeep2) { createSwDoc("tdf91083_tableKeep2.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); //emulate table "keep with next" - split large row in order to keep with previous paragraph xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Table doesn't split, so it starts on page 2", @@ -1488,7 +1488,7 @@ CPPUNIT_TEST_FIXTURE(Test, tesTdf91083_tableKeep2) CPPUNIT_TEST_FIXTURE(Test, tesTdf91083_tableKeep3) { createSwDoc("tdf91083_tableKeep3.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(3, getPages()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); //emulate table "keep with next" - split single row table in order to keep with previous paragraph @@ -1511,14 +1511,14 @@ DECLARE_WW8EXPORT_TEST(testTdf76349_textboxMargins, "tdf76349_textboxMargins.doc CPPUNIT_TEST_FIXTURE(Test, testMoveRange) { createSwDoc("fdo66304-1.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); //the save must survive without asserting } CPPUNIT_TEST_FIXTURE(Test, testClearFramePams) { createSwDoc("tdf46441-2.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); //the save must survive without asserting } @@ -1536,7 +1536,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94386) SfxRequest aRequest(FN_ENVELOP, SfxCallMode::SYNCHRON, aSet); SwModule::get()->ExecOther(aRequest); } - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // check that the first and next page use different page styles uno::Reference xModel(mxComponent, uno::UNO_QUERY); @@ -1566,7 +1566,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94386) CPPUNIT_TEST_FIXTURE(Test, testTdf99474) { createSwDoc("tdf99474.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The bullet colour of paragraph #3 should be COL_AUTO auto xPara = getParagraph(3); diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index cd7fd1d72d35..005e6babc92f 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -61,7 +61,7 @@ DECLARE_WW8EXPORT_TEST(testTdf99120, "tdf99120.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf41542_borderlessPadding) { createSwDoc("tdf41542_borderlessPadding.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // the page style's borderless padding should force this to 3 pages, not 1 CPPUNIT_ASSERT_EQUAL( 3, getPages() ); } @@ -101,14 +101,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128700_relativeTableWidth) // This also resulted in a layout loop when flys were allowed to split in footers. createSwDoc("tdf128700_relativeTableWidth.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf116436_tableBackground) { createSwDoc("tdf116436_tableBackground.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -203,7 +203,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote) createSwDoc("tdf55427_footnote2endnote.odt"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(/*bIsExport*/ true); } @@ -265,7 +265,7 @@ DECLARE_WW8EXPORT_TEST(testTdf112517_maxSprms, "tdf112517_maxSprms.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf108448_endNote) { createSwDoc("tdf108448_endNote.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xEndnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xEndnotes = xEndnotesSupplier->getEndnotes(); @@ -278,7 +278,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108448_endNote) CPPUNIT_TEST_FIXTURE(Test, testTdf106062_nonHangingFootnote) { createSwDoc("tdf106062_nonHangingFootnote.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFootnotes = xFootnotesSupplier->getFootnotes(); @@ -290,7 +290,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106062_nonHangingFootnote) CPPUNIT_TEST_FIXTURE(Test, testTdf116570_exportFootnote) { createSwDoc("tdf116570_exportFootnote.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFootnotes = xFootnotesSupplier->getFootnotes(); @@ -311,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80635_pageRightRTL) }; createSwDoc("tdf80635_pageRightRTL.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -324,7 +324,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80635_marginRTL) }; createSwDoc("tdf80635_marginRightRTL.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80635_marginLeft) }; createSwDoc("tdf80635_marginLeft.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -356,7 +356,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80635_pageLeft) }; createSwDoc("tdf80635_pageLeft.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -395,7 +395,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107773) }; createSwDoc("tdf107773.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -427,7 +427,7 @@ DECLARE_WW8EXPORT_TEST(testTdf121110_absJustify, "tdf121110_absJustify.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf106174_rtlParaAlign) { createSwDoc("tdf106174_rtlParaAlign.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_CENTER), getProperty(getParagraph(1), u"ParaAdjust"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_CENTER), getProperty(getParagraph(2), u"ParaAdjust"_ustr)); uno::Reference xPropertySet(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Another paragraph aligned to right"_ustr), uno::UNO_QUERY); @@ -539,7 +539,7 @@ DECLARE_WW8EXPORT_TEST(testTdf111480, "tdf111480.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf70838) { createSwDoc("tdf70838.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); SwDoc* pDoc = getSwDoc(); @@ -551,7 +551,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf70838) CPPUNIT_TEST_FIXTURE(Test, testTdf70838b_verticalRotation) { createSwDoc("tdf70838b_verticalRotation.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); SwDoc* pDoc = getSwDoc(); @@ -566,7 +566,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf70838b_verticalRotation) CPPUNIT_TEST_FIXTURE(Test, testTdf129247) { createSwDoc("tdf129247.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Without the fix in place, the checkbox wouldn't be exported CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -575,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129247) CPPUNIT_TEST_FIXTURE(Test, testActiveXCheckbox) { createSwDoc("checkbox_control.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // First check box anchored as a floating object @@ -643,7 +643,7 @@ DECLARE_WW8EXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.doc") CPPUNIT_TEST_FIXTURE(Test, testTableCrossReference) { createSwDoc("table_cross_reference.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // MSO uses simple bookmarks for referencing table caption, so we do the same by export @@ -802,7 +802,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCrossReference) CPPUNIT_TEST_FIXTURE(Test, testTableCrossReferenceCustomFormat) { createSwDoc("table_cross_reference_custom_format.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // Check also captions with custom formatting @@ -919,7 +919,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCrossReferenceCustomFormat) CPPUNIT_TEST_FIXTURE(Test, testObjectCrossReference) { createSwDoc("object_cross_reference.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(2, getPages()); // tdf#42346: Cross references to objects were not saved // MSO uses simple bookmarks for referencing table caption, so we do the same by export @@ -1094,7 +1094,7 @@ DECLARE_WW8EXPORT_TEST(testTdf112118_DOC, "tdf112118.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf117503) { createSwDoc("tdf117503.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // This was 3, first page + standard page styles were not merged together // on export. CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -1122,7 +1122,7 @@ DECLARE_WW8EXPORT_TEST(testTdf117885, "tdf117885.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf118133) { createSwDoc("tdf118133.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // This was 0, doc import + doc export resulted in lost image due to broken // lazy-loading of tiff images. CPPUNIT_ASSERT_EQUAL(static_cast(15240), getShape(1)->getSize().Width); @@ -1154,7 +1154,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When saving that document to DOC and loading it back: - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Then make sure the dummy character at the end is filtered out: OUString aBodyText = getBodyText(); diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index a70a45a152ad..8dbd63fb7dac 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -191,7 +191,7 @@ DECLARE_WW8EXPORT_TEST(testGutterLeft, "gutter-left.doc") CPPUNIT_TEST_FIXTURE(Test, testGutterTop) { createSwDoc("gutter-top.doc"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xSettings( xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY); @@ -221,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128501) uno::Reference xShapeDescriptor = getShape(1); CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, xShapeDescriptor->getShapeType()); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); xShapeDescriptor = getShape(1); // Without the fix in place, this test would have failed with // - Expected: FrameShape @@ -248,7 +248,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) uno::UNO_QUERY); xTextContentAppend->appendTextContent(xFootnote, {}); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); xFootnotesSupplier.set(mxComponent, uno::UNO_QUERY); sal_uInt16 nExpected = style::NumberingType::ARABIC_ZERO; auto nActual = getProperty(xFootnotesSupplier->getFootnoteSettings(), u"NumberingType"_ustr); @@ -278,7 +278,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote) uno::UNO_QUERY); xTextContentAppend->appendTextContent(xFootnote, {}); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); xFootnotesSupplier.set(mxComponent, uno::UNO_QUERY); sal_uInt16 nExpected = style::NumberingType::SYMBOL_CHICAGO; auto nActual = getProperty(xFootnotesSupplier->getFootnoteSettings(), u"NumberingType"_ustr); @@ -317,7 +317,7 @@ DECLARE_WW8EXPORT_TEST(testdf79553_lineNumbers, "tdf79553_lineNumbers.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf138302_restartNumbering) { createSwDoc("tdf138302_restartNumbering.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xPara(getParagraph(8), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"1."_ustr, getProperty(xPara, u"ListLabelString"_ustr)); @@ -343,7 +343,7 @@ DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf122460_header) { createSwDoc("tdf122460_header.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference pageStyles = getStyles(u"PageStyles"_ustr); uno::Reference pageStyle(pageStyles->getByName(u"Standard"_ustr), uno::UNO_QUERY); @@ -411,7 +411,7 @@ DECLARE_WW8EXPORT_TEST(testTdf135672_tableGrows, "tdf135672_tableGrows.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields) { createSwDoc("tdf79435_legacyInputFields.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); //using .docx input file to verify cross-format compatibility. uno::Reference xFormField = getProperty< uno::Reference >(getRun(getParagraph(5), 4), u"Bookmark"_ustr); uno::Reference xParameters(xFormField->getParameters()); @@ -466,7 +466,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields) CPPUNIT_TEST_FIXTURE(Test, testTdf134264) { createSwDoc("tdf134264.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Without the fix in place, ADDRESSBLOCK fields would have been lost after RT CPPUNIT_ASSERT_EQUAL(u"MF"_ustr, getParagraph(1)->getString()); CPPUNIT_ASSERT_EQUAL(u"M19"_ustr, getParagraph(2)->getString()); @@ -508,7 +508,7 @@ DECLARE_WW8EXPORT_TEST(testTdf120225_textControlCrossRef, "tdf120225_textControl CPPUNIT_TEST_FIXTURE(Test, testTdf134948) { createSwDoc("tdf134948.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Only 1 paragraph", 1, getParagraphs()); @@ -517,7 +517,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134948) CPPUNIT_TEST_FIXTURE(Test, testTdf132726) { createSwDoc("tdf132726.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xRun = getRun(getParagraph(1), 1, u"What sentence has a yellow background? "_ustr); @@ -530,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132726) CPPUNIT_TEST_FIXTURE(Test, testTdf127316_autoEscapement) { createSwDoc("tdf127316_autoEscapement.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xPara = getParagraph(2); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty(getRun(xPara, 1, u"Normal text "_ustr), u"CharEscapement"_ustr), 0); @@ -545,7 +545,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127316_autoEscapement) CPPUNIT_TEST_FIXTURE(Test, testTdf127316_autoEscapement2) { createSwDoc("tdf127316_autoEscapement2.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(2, getPages()); uno::Reference xPara = getParagraph(1); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty(getRun(xPara, 1, u"Base1"_ustr), u"CharEscapement"_ustr), 0); @@ -560,7 +560,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127316_autoEscapement2) CPPUNIT_TEST_FIXTURE(Test, testTdf120412_proportionalEscapement) { createSwDoc("tdf120412_proportionalEscapement.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); uno::Reference xPara = getParagraph(2); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty(getRun(xPara, 2, u"Base"_ustr), u"CharEscapement"_ustr), 0); // Import was limiting to 100%. And export based the position on the original height, not the proportional height. @@ -581,7 +581,7 @@ DECLARE_WW8EXPORT_TEST(testTdf116194, "tdf116194.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf121111_fillStyleNone) { createSwDoc("tdf121111_fillStyleNone.docx"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); uno::Reference xStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Numbering - First level"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(Color(0xb8cce4), getProperty(xStyle, u"ParaBackColor"_ustr));//R:184 G:204 B:228 @@ -595,7 +595,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121111_fillStyleNone) CPPUNIT_TEST_FIXTURE(Test, testTdf128608_fillStyleNoneB) { createSwDoc("tdf128608_fillStyleNoneB.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xText(getParagraph(1)); CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty(xText, u"ParaBackColor"_ustr)); @@ -645,7 +645,7 @@ DECLARE_WW8EXPORT_TEST(testTdf123433_fillStyleStop, "tdf123433_fillStyleStop.doc CPPUNIT_TEST_FIXTURE(Test, testTdf127862_pageFillStyle) { createSwDoc("tdf127862_pageFillStyle.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(6, getPages()); uno::Reference xStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT(drawing::FillStyle_NONE != getProperty(xStyle, u"FillStyle"_ustr)); @@ -670,7 +670,7 @@ DECLARE_WW8EXPORT_TEST(testTdf128608_tableParaBackColor, "tdf128608_tableParaBac CPPUNIT_TEST_FIXTURE(Test, testTdf117217_largeTableBackgrounds) { createSwDoc("tdf117217_largeTableBackgrounds.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -685,7 +685,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf117217_largeTableBackgrounds) CPPUNIT_TEST_FIXTURE(Test, testTdf94009_zeroPgMargin) { createSwDoc("tdf94009_zeroPgMargin.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference defaultStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); @@ -710,7 +710,7 @@ DECLARE_WW8EXPORT_TEST(testTdf120711_joinedParagraphWithChangeTracking, "tdf1207 CPPUNIT_TEST_FIXTURE(Test, testTdf129522_removeShadowStyle) { createSwDoc("tdf129522_removeShadowStyle.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference< container::XNameAccess > paragraphStyles = getStyles(u"ParagraphStyles"_ustr); uno::Reference< beans::XPropertySet > xStyleProps(paragraphStyles->getByName(u"Shadow"_ustr), uno::UNO_QUERY_THROW); @@ -802,7 +802,7 @@ DECLARE_WW8EXPORT_TEST(testImageCommentAtChar, "image-comment-at-char.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf126708emf) { createSwDoc("tdf126708_containsemf.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); auto xShape = getShape(1); @@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126708emf) CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) { createSwDoc("btlr-frame.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -887,7 +887,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) // Then make sure the section's gutter is still RTL: // Without the accompanying fix in place, this test would have failed as the SPRM was missing. verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -999,7 +999,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104239_chapterNumberTortureTest) createSwDoc("tdf104239_chapterNumberTortureTest.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(/*bIsExport*/ true); } @@ -1071,7 +1071,7 @@ DECLARE_WW8EXPORT_TEST(testTdf134570, "tdf134570.doc") CPPUNIT_TEST_FIXTURE(Test, testTdf136814) { createSwDoc("tdf136814.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); sal_Int32 nBorderDistance = static_cast(106); @@ -1090,7 +1090,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79186_noLayoutInCell) // so there has to be some give and take as the most suitable choice is selected. createSwDoc("tdf79186_noLayoutInCell.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getShapes()); // CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -1142,7 +1142,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) createSwDoc("clearing-break.doc"); // Then make sure that the clear property of the break is not ignored: verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Make sure that the clear property of the break is not ignored during export: verify(); } @@ -1150,7 +1150,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) CPPUNIT_TEST_FIXTURE(Test, testTdf142840) { createSwDoc("tdf142840.odt"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index 17649dc8e46e..5db68c88b8a2 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -54,7 +54,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testTdf77964) { createSwDoc("tdf77964.doc"); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // both images were loading as AT_PARA instead of AS_CHAR. Image2 visually had text wrapping. CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty(getShapeByName(u"Image2"), u"AnchorType"_ustr)); } @@ -266,7 +266,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndDOC) } // When saving to DOC: - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Then make sure the endnote position is section end: SwDoc* pDoc = getSwDoc(); @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDontBreakWrappedTables) } // When saving to doc: - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Then make sure the compat flag is serialized: SwDoc* pDoc = getSwDoc(); @@ -375,7 +375,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverDOCExport) } // When saving to DOC: - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Then make sure that the overlap=never markup is written: SwDoc* pDoc = getSwDoc(); @@ -440,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering) createSwDoc("listWithLgl.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDOCExportDoNotMirrorRtlDrawObjs) createSwDoc("draw-obj-rtl-no-mirror-vml.docx"); // When saving that to DOC: - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); // Then make sure the shape is on the right margin: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -514,13 +514,13 @@ CPPUNIT_TEST_FIXTURE(Test, testEmptyGroup) CPPUNIT_ASSERT_EQUAL(size_t(0), pObject->GetSubList()->GetObjCount()); // it must not assert/crash on save - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); } CPPUNIT_TEST_FIXTURE(Test, testTdf135709) { createSwDoc("tdf135709.odt"); - saveAndReload("MS Word 97"); + saveAndReload(TestFilter::DOC); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xPropertySet(xTextFramesSupplier->getTextFrames()->getByName("Frame1") , uno::UNO_QUERY); @@ -537,7 +537,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135710) { // Uses same test doc as testTdf135709 createSwDoc("tdf135709.odt"); - saveAndReload("MS Word 97"); + saveAndReload(TestFilter::DOC); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -600,7 +600,7 @@ nde muito parto na água. Tb posso fazer porcentagem de atendimento..."_ustr); // make sure everything survives roundtrip createSwDoc("tdf56738.doc"); verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -611,7 +611,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120629) sal_Int16 numFormat = getNumberingTypeOfParagraph(1); CPPUNIT_ASSERT_EQUAL(static_cast(56), numFormat); - saveAndReload("MS Word 97"); + saveAndReload(TestFilter::DOC); sal_Int16 numFormat_after = getNumberingTypeOfParagraph(1); // Without the fix in place this fails with // Expected: 56 @@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf54862) }; verify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); verify(); } @@ -665,7 +665,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80596) }; fnVerify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); fnVerify(); } @@ -688,7 +688,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80596Hanging) }; fnVerify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); fnVerify(); } @@ -707,7 +707,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88908) CPPUNIT_ASSERT(!rIDSA.get(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES)); } - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); { SwDoc* pDoc = getSwDoc(); @@ -717,7 +717,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88908) rIDSA.set(DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES, true); } - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); { SwDoc* pDoc = getSwDoc(); @@ -739,7 +739,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) // Exporting to a Word format, a tab is prepended to the endnote text. When imported, the // NoGapAfterNoteNumber compatibility flag is enabled; and the exported tab is the only thing // that separates the number and the text. The tab must not be stripped away on import. - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -752,7 +752,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) CPPUNIT_ASSERT_EQUAL(u"\tEndnote text"_ustr, xEndnoteText->getString()); } // Do a second round-trip. It must not duplicate the tab. - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -768,7 +768,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf166620) xEndnoteText->setString(u"Endnote text"_ustr); } // Do a third round-trip. It must not introduce the tab, because of the compatibility flag. - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); { auto xFactory = mxComponent.queryThrow(); auto xSettings = xFactory->createInstance(u"com.sun.star.document.Settings"_ustr); @@ -797,7 +797,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167297) }; fnVerify(); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); fnVerify(); } @@ -817,7 +817,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167583) fnVerify(true); // Check that the value is persisted across save-reload - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); fnVerify(true); // Unset the compat flag @@ -829,7 +829,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167583) } fnVerify(false); - saveAndReload(u"MS Word 97"_ustr); + saveAndReload(TestFilter::DOC); fnVerify(false); } diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx index e43a2ea2a90a..6f9b457a2fb3 100644 --- a/sw/qa/filter/html/html.cxx +++ b/sw/qa/filter/html/html.cxx @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSvmImageExport) // When exporting to reqif: setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Then make sure we only export PNG: xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile(); @@ -149,7 +149,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCellFloatValueType) // When exporting to XHTML: setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Then make sure that the sdval attribute is omitted, which is not in the XHTML spec: xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile(); @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableRowSpanInAllCells) pBox->setRowSpan(-1); // When exporting to HTML: - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Then make sure that the output is simplified to valid HTML, by omitting the rowspan attribute // & the empty element: @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCenteredTableCSSExport) // When exporting to XHTML: setFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); - save(u"HTML (StarWriter)"_ustr); + save(TestFilter::HTML_WRITER); // Then make sure that CSS is used to horizontally position the table: xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile(); diff --git a/sw/qa/filter/md/md.cxx b/sw/qa/filter/md/md.cxx index 867e988d6184..10c5521a3393 100644 --- a/sw/qa/filter/md/md.cxx +++ b/sw/qa/filter/md/md.cxx @@ -68,7 +68,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportFormula) createSwDoc("tdf168572.odt"); // Without the fix in place, this test would have crashed here - save(u"Markdown"_ustr); + save(TestFilter::MD); std::string aActual = TempFileToString(); std::string aExpected("![]()" SAL_NEWLINE_STRING); @@ -81,7 +81,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportTableFrame) createSwDoc("table.odt"); // Without the fix in place, this test would have crashed here - save(u"Markdown"_ustr); + save(TestFilter::MD); std::string aActual = TempFileToString(); std::string aExpected("Text" SAL_NEWLINE_STRING SAL_NEWLINE_STRING @@ -94,7 +94,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingBasicElements) { createSwDoc("basic-elements.fodt"); - save(u"Markdown"_ustr); + save(TestFilter::MD); std::string aActual = TempFileToString(); std::string aExpected( // clang-format off @@ -159,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingRedlines) createSwDoc("redlines-and-comments.odt"); // Save as a markdown document - save(u"Markdown"_ustr); + save(TestFilter::MD); SvFileStream fileStream(maTempFile.GetURL(), StreamMode::READ); OUString aParagraph; // 1st paragraph @@ -248,7 +248,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingCodeSpan) pWrtShell->SetAttrSet(aSet); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the format of B is exported: std::string aActual = TempFileToString(); @@ -286,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingList) pWrtShell->NumUpDown(/*bDown=*/true); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure list type and level is exported: std::string aActual = TempFileToString(); @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingImage) pWrtShell->Insert(u" B"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the image is exported: std::string aActual = TempFileToString(); @@ -374,7 +374,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingTable) pWrtShell->Insert(u"C3"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the table content is not lost: std::string aActual = TempFileToString(); @@ -435,7 +435,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBlockQuoteMdExport) pWrtShell->Insert(u"test"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the format of the paragraph is exported: std::string aActual = TempFileToString(); @@ -469,7 +469,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCodeBlockMdExport) pDoc->SetTextFormatColl(*pCursor, pColl); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the code block is exported: std::string aActual = TempFileToString(); @@ -514,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableColumnAdjustMdExport) pWrtShell->SetAttrItem(SvxAdjustItem(SvxAdjust::Right, RES_PARATR_ADJUST)); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the table content is not lost: std::string aActual = TempFileToString(); @@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageLinkMdExport) pWrtShell->Insert(u" B"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the image is exported and the link is not lost: std::string aActual = TempFileToString(); @@ -603,7 +603,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNewlineMdExport) pWrtShell->Insert(u"B"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); std::string aActual = TempFileToString(); std::string aExpected("A " SAL_NEWLINE_STRING "B" SAL_NEWLINE_STRING); @@ -637,7 +637,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageDescTitleExport) pWrtShell->Insert(u" B"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the image is exported and the desc/title is not lost: std::string aActual = TempFileToString(); @@ -685,7 +685,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMultiParaTableMdExport) pWrtShell->Insert(u"C3"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure the A1 cell still only has inlines: std::string aActual = TempFileToString(); @@ -741,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNestedTableMdExport) pWrtShell->Insert(u"B2 outer"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure that the inner table is exported as flat paragraphs: std::string aActual = TempFileToString(); @@ -823,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTastListItemsMdExport) pWrtShell->Insert(u" bar"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure that the task list item markup is used: std::string aActual = TempFileToString(); @@ -882,7 +882,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedImageMdExport) pWrtShell->Insert(u" B"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure that the embedded image is exported: std::string aActual = TempFileToString(); @@ -915,7 +915,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedAnchoredImageMdExport) pWrtShell->Insert(u" B"_ustr); // When saving that to markdown: - save(u"Markdown"_ustr); + save(TestFilter::MD); // Then make sure that the embedded image is exported: std::string aActual = TempFileToString(); diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index cb276104f030..e5c3f69b264a 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -98,7 +98,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPlainTextContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxComboBoxContentControlExport) pWrtShell->InsertContentControl(SwContentControlType::COMBO_BOX); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -158,7 +158,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxHyperlinkShape) // When saving this document to DOCX, then make sure we don't crash on export (due to an // assertion failure for not-well-formed XML output): - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); } CPPUNIT_TEST_FIXTURE(Test, testDocxContentControlDropdownEmptyDisplayText) @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxContentControlDropdownEmptyDisplayText) pWrtShell->InsertContentControl(SwContentControlType::DROP_DOWN_LIST); // When saving to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that no display text attribute is written: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -198,7 +198,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxSymbolFontExport) xTextProps->setPropertyValue(u"CharFontCharSet"_ustr, uno::Any(awt::CharSet::SYMBOL)); // When exporting to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -233,7 +233,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxFloatingTableExport) pWrtShell->EndAllAction(); // When saving to docx: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure we write a floating table, not a textframe containing a table: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -280,7 +280,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapThroughLayoutInCell) xDrawPageSupplier->getDrawPage()->add(xShape); // When saving to docx: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that layoutInCell is undoing the effect of the import-time tweak: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotBreakWrappedTables) rIDSA.set(DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES, true); // When saving to docx: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the compat flag is serialized: xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); @@ -351,7 +351,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAllowTextAfterFloatingTableBreak) rIDSA.set(DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK, true); // When saving to docx: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the compat flag is serialized: xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); @@ -479,7 +479,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverDOCXExport) pWrtShell->EndAllAction(); // When saving to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure that the overlap=never markup is written: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); @@ -586,7 +586,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) pWrtShell->InsertFootnote(OUString(), /*bEndNote=*/true); // When saving to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure the endnote position is section end: xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); @@ -628,7 +628,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownEmptyItem) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When saving to DOCX: - save(u"Office Open XML Text"_ustr); + save(TestFilter::DOCX); // Then make sure we only emit 1 list item: xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); diff --git a/sw/qa/filter/xml/xml.cxx b/sw/qa/filter/xml/xml.cxx index 25a93e1df481..74adecc0f8d9 100644 --- a/sw/qa/filter/xml/xml.cxx +++ b/sw/qa/filter/xml/xml.cxx @@ -69,7 +69,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineRecordFlatExport) dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // When saving that to FODT: - save(u"OpenDocument Text Flat XML"_ustr); + save(TestFilter::FODT); // Then make sure this is written in the export result: xmlDocUniquePtr pDoc = parseXml(maTempFile); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index e8c0860b2743..e8ad6ca996c1 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -42,9 +42,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \ void TestName::verify() -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, u"Office Open XML Text"_ustr) -#define DECLARE_ODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, u"writer8"_ustr) -#define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, u"MS Word 97"_ustr) +#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, TestFilter::DOCX) +#define DECLARE_ODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, TestFilter::ODT) +#define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, TestFilter::DOC) class SwXTextDocument; namespace comphelper @@ -87,7 +87,7 @@ protected: * (Loads the requested file, calls 'verify' function, save it to temp file, load the * temp file and then calls 'verify' function again) */ - void executeLoadVerifyReloadVerify(const char* filename, const OUString& filter); + void executeLoadVerifyReloadVerify(const char* filename, TestFilter filter); /** * Function overridden by unit test. See DECLARE_SW_*_TEST macros @@ -195,7 +195,7 @@ protected: void header(); - void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); + void saveAndReload(TestFilter eFilter, const char* pPassword = nullptr); /// Get page count. int getPages() const; diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index d7ee579fce0d..4e074abdaa90 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -137,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testKeepRatio) CPPUNIT_ASSERT(pViewOption->IsKeepRatio()); // Then export as well: - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"settings.xml"_ustr); assertXPathContent(pXmlDoc, "//config:config-item[@config:name='KeepRatio']", u"true"); } diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 7c67a4454fd6..8214656983e8 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -61,7 +61,7 @@ SwModelTestBase::SwModelTestBase(const OUString& pTestDocumentPath) { } -void SwModelTestBase::executeLoadVerifyReloadVerify(const char* filename, const OUString& filter) +void SwModelTestBase::executeLoadVerifyReloadVerify(const char* filename, TestFilter filter) { maTempFile.EnableKillingFile(false); header(); @@ -389,9 +389,9 @@ void SwModelTestBase::loadURL(OUString const& rURL, const char* pPassword) calcLayout(); } -void SwModelTestBase::saveAndReload(const OUString& rFilter, const char* pPassword) +void SwModelTestBase::saveAndReload(TestFilter eFilter, const char* pPassword) { - save(rFilter, pPassword); + save(eFilter, pPassword); loadURL(maTempFile.GetURL(), pPassword); } diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index b833d96a7dc4..30c4b40d3bf4 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -147,17 +147,18 @@ uno::Any UnoApiTest::executeMacro(const OUString& rScriptURL, return aRet; } -void UnoApiTest::save(const OUString& rFilter, const char* pPassword) +void UnoApiTest::save(TestFilter eFilter, const char* pPassword) { + OUString aFilter(TestFilterNames.at(eFilter)); utl::MediaDescriptor aMediaDescriptor; - aMediaDescriptor[u"FilterName"_ustr] <<= rFilter; + aMediaDescriptor[u"FilterName"_ustr] <<= aFilter; if (!maFilterOptions.isEmpty()) aMediaDescriptor[u"FilterOptions"_ustr] <<= maFilterOptions; if (pPassword) { - if (rFilter != "Office Open XML Text" && rFilter != "Calc Office Open XML" - && rFilter != "Impress Office Open XML") + if (eFilter != TestFilter::DOCX && eFilter != TestFilter::XLSX + && eFilter != TestFilter::PPTX) { aMediaDescriptor[u"Password"_ustr] <<= OUString::createFromAscii(pPassword); } @@ -179,12 +180,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* pPassword) if (!mbSkipValidation) { - if (rFilter == "Office Open XML Text") + if (eFilter == TestFilter::DOCX) { // do nothing: too many validation errors right now } else - validate(maTempFile.GetFileName(), rFilter); + validate(maTempFile.GetFileName(), aFilter); } } @@ -194,9 +195,9 @@ void UnoApiTest::saveWithParams(const uno::Sequence& rPara xStorable->storeToURL(maTempFile.GetURL(), rParams); } -void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) +void UnoApiTest::saveAndReload(TestFilter eFilter, const char* pPassword) { - save(rFilter, pPassword); + save(eFilter, pPassword); loadFromURL(maTempFile.GetURL(), pPassword); } diff --git a/unoxml/qa/unit/rdftest.cxx b/unoxml/qa/unit/rdftest.cxx index 61c556369d21..a55942ee22f3 100644 --- a/unoxml/qa/unit/rdftest.cxx +++ b/unoxml/qa/unit/rdftest.cxx @@ -934,7 +934,7 @@ CPPUNIT_TEST_FIXTURE(RDFStreamTest, testRDFa2) loadFromFile(u"TESTRDFA.odt"); verify(/*bIsExport*/ false); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); verify(/*bIsExport*/ true); } @@ -1474,7 +1474,7 @@ CPPUNIT_TEST_FIXTURE(RDFStreamTest, testDocumentMetadataAccess) CPPUNIT_ASSERT_STATEMENT_EQUAL(aMFStatements[0], aVector[6]); CPPUNIT_ASSERT_STATEMENT_EQUAL(aFoobar_FooBarFoo, aVector[7]); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xDocumentMetadataAccess.set(mxComponent, uno::UNO_QUERY); xRepo = xDocumentMetadataAccess->getRDFRepository(); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 19455d4152ec..58dfd4ebf279 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -409,7 +409,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTocLink) xToc->refresh(); // Save as PDF. - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); std::unique_ptr pPdfDocument = parsePDFExport(); CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 0ba4132fb4e4..9587882fe5c9 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -93,7 +93,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextBoxLoss) { // Load a document that has a shape with a textbox in it. Save it to ODF and reload. loadFromFile(u"textbox-loss.docx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); // Make sure that the shape is still a textbox. uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf141301_Extrusion_Angle) loadFromFile(u"tdf141301_Extrusion_Skew.odg"); // Prepare use of XPath - save(u"draw8"_ustr); + save(TestFilter::ODG); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // Without fix draw:extrusion-skew="50 -135" was not written to file although "50 -135" is not @@ -150,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeExport) xMasterPage->setPropertyValue(u"Theme"_ustr, uno::Any(xTheme)); // Export to ODP: - save(u"impress8"_ustr); + save(TestFilter::ODP); // Check if the 12 colors are written in the XML: xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -189,7 +189,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testVideoSnapshot) CPPUNIT_ASSERT_EQUAL(static_cast(1356), rCrop.Right); // Execute ODP export: - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // Check that the preview was exported: @@ -279,7 +279,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testFillAndLineThemeColorExportImport) checkFillAndLineComplexColors(getShape(0)); - save(u"impress8"_ustr); + save(TestFilter::ODP); loadFromURL(maTempFile.GetURL()); @@ -290,7 +290,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) { // Given a document that refers to a theme color: loadFromFile(u"Reference-ThemeColors-TextAndFill.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); // Make sure the export result has the theme reference: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -462,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColor_ShapeFill) { loadFromFile(u"ReferenceShapeFill.pptx"); - saveAndReload(u"impress8"_ustr); + saveAndReload(TestFilter::ODP); // check fill color theme uno::Reference xShape(getShape(0)); @@ -535,7 +535,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeExtended) css::drawing::EnhancedCustomShapeMetalType::MetalMSCompatible); // Test, that attribute is written with 'draw' namespace in ODF version LATEST - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -552,7 +552,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeExtended) SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // assert XML. pXmlDoc = parseExport(u"content.xml"_ustr); @@ -573,7 +573,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeStrict) // save in ODF 1.4 strict and test that new attribute is written. SetODFDefaultVersion(SvtSaveOptions::ODFVER_014); - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//draw:enhanced-geometry", "extrusion-metal", u"true"); assertXPath(pXmlDoc, @@ -583,7 +583,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeStrict) SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - save(u"writer8"_ustr); + save(TestFilter::ODT); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//draw:enhanced-geometry", "extrusion-metal", u"true"); assertXPathNoAttribute(pXmlDoc, "//draw:enhanced-geometry", "extrusion-metal-type"); @@ -599,7 +599,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeODF) css::drawing::EnhancedCustomShapeMetalType::MetalODF); // Test, that attribute is written with 'draw' namespace in ODF version LATEST - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -613,13 +613,13 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeODF) // Test, that export in ODFVER_014 is valid. Needs adaption, when ODF 1.5 comes out. SetODFDefaultVersion(SvtSaveOptions::ODFVER_014); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // Test, that attribute is written with 'loext' namespace in extended version before ODF 1.4 SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - saveAndReload(u"calc8"_ustr); + saveAndReload(TestFilter::ODS); // assert XML. pXmlDoc = parseExport(u"content.xml"_ustr); @@ -632,7 +632,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeODF) // Test, that attribute is not written at all in strict version before ODF 1.4 SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); - save(u"calc8"_ustr); + save(TestFilter::ODS); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "//draw:enhanced-geometry", "extrusion-metal-type"); } @@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePosition) Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf162691_handle_position.fodt"); - save(u"writer8"_ustr); + save(TestFilter::ODT); static constexpr OString sXPath("/office:document-content/office:body/office:text/text:p/" "draw:custom-shape/draw:enhanced-geometry/draw:handle"_ostr); // assert XML. @@ -656,7 +656,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePosition) SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - save(u"writer8"_ustr); + save(TestFilter::ODT); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, sXPath, "handle-position", u"$0 10800"); assertXPathNoAttribute(pXmlDoc, sXPath, "handle-position-x"); @@ -668,7 +668,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePolar) Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf162691_handle_polar.fodt"); - save(u"writer8"_ustr); + save(TestFilter::ODT); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -685,7 +685,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePolar) SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - save(u"writer8"_ustr); + save(TestFilter::ODT); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, sXPath, "handle-position", u"9000 $0"); assertXPath(pXmlDoc, sXPath, "handle-polar", u"10800 1000"); @@ -727,7 +727,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityExtended) SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -747,7 +747,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularity) uno::Reference xShape(getShape(0)); lcl_assertSpecularityProperty("from doc", xShape); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -765,7 +765,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityStrict) // The file has c3DSpecularAmt="80000" which results internally in specularity=122%. SetODFDefaultVersion(SvtSaveOptions::ODFVER_014); - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//draw:enhanced-geometry[@draw:extrusion-specularity='122.0703125%']"); @@ -774,7 +774,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityStrict) // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); - save(u"writer8"_ustr); + save(TestFilter::ODT); pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//draw:enhanced-geometry[@loext:extrusion-specularity]", 0); assertXPath(pXmlDoc, "//draw:enhanced-geometry[@draw:extrusion-specularity='100%']"); @@ -875,7 +875,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextRotationPlusPre) // TextRotateAngle. // This should already catch the format error, but does not, see tdf#149567 // But reload catches it. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); } CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf156975_ThemeExport) @@ -912,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf156975_ThemeExport) xMasterPageProps->setPropertyValue(u"Theme"_ustr, uno::Any(xTheme)); // save as odg - save(u"draw8"_ustr); + save(TestFilter::ODG); // and check the markup. xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -976,7 +976,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, test_scene3d_ooxml_light) loadFromFile(u"Scene3d_LightRig_threePt.pptx"); // Without fix this would have failed with validation error. - save(u"impress8"_ustr); + save(TestFilter::ODP); } CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf161327_LatheEndAngle) @@ -1108,12 +1108,12 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testPdfExportAsOdg) loadFromFile(u"two-pages.pdf"); - OUString formats[] = { "draw8", "OpenDocument Drawing Flat XML" }; + TestFilter formats[] = { TestFilter::ODG, TestFilter::FODG }; // save and reload as odg and fodg - for (const OUString& format : formats) + for (TestFilter eFormat : formats) { - setImportFilterName(format); - saveAndReload(format); + setImportFilterName(TestFilterNames.at(eFormat)); + saveAndReload(eFormat); // Check that the graphic in the second page of the document is the second page of the pdf uno::Reference xDrawPagesSupplier(mxComponent, diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx index b16e09a42eca..3acf5b8b7577 100644 --- a/xmloff/qa/unit/style.cxx +++ b/xmloff/qa/unit/style.cxx @@ -93,7 +93,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testFontSorting) loadFromURL(u"private:factory/swriter"_ustr); // When saving that document to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure elements are sorted (by style:name="..."): xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -179,7 +179,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testWritingModeBTLR) // Save to latest extended. Adapt test, when attribute value "bt-lr" is included in ODF strict. { - save(u"writer8"_ustr); + save(TestFilter::ODT); // With applied fix for tdf150407 still loext:writing-mode="bt-lr" has to be written. xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -198,7 +198,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testWritingModeBTLR) SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - save(u"writer8"_ustr); + save(TestFilter::ODT); // Without the fix an faulty 'writing-mode="bt-lr"' attribute was written in productive build. // A debug build fails assertion in SvXMLNamespaceMap::GetQNameByKey(). @@ -222,7 +222,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelBottomMargin) // Save to ODF 1.3 extended. Adapt 3 (=ODFVER_LATEST) to a to be ODFVER_013_EXTENDED when // attribute value "page-content-bottom" is included in ODF strict. { - save(u"writer8"_ustr); + save(TestFilter::ODT); // With applied fix for tdf150407 still loext:vertical-rel="page-content-bottom" has to be // written. @@ -242,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelBottomMargin) // Save to ODF 1.3 strict. { SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); - save(u"writer8"_ustr); + save(TestFilter::ODT); // Without the fix an faulty 'vertical-rel="page-content-bottom"' attribute was written in // productive build. A debug build fails assertion in SvXMLNamespaceMap::GetQNameByKey(). @@ -266,7 +266,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelTopMargin) // Save to ODF 1.3 extended. Adapt 3 (=ODFVER_LATEST) to a to be ODFVER_013_EXTENDED when // attribute value "page-content-top" is included in ODF strict. { - save(u"writer8"_ustr); + save(TestFilter::ODT); // With applied fix for tdf150407 still loext:vertical-rel="page-content-top has to be // written. @@ -286,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelTopMargin) // Save to ODF 1.3 strict. { SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); - save(u"writer8"_ustr); + save(TestFilter::ODT); // Without the fix an faulty 'vertical-rel="page-content-top"' attribute was written in // productive build. A debug build fails assertion in SvXMLNamespaceMap::GetQNameByKey(). @@ -301,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelTopMargin) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testTdf156707) { loadFromFile(u"tdf156707_text_form_control_borders.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xShape = getShape(0); uno::Reference xShapeProperties(xShape, uno::UNO_QUERY_THROW); @@ -326,7 +326,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testTdf167358) { // The file contains label form fields. Labels default to having no border. loadFromFile(u"tdf167358_label_form_control_borders.odt"); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); uno::Reference xShape = getShape(0); uno::Reference xShapeProperties(xShape, uno::UNO_QUERY_THROW); @@ -351,7 +351,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_OldToNew) loadFromFile(u"MCGR_OldToNew.odg"); // saveAndReload includes validation and must not fail with the new elements and attributes. - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); // Examine file markup // For compatibility the file should still have the old attributes 'start-color' and 'end-color' @@ -405,7 +405,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_OldToNew_opacity) loadFromFile(u"MCGR_OldToNew_opacity.odg"); // saveAndReload includes validation and must not fail with the new elements and attributes. - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); // Examine file markup // For compatibility the file should still have the old attributes. @@ -465,7 +465,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_threeStops) loadFromFile(u"MCGR_threeStops.fodt"); // saveAndReload includes validation and must not fail with the new elements and attributes. - saveAndReload(u"draw8"_ustr); + saveAndReload(TestFilter::ODG); // Examine file markup // For compatibility the file should still have the old attributes 'start-color' and 'end-color' @@ -545,7 +545,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBorderRestoration) // Save to LATEST; that is extended. Make sure gradient-stop elements have // offsets 0 and 1, and border is written as 50%. - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); OString sPath = "/office:document-styles/office:styles/draw:gradient[@draw:name='Gradient_20_1']"_ostr; @@ -559,7 +559,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBorderRestoration) SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); // As of Nov 2024, validating against a version other than LATEST is not implemented. skipValidation(); - save(u"impress8"_ustr); + save(TestFilter::ODP); pXmlDoc = parseExport(u"styles.xml"_ustr); assertXPath(pXmlDoc, sPath + "/loext:gradient-stop", 0); assertXPath(pXmlDoc, sPath, "start-color", u"#ffff00"); @@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testTransparencyBorderRestoration) // Save to LATEST, that is extended. Make sure transparency gradient-stop //elements are written with offset 0 and 1, and border is written as 40%. - save(u"impress8"_ustr); + save(TestFilter::ODP); xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); OString sPath = "/office:document-styles/office:styles/draw:opacity[1]"_ostr; assertXPath(pXmlDoc, sPath + "/loext:opacity-stop[2]", "stop-opacity", u"0.9"); @@ -593,7 +593,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testTransparencyBorderRestoration) // Save to ODF 1.3 strict and make sure border, start and end opacity are suitable set. SetODFDefaultVersion(SvtSaveOptions::ODFDefaultVersion::ODFVER_013); - save(u"impress8"_ustr); + save(TestFilter::ODP); pXmlDoc = parseExport(u"styles.xml"_ustr); assertXPath(pXmlDoc, sPath + "/loext:opacity-stop", 0); assertXPath(pXmlDoc, sPath, "start", u"0%"); @@ -615,8 +615,8 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testAxialGradientCompatible) //Round-trip through OOXML. // FixMe tdf#153183. Here "Attribute 'ID' is not allowed to appear in element 'v:rect'". skipValidation(); - saveAndReload(u"Office Open XML Text"_ustr); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::DOCX); + saveAndReload(TestFilter::ODT); // Examine reloaded file uno::Reference xShape(getShape(0)); @@ -647,8 +647,8 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testAxialTransparencyCompatible) //Round-trip through OOXML. // FixMe tdf#153183, and error in charSpace and in CharacterSet //skipValidation(); - saveAndReload(u"Office Open XML Text"_ustr); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::DOCX); + saveAndReload(TestFilter::ODT); // Examine reloaded file uno::Reference xShape(getShape(0)); diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx index f6f4821cb97e..8efb304b4ad4 100644 --- a/xmloff/qa/unit/text.cxx +++ b/xmloff/qa/unit/text.cxx @@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentProperty) xField->setPropertyValue(u"Resolved"_ustr, uno::Any(true)); xField->setPropertyValue(u"ParentName"_ustr, uno::Any(u"parent_comment_name"_ustr)); - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xTextDocument.set(mxComponent, uno::UNO_QUERY); xParaEnumAccess.set(xTextDocument->getText(), uno::UNO_QUERY); xParaEnum = xParaEnumAccess->createEnumeration(); @@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBibliographyLocalUrl) xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false); // When invoking ODT export + import on it: - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Without the accompanying fix in place, this test would have resulted in an assertion failure, // as LocalURL was mapped to XML_TOKEN_INVALID. @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBibliographyTargetURL1) xText->insertTextContent(xCursor, xContent, /*bAbsorb=*/false); // When invoking ODT export + import on it: - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // Then make sure that URL, TargetURL and UseTargetURL are preserved and independent: xTextDocument.set(mxComponent, uno::UNO_QUERY); @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testParaStyleListLevel) CPPUNIT_ASSERT_EQUAL(static_cast(1), nNumberingLevel); // Test the export as well: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure we save the style's numbering level: xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -246,7 +246,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListId) loadFromFile(u"list-id.fodt"); // When storing that document as ODF: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure that unreferenced xml:id="..." attributes are not written: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListId2) // When storing that document as ODF: // Without the fix in place, automatic validation would fail with: // Error: "list123456789012345" is referenced by an IDREF, but not defined. - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xTextDocument.set(mxComponent.queryThrow()); xParaEnumAccess.set(xTextDocument->getText().queryThrow()); @@ -347,7 +347,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListIdState) xParaProps->setPropertyValue(u"NumberingStyleName"_ustr, css::uno::Any(u"Numbering ABC"_ustr)); // When storing that document as ODF: - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // Make sure that xml:id="..." gets written for para 1, as it'll be continued in para 3. @@ -388,7 +388,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListIdOnRestart) CPPUNIT_ASSERT_EQUAL(list_id, xPara->getPropertyValue(u"ListId"_ustr).get()); // When storing that document as ODF: - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); xTextDocument.set(mxComponent, uno::UNO_QUERY_THROW); xParaEnumAccess.set(xTextDocument->getText(), uno::UNO_QUERY_THROW); @@ -437,7 +437,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testClearingBreakExport) xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRelativeWidth) // Body frame width is 16cm. xStyle->setPropertyValue(u"Width"_ustr, uno::Any(static_cast(20000))); - save(u"writer8"_ustr); + save(TestFilter::ODT); xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); // Without the accompanying fix in place, this failed with: @@ -536,7 +536,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthAndHeight) xText->insertTextContent(xCursor, xTextFrame, /*bAbsorb=*/false); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure that we still export a non-zero size: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -565,7 +565,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -627,7 +627,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -714,7 +714,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -799,7 +799,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPictureContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -857,7 +857,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDateContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -923,7 +923,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPlainTextContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -978,7 +978,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1011,7 +1011,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testAliasContentControlExport) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the expected markup is used: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1120,7 +1120,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthRedline) dispatchCommand(mxComponent, u".uno:Delete"_ustr, {}); // When saving to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure that a non-zero size is written to the output: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1159,7 +1159,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testThemeExport) xPageProps->setPropertyValue(u"Theme"_ustr, uno::Any(xTheme)); // Export to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Check if the 12 colors are written in the XML: xmlDocUniquePtr pXmlDoc = parseExport(u"styles.xml"_ustr); @@ -1197,7 +1197,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testFloatingTableExport) xFrame->setPropertyValue(u"IsSplitAllowed"_ustr, uno::Any(true)); // When saving to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure we write a floating table, not a textframe containing a table: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1254,7 +1254,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testParagraphScopedTabDistance) xPropSet->getPropertyValue(u"ParaTabStopDefaultDistance"_ustr).get()); // Save the imported file to test the export too - save(u"impress8"_ustr); + save(TestFilter::ODP); // Then make sure we write the tab-stop-distance xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1295,7 +1295,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDeleteThenFormatOdtExport) loadFromFile(u"del-then-format.docx"); // When exporting that to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure not only has the child, but also an // one, with text: @@ -1316,7 +1316,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRedlineFormatCharPropsExport) loadFromFile(u"redline-format-char-props.docx"); // When exporting that to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure refers to an autostyle that describes those old char // props: @@ -1361,7 +1361,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRedlineFormatCharStyleExport) loadFromFile(u"format-char-style-change.docx"); // When exporting the document to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the style name is encoded: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -1383,7 +1383,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRedlineFormatCharPropsStrictExport) loadFromFile(u"redline-format-char-props.docx"); // When exporting the document to ODT strict: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure no loext attribute is written: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); diff --git a/xmloff/qa/unit/text/txtparae.cxx b/xmloff/qa/unit/text/txtparae.cxx index 046a987e31e6..6dedd1e584d6 100644 --- a/xmloff/qa/unit/text/txtparae.cxx +++ b/xmloff/qa/unit/text/txtparae.cxx @@ -32,7 +32,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineFormatCharStyleDirectExport) loadFromFile(u"format-charstyle-direct.docx"); // When exporting the document to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure the named style is not lost in the redline: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); diff --git a/xmloff/qa/unit/text/txtprmap.cxx b/xmloff/qa/unit/text/txtprmap.cxx index e650ff649bad..ad1103ff88e0 100644 --- a/xmloff/qa/unit/text/txtprmap.cxx +++ b/xmloff/qa/unit/text/txtprmap.cxx @@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableWrapTextAtFlyStartExport) xFrame->setPropertyValue(u"WrapTextAtFlyStart"_ustr, uno::Any(true)); // When saving to ODT: - save(u"writer8"_ustr); + save(TestFilter::ODT); // Then make sure we write a floating table, that wraps on all pages: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index bb2c4d5df992..4c95b5427cc0 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -80,9 +80,9 @@ protected: getCertificate(DocumentSignatureManager& rSignatureManager, svl::crypto::SignatureMethodAlgorithm eAlgo); #if HAVE_FEATURE_GPGVERIFY - SfxObjectShell* assertDocument(const ::CppUnit::SourceLine aSrcLine, - const OUString& rFilterName, const SignatureState nDocSign, - const SignatureState nMacroSign, const OUString& sVersion); + SfxObjectShell* assertDocument(const ::CppUnit::SourceLine aSrcLine, TestFilter eFilterName, + const SignatureState nDocSign, const SignatureState nMacroSign, + const OUString& sVersion); #endif }; @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDescription) // Create an empty document and store it to a tempfile, finally load it as a storage. loadFromURL(u"private:factory/swriter"_ustr); - save(u"writer8"_ustr); + save(TestFilter::ODT); DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -178,7 +178,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSA) // Create an empty document and store it to a tempfile, finally load it as a storage. loadFromURL(u"private:factory/swriter"_ustr); - save(u"writer8"_ustr); + save(TestFilter::ODT); DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -214,7 +214,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAOOXML) // Create an empty document and store it to a tempfile, finally load it as a storage. loadFromURL(u"private:factory/swriter"_ustr); - save(u"MS Word 2007 XML"_ustr); + save(TestFilter::DOCX_2007); DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAPDF) // a stream. loadFromURL(u"private:factory/swriter"_ustr); - save(u"writer_pdf_Export"_ustr); + save(TestFilter::PDF_WRITER); DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -294,7 +294,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLDescription) // Create an empty document and store it to a tempfile, finally load it as a storage. loadFromURL(u"private:factory/swriter"_ustr); - save(u"MS Word 2007 XML"_ustr); + save(TestFilter::DOCX_2007); DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -824,7 +824,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, test96097Calc) skipValidation(); // Save As - save(u"calc8"_ustr); + save(TestFilter::ODS); } CPPUNIT_TEST_FIXTURE(SigningTest, test96097Doc) @@ -851,7 +851,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, test96097Doc) skipValidation(); // Save As - save(u"writer8"_ustr); + save(TestFilter::ODT); } CPPUNIT_TEST_FIXTURE(SigningTest, testXAdESNotype) @@ -916,7 +916,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdES) // Create an empty document, store it to a tempfile and load it as a storage. loadFromURL(u"private:factory/swriter"_ustr); - save(u"writer8"_ustr); + save(TestFilter::ODT); DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -971,7 +971,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT) { loadFromURL(u"private:factory/swriter"_ustr); - save(u"writer8"_ustr); + save(TestFilter::ODT); { DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -1046,7 +1046,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_OOXML) { loadFromURL(u"private:factory/swriter"_ustr); - save(u"MS Word 2007 XML"_ustr); + save(TestFilter::DOCX_2007); { DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); @@ -1346,7 +1346,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testODFEncryptedGPG) CPPUNIT_ASSERT(pObjectShell); // export and import again - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); pBaseModel = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); @@ -1357,11 +1357,11 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testODFEncryptedGPG) #endif SfxObjectShell* SigningTest::assertDocument(const ::CppUnit::SourceLine aSrcLine, - const OUString& rFilterName, - const SignatureState nDocSign, + TestFilter eFilterName, const SignatureState nDocSign, const SignatureState nMacroSign, const OUString& sVersion) { + OUString aFilter(TestFilterNames.at(eFilterName)); std::string sPos = aSrcLine.fileName() + ":" + OString::number(aSrcLine.lineNumber()).getStr(); SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get()); @@ -1369,7 +1369,7 @@ SfxObjectShell* SigningTest::assertDocument(const ::CppUnit::SourceLine aSrcLine SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell(); CPPUNIT_ASSERT_MESSAGE(sPos, pObjectShell); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sPos, rFilterName, + CPPUNIT_ASSERT_EQUAL_MESSAGE(sPos, aFilter, pObjectShell->GetMedium()->GetFilter()->GetFilterName()); SignatureState nActual = pObjectShell->GetDocumentSignatureState(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sPos, nDocSign, nActual); @@ -1387,9 +1387,9 @@ SfxObjectShell* SigningTest::assertDocument(const ::CppUnit::SourceLine aSrcLine /// Test if a macro signature from a OTT 1.2 template is preserved for ODT 1.2 CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) { - const OUString aFormats[] = { u"writer8"_ustr, u"writer8_template"_ustr }; + const TestFilter aFormats[] = { TestFilter::ODT, TestFilter::OTT }; - for (OUString const& sFormat : aFormats) + for (TestFilter eFormat : aFormats) { const OUString aURL(createFileURL(u"tdf42316_odt12.ott")); const OUString sLoadMessage = "loading failed: " + aURL; @@ -1399,7 +1399,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // we are a template, and have a valid document and macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::OK, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::OK, SignatureState::OK, ODFVER_012_TEXT); // create new document from template @@ -1408,19 +1408,19 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) mxComponent.is()); // we are somehow a template (?), and have just a valid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::OK, ODFVER_012_TEXT); // FIXME: Error: element "document-signatures" is missing "version" attribute skipValidation(); - if (sFormat == "writer8") + if (eFormat == TestFilter::ODT) // save as new ODT document - saveAndReload(sFormat); + saveAndReload(eFormat); else { // save as new OTT template - save(u"writer8_template"_ustr); + save(eFormat); // load the saved OTT template as-is to validate signatures loadWithParams(maTempFile.GetURL(), @@ -1428,18 +1428,18 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) } // the loaded document is a OTT/ODT with a macro signature - assertDocument(CPPUNIT_SOURCELINE(), sFormat, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), eFormat, SignatureState::NOSIGNATURES, SignatureState::OK, ODFVER_014_TEXT); // save as new OTT template - save(u"writer8_template"_ustr); + save(TestFilter::OTT); // load the template as-is to validate signatures loadWithParams(maTempFile.GetURL(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // the loaded document is a OTT with a valid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::OK, ODFVER_014_TEXT); } } @@ -1454,7 +1454,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) loadWithParams(aURL, comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // we are a template, and have a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); // create new document from template @@ -1463,32 +1463,32 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) mxComponent.is()); // we are somehow a template (?), and have just a valid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); // save as new ODT document - saveAndReload(u"writer8"_ustr); + saveAndReload(TestFilter::ODT); // the loaded document is a 1.2 ODT without any signatures - assertDocument(CPPUNIT_SOURCELINE(), u"writer8"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::ODT, SignatureState::NOSIGNATURES, SignatureState::NOSIGNATURES, ODFVER_014_TEXT); // load the template as-is to validate signatures loadWithParams(aURL, comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // we are a template, and have a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); // save as new OTT template - save(u"writer8_template"_ustr); + save(TestFilter::OTT); // load the template as-is to validate signatures loadWithParams(maTempFile.GetURL(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // the loaded document is a 1.2 OTT without any signatures - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOSIGNATURES, ODFVER_014_TEXT); } @@ -1499,9 +1499,9 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); SetODFDefaultVersion(SvtSaveOptions::ODFVER_011); - const OUString aFormats[] = { u"writer8"_ustr, u"writer8_template"_ustr }; + const TestFilter aFormats[] = { TestFilter::ODT, TestFilter::OTT }; - for (OUString const& sFormat : aFormats) + for (TestFilter eFormat : aFormats) { const OUString aURL(createFileURL(u"tdf42316.ott")); const OUString sLoadMessage = "loading failed: " + aURL; @@ -1511,7 +1511,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // we are a template, and have a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); // create new document from template @@ -1520,36 +1520,36 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) mxComponent.is()); // we are somehow a template (?), and have just a valid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); // FIXME: Error: element "manifest:manifest" is missing "version" attribute skipValidation(); - if (sFormat == "writer8") + if (eFormat == TestFilter::ODT) // save as new ODT document - saveAndReload(sFormat); + saveAndReload(eFormat); else { // save as new OTT template - save(u"writer8_template"_ustr); + save(TestFilter::OTT); // load the saved OTT template as-is to validate signatures loadWithParams(maTempFile.GetURL(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); } - assertDocument(CPPUNIT_SOURCELINE(), sFormat, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), eFormat, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); - save(u"writer8_template"_ustr); + save(TestFilter::OTT); // load the template as-is to validate signatures loadWithParams(maTempFile.GetURL(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); // the loaded document is a OTT with a non-invalid macro signature - assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, SignatureState::NOSIGNATURES, + assertDocument(CPPUNIT_SOURCELINE(), TestFilter::OTT, SignatureState::NOSIGNATURES, SignatureState::NOTVALIDATED, OUString()); } } diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx b/xmlsecurity/qa/unit/signing/signing2.cxx index 5eb4ce76e55f..729c9b8c2230 100644 --- a/xmlsecurity/qa/unit/signing/signing2.cxx +++ b/xmlsecurity/qa/unit/signing/signing2.cxx @@ -86,7 +86,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPreserveMacroSignatureODB) loadFromFile(u"odb_signed_macros.odb"); // save as ODB - save(u"StarOffice XML (Base)"_ustr); + save(TestFilter::ODB); // Parse the resulting XML. uno::Reference xStorage @@ -129,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); - saveAndReload(u"writer8"_ustr, "password"); + saveAndReload(TestFilter::ODT, "password"); xmlDocUniquePtr pXmlDoc = parseExport(u"META-INF/manifest.xml"_ustr); assertXPath(pXmlDoc, "/manifest:manifest", "version", u"1.3"); @@ -177,7 +177,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) { // store it with new wholesome ODF extended encryption - reload - saveAndReload(u"writer8"_ustr, "password"); + saveAndReload(TestFilter::ODT, "password"); // test wholesome ODF extended encryption xmlDocUniquePtr pXmlDoc = parseExport(u"META-INF/manifest.xml"_ustr); @@ -249,7 +249,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODFWholesom { // store it with new wholesome ODF extended encryption - reload - saveAndReload(u"writer8"_ustr, "password"); + saveAndReload(TestFilter::ODT, "password"); // test wholesome ODF extended encryption xmlDocUniquePtr pXmlDoc = parseExport(u"META-INF/manifest.xml"_ustr); @@ -314,7 +314,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODFWholesom Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); - saveAndReload(u"writer8"_ustr, "password"); + saveAndReload(TestFilter::ODT, "password"); xmlDocUniquePtr pXmlDoc = parseExport(u"META-INF/manifest.xml"_ustr); assertXPath(pXmlDoc, "/manifest:manifest", "version", u"1.3"); diff --git a/xmlsecurity/qa/xmlsec/xmlsec.cxx b/xmlsecurity/qa/xmlsec/xmlsec.cxx index a455aecf2aeb..d9cae0ef05f6 100644 --- a/xmlsecurity/qa/xmlsec/xmlsec.cxx +++ b/xmlsecurity/qa/xmlsec/xmlsec.cxx @@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertPrivateKey) { // Given a view that has CA/cert/key data associated: loadFromURL("private:factory/swriter"); - save("writer8"); + save(TestFilter::ODT); DocumentSignatureManager aManager(getComponentContext(), DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage