diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-08-10 19:38:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-08-11 08:51:53 +0200 |
commit | 7b57a96673e9a78a65f2e442a8b04fa393871c39 (patch) | |
tree | f21b858eddfbec95f39b941212e247c33aae78d7 | |
parent | 84bf981a4fdf94cae40dd199762dc03d681618fe (diff) |
CppunitTest_sw_ooxmlexport2..5: avoid DECLARE_OOXMLEXPORT_EXPORTONLY_TEST()
See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd
(CppunitTest_sw_rtfimport: convert one testcase to use
CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation.
Change-Id: I7b48ff2427b8c544db07323a98a236cfd8904df8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120284
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 15 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 99 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 178 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 198 |
4 files changed, 324 insertions, 166 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 24c4ecbce63d..f98bb13a4787 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -86,8 +86,9 @@ DECLARE_OOXMLEXPORT_TEST(testPageGraphicBackground, "page-graphic-background.odt } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomProperties, "custom-properties.docx") +CPPUNIT_TEST_FIXTURE(Test, testCustomProperties) { + loadAndSave("custom-properties.docx"); // tdf#133377 tdf#103987 FILESAVE XLSX: Make sure the custom/core/application // file properties are stored correctly after roundtrip to .docx @@ -613,8 +614,9 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(318), getProperty<sal_Int32>(xFrame, "RightMargin"), 2); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCellBtlr, "cell-btlr.docx") +CPPUNIT_TEST_FIXTURE(Test, testCellBtlr) { + loadAndSave("cell-btlr.docx"); /* * The problem was that the exporter didn't mirror the workaround of the * importer, regarding the btLr text direction: the <w:textDirection @@ -959,8 +961,9 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66929, "fdo66929.docx") } } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBorderSpacingExportCase2, "page-borders-export-case-2.docx") +CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2) { + loadAndSave("page-borders-export-case-2.docx"); // The problem was that the exporter didn't mirror the workaround of the // importer, regarding the page border's spacing : the <w:pgBorders w:offsetFrom="page"> // and the inner nodes like <w:top w:space="24" ... /> @@ -993,8 +996,9 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66145, "fdo66145.docx") parseDump("/root/page[3]/header/txt/text()")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGrabBag, "grabbag.docx") +CPPUNIT_TEST_FIXTURE(Test, testGrabBag) { + loadAndSave("grabbag.docx"); // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"); @@ -1178,8 +1182,9 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(50), nShadowTransparence); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(NoFillAttrInImagedata, "NoFillAttrInImagedata.docx") +CPPUNIT_TEST_FIXTURE(Test, NoFillAttrInImagedata) { + loadAndSave("NoFillAttrInImagedata.docx"); //problem was that type and color2 which are v:fill attributes were written in 'v:imagedata' xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index a4ca163cbb66..86a44f551057 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -364,8 +364,9 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar5, "calendar5.docx") CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),3), "CharHeight")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTcBorders, "testTcBorders.docx") +CPPUNIT_TEST_FIXTURE(Test, testTcBorders) { + loadAndSave("testTcBorders.docx"); //fdo#76635 : Table borders are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -381,8 +382,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTcBorders, "testTcBorders.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", float(150), getProperty<float>(xStyle, "CharWeight")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testQuicktables, "quicktables.docx") +CPPUNIT_TEST_FIXTURE(Test, testQuicktables) { + loadAndSave("quicktables.docx"); xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); // These were missing in the Calendar3 table style. @@ -409,8 +411,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testQuicktables, "quicktables.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumShading2-Accent5']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:tcBorders/w:top", "color", "auto"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo71302, "fdo71302.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo71302) { + loadAndSave("fdo71302.docx"); xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); // This got renamed to "Strong Emphasis" without a good reason. @@ -502,8 +505,9 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") CPPUNIT_ASSERT_EQUAL(OUString("RenderedShapes"), nValue); // Rendered bitmap has the proper name } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontNameIsEmpty, "font-name-is-empty.docx") +CPPUNIT_TEST_FIXTURE(Test, testFontNameIsEmpty) { + loadAndSave("font-name-is-empty.docx"); // Check no empty font name is exported // This test does not fail, if the document contains a font with empty name. @@ -521,8 +525,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontNameIsEmpty, "font-name-is-empty.doc xmlXPathFreeObject(pXmlObj); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMultiColumnLineSeparator, "multi-column-line-separator-SAVED.docx") +CPPUNIT_TEST_FIXTURE(Test, testMultiColumnLineSeparator) { + loadAndSave("multi-column-line-separator-SAVED.docx"); // Check for the Column Separator value.It should be FALSE as the document does not contain separator line. xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols","sep","false"); @@ -557,8 +562,9 @@ DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx") CPPUNIT_ASSERT(CustomXml); // Grab Bag has all the expected elements } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomXmlRelationships, "customxml.docx") +CPPUNIT_TEST_FIXTURE(Test, testCustomXmlRelationships) { + loadAndSave("customxml.docx"); xmlDocUniquePtr pXmlDoc = parseExport("customXml/_rels/item1.xml.rels"); // Check there is a relation to itemProps1.xml. @@ -566,8 +572,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomXmlRelationships, "customxml.docx" assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "itemProps1.xml"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo69644, "fdo69644.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo69644) { + loadAndSave("fdo69644.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 @@ -581,8 +588,9 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx") getParagraph(1, "Sample pages document."); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPgMargin, "testPgMargin.docx") +CPPUNIT_TEST_FIXTURE(Test, testPgMargin) { + loadAndSave("testPgMargin.docx"); xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", "1440"); } @@ -693,8 +701,9 @@ DECLARE_OOXMLEXPORT_TEST(testTextBoxGradientAngle, "fdo65295.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16( 45 * 10), aGradient8.Angle); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCellGridSpan, "cell-grid-span.docx") +CPPUNIT_TEST_FIXTURE(Test, testCellGridSpan) { + loadAndSave("cell-grid-span.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). @@ -715,8 +724,9 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx") CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, nLRDir); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParaAutoSpacing, "para-auto-spacing.docx") +CPPUNIT_TEST_FIXTURE(Test, testParaAutoSpacing) { + loadAndSave("para-auto-spacing.docx"); xmlDocUniquePtr pXmlDoc = parseExport(); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing","1"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "afterAutospacing","1"); @@ -796,8 +806,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt") CPPUNIT_ASSERT_EQUAL( crop.Left, crop.Right); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteParagraphTag, "testFootnote.docx") +CPPUNIT_TEST_FIXTURE(Test, testFootnoteParagraphTag) { + loadAndSave("testFootnote.docx"); /* In footnotes.xml, the paragraph tag inside <w:footnote w:id="2"> was getting written into document.xml. * Check for, paragraph tag is correctly written into footnotes.xml. */ @@ -812,8 +823,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSpacingLineRule,"table_lineRule.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "lineRule", "auto"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableLineSpacing, "table_atleast.docx") +CPPUNIT_TEST_FIXTURE(Test, testTableLineSpacing) { + loadAndSave("table_atleast.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:spacing", "line", "320"); } @@ -831,8 +843,9 @@ DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(getShape(1), "FillColor")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testThemePreservation, "theme-preservation.docx") +CPPUNIT_TEST_FIXTURE(Test, testThemePreservation) { + loadAndSave("theme-preservation.docx"); // check default font theme values have been preserved xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi"); @@ -883,8 +896,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testThemePreservation, "theme-preservation.d assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeShade", "80"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableThemePreservation, "table-theme-preservation.docx") +CPPUNIT_TEST_FIXTURE(Test, testTableThemePreservation) { + loadAndSave("table-theme-preservation.docx"); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); // check cell theme colors have been preserved @@ -935,8 +949,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableThemePreservation, "table-theme-pre } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcantSplit, "2_table_doc.docx") +CPPUNIT_TEST_FIXTURE(Test, testcantSplit) { + loadAndSave("2_table_doc.docx"); // if Split table value is true for a table then during export do not write <w:cantSplit w:val="false"/> // in table row property,As default row prop is allow row to break across page. // writing <w:cantSplit w:val="false"/> during export was causing problem that all the cell data used to come on same page @@ -973,15 +988,17 @@ DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx") CPPUNIT_ASSERT_EQUAL( OUString("Heading Base"), xStyle->getParentStyle() ); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcolumnbreak, "columnbreak.docx") +CPPUNIT_TEST_FIXTURE(Test, testcolumnbreak) { + loadAndSave("columnbreak.docx"); CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(5, "This is first line after col brk."), "BreakType")); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[1]/w:br", "type", "column"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGlossary, "testGlossary.docx") +CPPUNIT_TEST_FIXTURE(Test, testGlossary) { + loadAndSave("testGlossary.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/glossary/document.xml"); assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", "w14 wp14"); } @@ -991,8 +1008,9 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx") // crashtest } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCrashWhileSave, "testCrashWhileSave.docx") +CPPUNIT_TEST_FIXTURE(Test, testCrashWhileSave) { + loadAndSave("testCrashWhileSave.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle", "val").match("Normal")); } @@ -1007,8 +1025,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileOpenInputOutputError,"floatingtbl_wi assertXPathContent(pXmlDoc, "//w:tbl/w:tr/w:tc[2]/w:p/m:oMathPara/m:oMath/m:sSubSup/m:e/m:r/m:t", u"\u03C3"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSingleCellTableBorders, "tdf124399_SingleCellTableBorders.docx") +CPPUNIT_TEST_FIXTURE(Test, testSingleCellTableBorders) { + loadAndSave("tdf124399_SingleCellTableBorders.docx"); // tdf#124399: Extra borders on single cell tables fixed. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1016,8 +1035,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSingleCellTableBorders, "tdf124399_Singl assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testInsideBorders, "tdf129242_InsideBorders.docx") +CPPUNIT_TEST_FIXTURE(Test, testInsideBorders) { + loadAndSave("tdf129242_InsideBorders.docx"); // tdf#129242: Don't remove inside borders if the table has more than one cells. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1026,8 +1046,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testInsideBorders, "tdf129242_InsideBorders. assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRightBorder, "tdf129442_RightBorder.docx") +CPPUNIT_TEST_FIXTURE(Test, testRightBorder) { + loadAndSave("tdf129442_RightBorder.docx"); // tdf#129442: Right border of a one column table was missing. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1036,8 +1057,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRightBorder, "tdf129442_RightBorder.docx assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:tcPr/w:tcBorders/w:end [@w:val = 'nil']", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBottomBorder, "tdf129450_BottomBorder.docx") +CPPUNIT_TEST_FIXTURE(Test, testBottomBorder) { + loadAndSave("tdf129450_BottomBorder.docx"); // tdf#129450: Missing bottom border in one row table. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1046,8 +1068,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBottomBorder, "tdf129450_BottomBorder.do assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBottomBorders, "tdf129452_BottomBorders.docx") +CPPUNIT_TEST_FIXTURE(Test, testBottomBorders) { + loadAndSave("tdf129452_BottomBorders.docx"); // tdf#129452: Do not omit bottom borders when a column in a table is vertically merged and // the inside borders are turned off. @@ -1060,8 +1083,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBottomBorders, "tdf129452_BottomBorders. assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcBorders/w:bottom", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontTypes, "tdf120344_FontTypes.docx") +CPPUNIT_TEST_FIXTURE(Test, testFontTypes) { + loadAndSave("tdf120344_FontTypes.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. @@ -1073,8 +1097,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontTypes, "tdf120344_FontTypes.docx") assertXPath(qXmlDocument, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:rPr/w:rFonts [@w:ascii='Arial Black']", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberingLevels, "tdf95495.docx") +CPPUNIT_TEST_FIXTURE(Test, testNumberingLevels) { + loadAndSave("tdf95495.docx"); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); // tdf#95495: set list level of the custom style based on the setting of the parent style @@ -1087,8 +1112,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberingLevels, "tdf95495.docx") assertXPath(pXmlDoc, "//body/txt[5]/LineBreak", "Line", "A.2.1 .DESCRIPTION"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVerticalBorders, "calendar3.docx") +CPPUNIT_TEST_FIXTURE(Test, testVerticalBorders) { + loadAndSave("calendar3.docx"); // tdf#130799: Inside vertical borders of a table should not be missing. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1096,8 +1122,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVerticalBorders, "calendar3.docx") assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx") +CPPUNIT_TEST_FIXTURE(Test, testArrowFlipXY) { + loadAndSave("tdf100751_arrowBothFlip.docx"); // tdf#100751: Both x and y flip should happen. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1106,8 +1133,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.do CPPUNIT_ASSERT(arrowStyle.indexOf(u"flip:xy") != sal_Int32(-1)); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowPosition, "tdf104565_ArrowPosition.docx") +CPPUNIT_TEST_FIXTURE(Test, testArrowPosition) { + loadAndSave("tdf104565_ArrowPosition.docx"); // tdf#104565: Test correct position. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1116,8 +1144,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowPosition, "tdf104565_ArrowPosition. "/wp:positionV/wp:posOffset", "516255"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx") +CPPUNIT_TEST_FIXTURE(Test, testArrowMarker) { + loadAndSave("tdf123346_ArrowMarker.docx"); // tdf#123346: Check arrow marker. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1126,8 +1155,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx "/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", "arrow"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth.odt") +CPPUNIT_TEST_FIXTURE(Test, testShapeLineWidth) { + loadAndSave("tdf92526_ShapeLineWidth.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#92526: Make sure that line with stays 0. @@ -1138,16 +1168,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth "/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "0"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromLeftMargin, "tdf132976_testRelativeAnchorWidthFromLeftMargin.docx") +CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromLeftMargin) { + loadAndSave("tdf132976_testRelativeAnchorWidthFromLeftMargin.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(); assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width", "1133"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromInsideOutsideMargin, "tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx") +CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromInsideOutsideMargin) { + loadAndSave("tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.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(); @@ -1161,8 +1193,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromInsideOutsideMarg assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[4]/bounds", "width", "1440"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBodyPrUpright, "tdf123610_handle_upright.docx") +CPPUNIT_TEST_FIXTURE(Test, testBodyPrUpright) { + loadAndSave("tdf123610_handle_upright.docx"); // tdf#123610: Check grab-bag attribute upright to keep text upright regardless of shape rotation. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 23546453c7de..deb8c5a8bb05 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -126,38 +126,44 @@ DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx") CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(2), "TextAutoGrowHeight")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedParagraphMark) { + loadAndSave("testTrackChangesDeletedParagraphMark.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedParagraphMark, "testTrackChangesInsertedParagraphMark.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedParagraphMark) { + loadAndSave("testTrackChangesInsertedParagraphMark.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedTableRow, "testTrackChangesDeletedTableRow.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableRow) { + loadAndSave("testTrackChangesDeletedTableRow.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:del"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedTableRow, "testTrackChangesInsertedTableRow.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableRow) { + loadAndSave("testTrackChangesInsertedTableRow.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesDeletedTableCell, "testTrackChangesDeletedTableCell.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableCell) { + loadAndSave("testTrackChangesDeletedTableCell.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellDel"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesInsertedTableCell, "testTrackChangesInsertedTableCell.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableCell) { + loadAndSave("testTrackChangesInsertedTableCell.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellIns"); } @@ -177,20 +183,23 @@ DECLARE_OOXMLEXPORT_TEST(testTextBoxPictureFill, "textbox_picturefill.docx") CPPUNIT_ASSERT_EQUAL(tools::Long(528), aGraphic.GetSizePixel().Height()); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO73034, "FDO73034.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO73034) { + loadAndSave("FDO73034.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:u", "val").match("single")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO71834, "fdo71834.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO71834) { + loadAndSave("fdo71834.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTrackChangesParagraphProperties, "testTrackChangesParagraphProperties.docx") +CPPUNIT_TEST_FIXTURE(Test, testTrackChangesParagraphProperties) { + loadAndSave("testTrackChangesParagraphProperties.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0); } @@ -207,8 +216,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMsoSpt180, "mso-spt180.docx") CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73550, "fdo73550.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo73550) { + loadAndSave("fdo73550.docx"); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); // This was wrap="none". assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts"); @@ -266,8 +276,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73556,"fdo73556.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(3751), tableWidth); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx") +CPPUNIT_TEST_FIXTURE(Test, testSegFaultWhileSave) { + loadAndSave("test_segfault_while_save.docx"); // fdo#74499 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32()); @@ -276,8 +287,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSegFaultWhileSave, "test_segfault_while_ CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo69656, "Table_cell_auto_width_fdo69656.docx") +CPPUNIT_TEST_FIXTURE(Test, fdo69656) { + loadAndSave("Table_cell_auto_width_fdo69656.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. @@ -290,8 +302,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo69656, "Table_cell_auto_width_fdo69656.do assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW","type","dxa"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76741, "fdo76741.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo76741) { + loadAndSave("fdo76741.docx"); // There are two issue related to table in the saved(exported) file // - the table alignment in saved file is "left" instead of "center" @@ -318,14 +331,16 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo106029,"fdo106029.docx") assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO74106, "FDO74106.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO74106) { + loadAndSave("FDO74106.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val","hebrew1"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO74215, "FDO74215.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO74215) { + loadAndSave("FDO74215.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); // tdf#106849 NumPicBullet xShape should not be resized. @@ -386,8 +401,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90697_complexBreaksHeaders,"tdf90697_complexBrea CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount()); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testIndentation, "test_indentation.docx") +CPPUNIT_TEST_FIXTURE(Test, testIndentation) { + loadAndSave("test_indentation.docx"); // fdo#74141 :There was a problem that in style.xml and document.xml in <w:ind> 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 <w:ind> does not contain w:right attribute. @@ -395,8 +411,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testIndentation, "test_indentation.docx") assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:ind", "end"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, "chart-in-footer.docx") +CPPUNIT_TEST_FIXTURE(Test, testChartInFooter) { + loadAndSave("chart-in-footer.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. @@ -465,8 +482,9 @@ DECLARE_OOXMLEXPORT_TEST(testFloatingTablePosition, "floating-table-position.doc CPPUNIT_ASSERT_EQUAL(sal_Int32(8133), getProperty<sal_Int32>(xShape, "VertOrientPosition")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbi11739, "abi11739.docx") +CPPUNIT_TEST_FIXTURE(Test, testAbi11739) { + loadAndSave("abi11739.docx"); // Validation test: order of elements were wrong. xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); // Order was: uiPriority, link, basedOn. @@ -505,8 +523,9 @@ DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx") CPPUNIT_ASSERT_EQUAL(2, nImageFiles); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedLists_StartingWithZero, "FDO74105.docx") +CPPUNIT_TEST_FIXTURE(Test, testNumberedLists_StartingWithZero) { + loadAndSave("FDO74105.docx"); /* Issue : Numbered lists Starting with value '0' is not preserved after RT. * In numbering.xml, an XML tag <w:start> is optional. If not mentioned, * the Numbered list should start from 0. @@ -535,8 +554,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreak,"fdo74566.docx") getRun(xParagraph4, 1, "Second Page First line after Page Break"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleObject, "test_ole_object.docx") +CPPUNIT_TEST_FIXTURE(Test, testOleObject) { + loadAndSave("test_ole_object.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata", @@ -562,8 +582,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleObject, "test_ole_object.docx") } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo74792, "fdo74792.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo74792) { + loadAndSave("fdo74792.docx"); /* * fdo#74792 : The images associated with smart-art data[i].xml * were not preserved on exporting to DOCX format @@ -579,8 +600,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo74792, "fdo74792.docx") CPPUNIT_ASSERT( xInputStream.is() ); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo77718, "fdo77718.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo77718) { + loadAndSave("fdo77718.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 @@ -604,8 +626,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo77718, "fdo77718.docx") CPPUNIT_ASSERT( xInputStream2.is() ); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCurruption, "tableCurrupt.docx") +CPPUNIT_TEST_FIXTURE(Test, testTableCurruption) { + loadAndSave("tableCurrupt.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); CPPUNIT_ASSERT(pXmlDoc) ; assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]",1); @@ -616,8 +639,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCurruption, "tableCurrupt.docx") CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aHeaderBottomBorder.LineWidth); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDateControl, "date-control.docx") +CPPUNIT_TEST_FIXTURE(Test, testDateControl) { + loadAndSave("date-control.docx"); // check XML xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", "2014-03-05T00:00:00Z"); @@ -626,8 +650,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDateControl, "date-control.docx") assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u"mi\u00E9rcoles, 05 de marzo de 2014"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf115030, "tdf115030.docx") +CPPUNIT_TEST_FIXTURE(Test, test_Tdf115030) { + loadAndSave("tdf115030.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); sal_Unicode aDot = {0x02D9}; sal_Unicode aDobleDot = {0x00A8}; @@ -636,15 +661,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf115030, "tdf115030.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/m:oMathPara/m:oMath[1]/m:acc/m:accPr/m:chr", "val", OUString(aDot)); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_OpeningBrace, "2120112713_OpenBrace.docx") +CPPUNIT_TEST_FIXTURE(Test, test_OpeningBrace) { + loadAndSave("2120112713_OpenBrace.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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",""); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf132305, "tdf132305.docx") +CPPUNIT_TEST_FIXTURE(Test, test_Tdf132305) { + loadAndSave("tdf132305.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:bar/m:barPr/m:pos","val","top"); } @@ -684,8 +711,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_Tdf132305, "tdf132305.docx") // <w:fldChar w:fldCharType="end" /> // </w:r> // See, tdf#38778 -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf38778, "tdf38778_properties_in_run_for_field.doc") +CPPUNIT_TEST_FIXTURE(Test, testTdf38778) { + loadAndSave("tdf38778_properties_in_run_for_field.doc"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); static const OUStringLiteral psz(u"20"); @@ -718,8 +746,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf38778, "tdf38778_properties_in_run_fo CPPUNIT_ASSERT(drawing::FillStyle_NONE != getProperty<drawing::FillStyle>(xStyle, "FillStyle")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76312, "FDO76312.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO76312) { + loadAndSave("FDO76312.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]"); @@ -760,8 +789,9 @@ void Test::verifyComboBoxExport(bool aComboBoxAsDropDown) } } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, "combobox-control.docx") +CPPUNIT_TEST_FIXTURE(Test, testComboBoxControl) { + loadAndSave("combobox-control.docx"); // check XML xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", "manolo"); @@ -792,8 +822,9 @@ CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_false) verifyComboBoxExport(false); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCheckBoxControl, "checkbox-control.docx") +CPPUNIT_TEST_FIXTURE(Test, testCheckBoxControl) { + loadAndSave("checkbox-control.docx"); // check XML xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1"); @@ -803,8 +834,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCheckBoxControl, "checkbox-control.docx" // TODO: import control and add a check here } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphWithComments, "paragraphWithComments.docx") +CPPUNIT_TEST_FIXTURE(Test, testParagraphWithComments) { + loadAndSave("paragraphWithComments.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 @@ -832,8 +864,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104707_urlComment, "tdf104707_urlComment.odt") CPPUNIT_ASSERT_EQUAL(OUString("https://bugs.documentfoundation.org/show_bug.cgi?id=104707"), aURL); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") +CPPUNIT_TEST_FIXTURE(Test, testOLEObjectinHeader) { + loadAndSave("2129393649.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 @@ -863,21 +896,24 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOLEObjectinHeader, "2129393649.docx") "Word.Picture.8"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test_ClosingBrace, "2120112713.docx") +CPPUNIT_TEST_FIXTURE(Test, test_ClosingBrace) { + loadAndSave("2120112713.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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",""); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testlvlPicBulletId, "lvlPicBulletId.docx") +CPPUNIT_TEST_FIXTURE(Test, testlvlPicBulletId) { + loadAndSave("lvlPicBulletId.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtContent, "SdtContent.docx") +CPPUNIT_TEST_FIXTURE(Test, testSdtContent) { + loadAndSave("SdtContent.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); assertXPath(pXmlDoc, "/w:hdr[1]/w:sdt[1]/w:sdtContent[1]/w:p[1]/w:del[1]"); } @@ -886,8 +922,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtContent, "SdtContent.docx") // Currently LibreOffice exports custom geometry for this up arrow, not preset shape. // When LibreOffice can export preset shape with correct modifiers, then this test can be re-enabled. -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76016, "fdo76016.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo76016) { + loadAndSave("fdo76016.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"); @@ -895,8 +932,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76016, "fdo76016.docx") } #endif -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileWithInvalidImageLink, "FileWithInvalidImageLink.docx") +CPPUNIT_TEST_FIXTURE(Test, testFileWithInvalidImageLink) { + loadAndSave("FileWithInvalidImageLink.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. @@ -909,8 +947,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFileWithInvalidImageLink, "FileWithInval "embed"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeDOCX, "fdo80410.docx") +CPPUNIT_TEST_FIXTURE(Test, testContentTypeDOCX) { + loadAndSave("fdo80410.docx"); xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, @@ -931,8 +970,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeDOCX, "fdo80410.docx") "Word.Document.12"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeXLSM, "fdo76098.docx") +CPPUNIT_TEST_FIXTURE(Test, testContentTypeXLSM) { + loadAndSave("fdo76098.docx"); xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "ContentType", "application/vnd.ms-excel.sheet.macroEnabled.12"); @@ -951,32 +991,36 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeXLSM, "fdo76098.docx") "rId1"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76108, "test76108.docx") +CPPUNIT_TEST_FIXTURE(Test, test76108) { + loadAndSave("test76108.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); //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", "begin"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTCTagMisMatch, "TCTagMisMatch.docx") +CPPUNIT_TEST_FIXTURE(Test, testTCTagMisMatch) { - // TCTagMisMatch.docx : This document contains an empty table with borders. - // there was a TC tag mismatch which resulted into a crash. + loadAndSave("TCTagMisMatch.docx"); + // TCTagMisMatch.docx : This document contains an empty table with borders. + // there was a TC tag mismatch which resulted into a crash. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]",0); - assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]",0); + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78292, "FDO78292.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO78292) { - //text node is a leaf node, it should not have any children - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0); + loadAndSave("FDO78292.docx"); + //text node is a leaf node, it should not have any children + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSimpleSdts, "simple-sdts.docx") +CPPUNIT_TEST_FIXTURE(Test, testSimpleSdts) { + loadAndSave("simple-sdts.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); @@ -986,8 +1030,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSimpleSdts, "simple-sdts.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:citation", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart.docx") +CPPUNIT_TEST_FIXTURE(Test, testEmbeddedExcelChart) { + loadAndSave("EmbeddedExcelChart.docx"); xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, @@ -1010,8 +1055,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart. "Excel.Chart.8"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf83227, "tdf83227.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf83227) { + loadAndSave("tdf83227.docx"); // Bug document contains a rotated image, which is handled as a draw shape (not as a Writer image) on export. uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.png"))); @@ -1019,8 +1065,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf83227, "tdf83227.docx") CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/image2.png"))); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103001, "tdf103001.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf103001) { + loadAndSave("tdf103001.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<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); @@ -1029,8 +1076,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103001, "tdf103001.docx") CPPUNIT_ASSERT(xNameAccess->hasByName("word/_rels/header2.xml.rels")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf92521, "tdf92521.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf92521) { + loadAndSave("tdf92521.odt"); CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // There should be a section break that's in the middle of the document: right after the table. @@ -1075,8 +1123,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx") } } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99090_pgbrkAfterTable, "tdf99090_pgbrkAfterTable.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf99090_pgbrkAfterTable) { + loadAndSave("tdf99090_pgbrkAfterTable.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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); @@ -1180,8 +1229,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original,"tdf81345.docx") } #endif -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocxTablePosition, "floating-table-position.docx") +CPPUNIT_TEST_FIXTURE(Test, testDocxTablePosition) { + loadAndSave("floating-table-position.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // the exported positions were wrong due to some missing shifting in the export code @@ -1189,8 +1239,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocxTablePosition, "floating-table-posit assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "4611"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupSapeText.docx") +CPPUNIT_TEST_FIXTURE(Test, testUnderlineGroupShapeText) { + loadAndSave("tdf123351_UnderlineGroupSapeText.docx"); // tdf#123351: Check if correct underline is used. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1241,8 +1292,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnderlineGroupShapeText, "tdf123351_Unde "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "single"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineColorGroupedShapes.docx") +CPPUNIT_TEST_FIXTURE(Test, testUnderlineColorGroupedShapes) { + loadAndSave("tdf132491_UnderlineColorGroupedShapes.docx"); // tdf#132491 : Check if correct color is used for underline. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" @@ -1253,16 +1305,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnderlineColorGroupedShapes, "tdf132491_ "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromRightMargin, "tdf133670_testRelativeAnchorWidthFromRightMargin.docx") +CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromRightMargin) { + loadAndSave("tdf133670_testRelativeAnchorWidthFromRightMargin.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(); CPPUNIT_ASSERT_DOUBLES_EQUAL(2408, nWidth, 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAutoFitForLegacyShapes, "tdf112312_AutoFitForLegacyShapes.odt") +CPPUNIT_TEST_FIXTURE(Test, testAutoFitForLegacyShapes) { + loadAndSave("tdf112312_AutoFitForLegacyShapes.odt"); // tdf#112312: check if noAutoFit is used instead of spAutoFit even if the TextAutoGrowHeight is set xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); 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 87023aba32c2..989ddcb98a38 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -51,8 +51,9 @@ protected: } }; -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76248, "FDO76248.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO76248) { + loadAndSave("FDO76248.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // In two cases the a:graphicData elements had no children, which is invalid. assertXPath(pXmlDoc, "//a:graphicData[not(*)]", 0); @@ -97,8 +98,9 @@ DECLARE_OOXMLEXPORT_TEST(testTscp, "tscp.docx") CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(xStatements->hasMoreElements())); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76589 , "fdo76589.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo76589 ) { + loadAndSave("fdo76589.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. @@ -109,23 +111,26 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76589 , "fdo76589.docx") assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" ); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDecimalNumberingNoLeveltext, "decimal-numbering-no-leveltext.docx") +CPPUNIT_TEST_FIXTURE(Test, testDecimalNumberingNoLeveltext) { + loadAndSave("decimal-numbering-no-leveltext.docx"); // This was "%1", not empty: we turned a kind-of-none numbering into a decimal one. xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val",""); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNoDuplicateAttributeExport, "duplicate-east-asia.odt") +CPPUNIT_TEST_FIXTURE(Test, testNoDuplicateAttributeExport) { + loadAndSave("duplicate-east-asia.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // File asserting while saving in LO. parseExport("word/document.xml"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79008, "fdo79008.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79008) { + loadAndSave("fdo79008.docx"); /* File crashing while saving in LO. * Check if document.xml file is created after fix */ @@ -182,8 +187,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyUnProtected, "tdf120852_readOnlyU } } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAuthorPropertySdt, "author-property.docx") +CPPUNIT_TEST_FIXTURE(Test, testAuthorPropertySdt) { + loadAndSave("author-property.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]"); @@ -193,8 +199,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAuthorPropertySdt, "author-property.docx // "xmlns:ns0='http://purl.org/dc/elements/1.1/' xmlns:ns1='http://schemas.openxmlformats.org/package/2006/metadata/core-properties'"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76586, "fdo76586.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO76586) { + loadAndSave("fdo76586.docx"); /* * In the test file gridCol had only one value for entire table width * while there are two cells in a table row. @@ -207,15 +214,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76586, "fdo76586.docx") assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[2]", "w", "7843"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76587 , "fdo76587.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO76587 ) { + loadAndSave("fdo76587.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml"); assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "line", "240"); assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "lineRule", "auto"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77890 , "fdo77890.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO77890 ) { + loadAndSave("fdo77890.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. @@ -238,8 +247,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedList,"NumberedList.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:numId","val", "0"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf131819) { + loadAndSave("NumberedList.docx"); // keep width of fixed size cells in the nested table xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // These were 4030 and 4249. @@ -247,8 +257,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]", "w", "4049"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131959, "NumberedList.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf131959) { + loadAndSave("NumberedList.docx"); // import tblInd from table style xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // These were 0. @@ -256,16 +267,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131959, "NumberedList.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd", "w", "360"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76597, "fdo76597.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO76597) { + loadAndSave("fdo76597.docx"); // check XML xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "96"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "120"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeTIF, "fdo77476.docx") +CPPUNIT_TEST_FIXTURE(Test, testContentTypeTIF) { + loadAndSave("fdo77476.docx"); xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tiff']", "PartName", "/word/media/image1.tif"); @@ -279,8 +292,9 @@ DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx") CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(xShape, "CharHeight")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFloatingTable, "fdo77887.docx") +CPPUNIT_TEST_FIXTURE(Test, testFloatingTable) { + loadAndSave("fdo77887.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "horzAnchor", "margin"); @@ -294,8 +308,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFloatingTable, "fdo77887.docx") assertXPathNoAttribute(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpYSpec"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") +CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeRight) { + loadAndSave("tdf90681-1.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -305,8 +320,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeleft, "tdf90681-2.odt") +CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeleft) { + loadAndSave("tdf90681-2.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -314,19 +330,22 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeleft, "tdf90681-2.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt") +CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeTableInTable) { + loadAndSave("ooo96040-2.odt"); parseExport("word/document.xml"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHyperlinkContainingPlaceholderField, "hyperlink-field.odt") +CPPUNIT_TEST_FIXTURE(Test, testHyperlinkContainingPlaceholderField) { + loadAndSave("hyperlink-field.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); parseExport("word/document.xml"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTablePreferredWidth, "tablePreferredWidth.docx") +CPPUNIT_TEST_FIXTURE(Test, testTablePreferredWidth) { + loadAndSave("tablePreferredWidth.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Problem :If the table preferred width is in percent, then after RT it changes to 0 & width type changes @@ -335,16 +354,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTablePreferredWidth, "tablePreferredWidt assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]", "type","pct"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO75431, "fdo75431.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO75431) { + loadAndSave("fdo75431.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:tbl", 2); assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type", "val", "nextPage"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77725, "fdo77725.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO77725) { + loadAndSave("fdo77725.docx"); xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]", 0); @@ -363,8 +384,9 @@ DECLARE_OOXMLEXPORT_TEST(testFieldRotation, "field-rotated.fodt") CPPUNIT_ASSERT_EQUAL(sal_Int16(900), getProperty<sal_Int16>(xRun, "CharRotation")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteSeparator, "footnotesep.fodt") +CPPUNIT_TEST_FIXTURE(Test, testFootnoteSeparator) { + loadAndSave("footnotesep.fodt"); // footnote separator definitions - taken from default page style xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "id", "0"); @@ -382,8 +404,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteSeparator, "footnotesep.fodt") assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[2]", "id", "1"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121441, "tdf121441.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf121441) { + loadAndSave("tdf121441.docx"); xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml"); 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); @@ -396,8 +419,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121441, "tdf121441.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "hAnsi", "Symbol"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77812, "fdo77812.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO77812) { + loadAndSave("fdo77812.docx"); /* Additional sectPr was getting inserted and hence Column properties * were getting added into this additional sectPr instead of Default setPr. */ @@ -412,8 +436,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77812, "fdo77812.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx") +CPPUNIT_TEST_FIXTURE(Test, testContentTypeOLE) { + loadAndSave("fdo77759.docx"); xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc, @@ -435,8 +460,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx") "Excel.Sheet.12"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78420, "fdo78420.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo78420) { + loadAndSave("fdo78420.docx"); xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml"); xmlDocUniquePtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels"); @@ -455,8 +481,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageBreakInFirstPara,"fdo77727.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br","type","page"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78284, "fdo78284.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO78284) { + loadAndSave("fdo78284.docx"); xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Override[@PartName='/word/media/OOXDiagramDataRels1_0.png']", "ContentType", @@ -469,16 +496,18 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78384,"fdo78384.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78469, "fdo78469.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo78469) { + loadAndSave("fdo78469.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml"); // 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); assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:text[1]",0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887, "fdo78887.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO78887) { + loadAndSave("fdo78887.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1]", 1); @@ -486,8 +515,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887, "fdo78887.docx") assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[2]", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887b, "missing_newline.odt") +CPPUNIT_TEST_FIXTURE(Test, testFDO78887b) { + loadAndSave("missing_newline.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -497,15 +527,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887b, "missing_newline.odt") assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[6]/w:t[1]", "New line"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78651, "fdo78651.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo78651) { + loadAndSave("fdo78651.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // ensure that there are only two tables assertXPath(pXmlDoc, "//w:tbl", 2); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78882, "fdo78882.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo78882) { + loadAndSave("fdo78882.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Ensure that Section Break is getting written inside second paragraph @@ -515,8 +547,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78882, "fdo78882.docx") assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:p[1]/w:pPr[1]/w:sectPr[1]",0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76934, "fdo76934.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo76934) { + loadAndSave("fdo76934.docx"); /* Issue was, AutoSpacing property if present inside styles.xml, LO was not able to * preserve it. */ @@ -527,8 +560,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76934, "fdo76934.docx") assertXPath ( pXmlDoc, "/w:styles[1]/w:style[@w:styleId='Title']/w:pPr[1]/w:spacing[1]", "beforeAutospacing", "1" ); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79540, "fdo79540.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79540) { + loadAndSave("fdo79540.docx"); /* Issue was, <w:drawing> was getting written inside <w:drawing>. * So postpone the writing of Inner Drawing tag. * MS Office does not allow nesting of drawing tags. @@ -541,8 +575,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79540, "fdo79540.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79062, "fdo79062.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO79062) { + loadAndSave("fdo79062.docx"); xmlDocUniquePtr pXmlFootNotes = parseExport("word/footnotes.xml"); assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14"); @@ -614,31 +649,35 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf118702,"tdf118702.odt") assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz", "orient", "landscape" ); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79822, "fdo79822.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79822) { + loadAndSave("fdo79822.docx"); /* File getting crash while saving in LO. * The Docx contain smartart and the file was created in ms word 2007 */ parseExport("word/document.xml"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79915, "fdo79915.docx") +CPPUNIT_TEST_FIXTURE(Test, testFDO79915) { + loadAndSave("fdo79915.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[9]/w:t", "How much buoyancy does the water provide?"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79817, "fdo79817.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79817) { + loadAndSave("fdo79817.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID", "{9222E47B-A68B-4AEB-9855-21C912B9D3D2}"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79968_sldx, "fdo79968.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79968_sldx) { + loadAndSave("fdo79968.docx"); // This UT for DOCX embedded with powerpoint slide xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); @@ -661,8 +700,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79968_sldx, "fdo79968.docx") "PowerPoint.Slide.12"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb) { + loadAndSave("fdo79969_xlsb.docx"); // This UT for DOCX embedded with binary excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); @@ -685,8 +725,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx") "Excel.SheetBinaryMacroEnabled.12"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80097, "fdo80097.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo80097) { + loadAndSave("fdo80097.docx"); //fdo#76635 : Table borders are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -706,8 +747,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80097, "fdo80097.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV",0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95033, "tdf95033.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf95033) { + loadAndSave("tdf95033.docx"); //tdf#95033 : Table borders defined by row-level tblPrEx are not getting preserved. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -721,8 +763,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95033, "tdf95033.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133455, "tdf133455.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf133455) { + loadAndSave("tdf133455.docx"); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); //Not disabled table cell borders @@ -736,8 +779,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133455, "tdf133455.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138612, "tdf138612.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf138612) { + loadAndSave("tdf138612.docx"); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); // Row 5 Col 1 - vertically merged cell @@ -753,8 +797,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138612, "tdf138612.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[2]/w:tcPr/w:vMerge", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf140597, "tdf140597.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf140597) { + loadAndSave("tdf140597.docx"); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); // There were missing tblPrEx table exception borders @@ -766,8 +811,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf140597, "tdf140597.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:start"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf128646) { + loadAndSave("tdf128646.docx"); // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden. xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -780,8 +826,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx") assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish", "val", "false"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119800, "tdf119800.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf119800) { + loadAndSave("tdf119800.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("word/document.xml"); @@ -795,8 +842,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119800, "tdf119800.docx") assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish", "val", "false"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo77129, "fdo77129.docx") +CPPUNIT_TEST_FIXTURE(Test, testFdo77129) { + loadAndSave("fdo77129.docx"); // The problem was that text after TOC field was missing if footer reference comes in field. xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -831,8 +879,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129402, "fdo77129.docx") CPPUNIT_ASSERT_EQUAL(OUString("How\t2"), aTocString); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsm) { + loadAndSave("fdo79969_xlsm.docx"); // This UT for DOCX embedded with excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); @@ -924,8 +973,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80523_sldm,"fdo80523_sldm.docx") "PowerPoint.SlideMacroEnabled.12"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80898, "fdo80898.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo80898) { + loadAndSave("fdo80898.docx"); // This UT for DOCX embedded with binary excel work sheet. xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); @@ -948,15 +998,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80898, "fdo80898.docx") "Word.Document.8"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleIconDrawAspect, "tdf131537.odt") +CPPUNIT_TEST_FIXTURE(Test, testOleIconDrawAspect) { + loadAndSave("tdf131537.odt"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject", "DrawAspect", "Icon"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableCellWithDirectFormatting, "fdo80800.docx") +CPPUNIT_TEST_FIXTURE(Test, testTableCellWithDirectFormatting) { + loadAndSave("fdo80800.docx"); // Issue was Direct Formatting for non-first Table cells was not getting preserved. xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1032,8 +1084,9 @@ DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPageStyle, "HeaderIsOn")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo83048, "fdo83048.docx") +CPPUNIT_TEST_FIXTURE(Test, testfdo83048) { + loadAndSave("fdo83048.docx"); // Issue was wrong SDT properties were getting exported for Date SDT xmlDocUniquePtr pXmlDoc = parseExport("word/footer2.xml"); @@ -1043,8 +1096,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo83048, "fdo83048.docx") "1/2/2013"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdt2Run, "sdt-2-run.docx") +CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) { + loadAndSave("sdt-2-run.docx"); xmlDocUniquePtr pXmlDoc = parseExport(); // The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed. @@ -1054,8 +1108,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdt2Run, "sdt-2-run.docx") assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/w:t", "third"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFD083057, "fdo83057.docx") +CPPUNIT_TEST_FIXTURE(Test, testFD083057) { + loadAndSave("fdo83057.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml"); // A fly frame was attached to a para which started with a hint (run) containing an SDT. @@ -1068,8 +1123,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFD083057, "fdo83057.docx") assertXPath(pXmlDoc, "//mc:AlternateContent//w:sdt", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHeaderBorder, "header-border.docx") +CPPUNIT_TEST_FIXTURE(Test, testHeaderBorder) { + loadAndSave("header-border.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 0, as header margin was lost during import. assertXPath(pXmlDoc, "//w:pgMar", "header", "720"); @@ -1093,8 +1149,9 @@ DECLARE_OOXMLEXPORT_TEST(testImageNoborder, "image-noborder.docx") CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineWidth); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf89774, "tdf89774.fodt") +CPPUNIT_TEST_FIXTURE(Test, testTdf89774) { + loadAndSave("tdf89774.fodt"); xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml"); // This was 65, as unit was seconds instead of minutes. assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:TotalTime", "1"); @@ -1122,8 +1179,9 @@ DECLARE_OOXMLEXPORT_TEST(testSectionProtection, "sectionprot.odt") CPPUNIT_ASSERT_EQUAL_MESSAGE("Section1 is protected", false, getProperty<bool>(xSect, "IsProtected")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSectionProtection2, "sectionprot2.odt") +CPPUNIT_TEST_FIXTURE(Test, testSectionProtection2) { + loadAndSave("sectionprot2.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { @@ -1164,8 +1222,9 @@ DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") CPPUNIT_ASSERT(xBookmarksByName->hasByName("permission-for-group:267014232:everyone")); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf106843, "tdf106843.fodt") +CPPUNIT_TEST_FIXTURE(Test, tdf106843) { + loadAndSave("tdf106843.fodt"); // check Track Changes permission set in Writer/OpenDocument (password: "test", encoded by default encoding of Writer) xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "trackedChanges"); @@ -1178,8 +1237,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf106843, "tdf106843.fodt") assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "val", "14"); // compatible with 2010 } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf89991_revisionView, "tdf89991.docx") +CPPUNIT_TEST_FIXTURE(Test, tdf89991_revisionView) { + loadAndSave("tdf89991.docx"); // check revisionView (Show Changes) import and export xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", "0"); @@ -1281,16 +1341,18 @@ DECLARE_OOXMLEXPORT_TEST(testOO72950, "ooo72950-1.odt") //There are two tables to export in this doc the second of which is inside a //frame anchored to first cell of the first table. They must not be //considered the same table -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo60957, "fdo60957-2.docx") +CPPUNIT_TEST_FIXTURE(Test, fdo60957) { + loadAndSave("fdo60957-2.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:tbl", 2); } //This has more cells than msword supports, we must balance the //number of cell start and ends -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOO106020, "ooo106020-1.odt") +CPPUNIT_TEST_FIXTURE(Test, testOO106020) { + loadAndSave("ooo106020-1.odt"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:tbl", 1); } @@ -1302,8 +1364,9 @@ DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx") CPPUNIT_ASSERT_EQUAL(OUString(u"\U00024b62"), xTextRange1->getString()); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSpacingGroupShapeText, "tdf131775_SpacingGroupShapeText.docx") +CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText) { + loadAndSave("tdf131775_SpacingGroupShapeText.docx"); // tdf#131775: Check if correct spacing. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1312,8 +1375,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSpacingGroupShapeText, "tdf131775_Spacin "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:spacing", "val", "71"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf100581, "tdf100581.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf100581) { + loadAndSave("tdf100581.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1333,8 +1397,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf100581, "tdf100581.odt") "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:sectPr", 0); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf112287, "tdf112287.docx") +CPPUNIT_TEST_FIXTURE(Test, testTdf112287) { + loadAndSave("tdf112287.docx"); // tdf#131775: Check if correct spacing. xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); @@ -1342,8 +1407,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf112287, "tdf112287.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr","vAnchor","margin"); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testZOrderInHeader, "tdf120760_ZOrderInHeader.docx") +CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader) { + loadAndSave("tdf120760_ZOrderInHeader.docx"); // tdf#120760 Check that the Z-Order of the background is smaller than the front shape's. xmlDocUniquePtr pXml = parseExport("word/header2.xml"); |