diff options
author | Onur Yilmaz <onuryilmaz0750@gmail.com> | 2019-12-26 01:56:31 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-12-26 06:55:50 +0100 |
commit | ae26c6a3cc7662c4e2a9b4c684f64b44ae28e8a9 (patch) | |
tree | 585c24b17c10ff43f15cd66074f0b91d6c2bef47 /sw/qa/extras/ooxmlexport | |
parent | 0375d9b5613b6d0f16042c3134af1dcae706d57f (diff) |
tdf#129423: Make export tests export-only where applicable
Change-Id: I7c4087535c03cd4e89e5cc983e07ac8c7b7daa79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85825
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 145 |
1 files changed, 36 insertions, 109 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index b673c06a3d2a..344b493dae4b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -34,7 +34,7 @@ protected: } }; -DECLARE_OOXMLEXPORT_TEST( testChildNodesOfCubicBezierTo, "FDO74774.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST( testChildNodesOfCubicBezierTo, "FDO74774.docx") { /* Number of children required by cubicBexTo is 3 of type "pt". While exporting, sometimes the child nodes are less than 3. @@ -42,19 +42,15 @@ DECLARE_OOXMLEXPORT_TEST( testChildNodesOfCubicBezierTo, "FDO74774.docx") for cubicBexTo */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath( pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[3]/wps:spPr[1]/a:custGeom[1]/a:pathLst[1]/a:path[1]/a:cubicBezTo[2]/a:pt[3]"); } -DECLARE_OOXMLEXPORT_TEST(testMSwordHang,"test_msword_hang.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testMSwordHang,"test_msword_hang.docx") { // fdo#74771: xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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", "0"); } @@ -68,11 +64,9 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapeThemeFont, "groupshape-theme-font.docx") CPPUNIT_ASSERT_EQUAL(OUString("Cambria"), getProperty<OUString>(xRun, "CharFontName")); } -DECLARE_OOXMLEXPORT_TEST(testAnchorIdForWP14AndW14, "AnchorId.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAnchorIdForWP14AndW14, "AnchorId.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline", "anchorId", "78735EFD"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "anchorId", "78735EFD"); @@ -120,7 +114,7 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWatermark, "pictureWatermark.docx") } -DECLARE_OOXMLEXPORT_TEST(testFdo76249, "fdo76249.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76249, "fdo76249.docx") { /* * The Locked Canvas is imported correctly, but while exporting @@ -129,26 +123,20 @@ DECLARE_OOXMLEXPORT_TEST(testFdo76249, "fdo76249.docx") * are not allowed inside the textboxes. */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1); } -DECLARE_OOXMLEXPORT_TEST(testFdo76979, "fdo76979.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76979, "fdo76979.docx") { // The problem was that black was exported as "auto" fill color, resulting in well-formed, but invalid XML. xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); - if (!pXmlDoc) - return; // This was "auto", not "FFFFFF". assertXPath(pXmlDoc, "//wps:spPr/a:solidFill/a:srgbClr", "val", "FFFFFF"); } -DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, "shape-effect-preservation.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeEffectPreservation, "shape-effect-preservation.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // first shape with outer shadow, rgb color assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -288,11 +276,9 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, "shape-effect-preservation "stA", "52000"); } -DECLARE_OOXMLEXPORT_TEST(testShape3DEffectPreservation, "shape-3d-effect-preservation.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShape3DEffectPreservation, "shape-3d-effect-preservation.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // first shape: extrusion and shift on z, rotated camera with zoom, rotated light rig assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -399,11 +385,9 @@ DECLARE_OOXMLEXPORT_TEST(testShape3DEffectPreservation, "shape-3d-effect-preserv "prstMaterial", "legacyWireframe"); } -DECLARE_OOXMLEXPORT_TEST(testPictureEffectPreservation, "picture-effects-preservation.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureEffectPreservation, "picture-effects-preservation.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // first picture: glow effect with theme color and transformations, 3d rotation and extrusion assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -551,19 +535,15 @@ DECLARE_OOXMLEXPORT_TEST(testPictureArtisticEffectPreservation, "picture-artisti CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/hdphoto3.wdp"))); } -DECLARE_OOXMLEXPORT_TEST(fdo77719, "fdo77719.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo77719, "fdo77719.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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); } -DECLARE_OOXMLEXPORT_TEST(testNestedAlternateContent, "nestedAlternateContent.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNestedAlternateContent, "nestedAlternateContent.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // 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); } @@ -581,44 +561,35 @@ DECLARE_OOXMLEXPORT_TEST(test76317, "test76317.docx") #endif -DECLARE_OOXMLEXPORT_TEST(fdo76591, "fdo76591.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo76591, "fdo76591.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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", "3"); } -DECLARE_OOXMLEXPORT_TEST(test76317_2K10, "test76317_2K10.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76317_2K10, "test76317_2K10.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) return; 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", "adj"); } -DECLARE_OOXMLEXPORT_TEST(testFDO77122, "LinkedTextBoxes.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77122, "LinkedTextBoxes.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; //ensure that the text box links are preserved. assertXPath(pXmlDoc, "//wps:txbx[1]", "id", "1"); assertXPath(pXmlDoc, "//wps:linkedTxbx[1]", "id", "1"); } -DECLARE_OOXMLEXPORT_TEST(test76734_2K7, "test76734_2K7.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76734_2K7, "test76734_2K7.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", "wps"); } -DECLARE_OOXMLEXPORT_TEST(test77219, "test77219.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test77219, "test77219.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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", "1"); } @@ -654,32 +625,25 @@ DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), aSubViewSize[0].Height); } -DECLARE_OOXMLEXPORT_TEST(testFdo76101, "fdo76101.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76101, "fdo76101.docx") { xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); - - if (!pXmlDoc) - return; xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:styles/w:style"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT(4091 >= xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); } -DECLARE_OOXMLEXPORT_TEST(testSdtAndShapeOverlapping,"ShapeOverlappingWithSdt.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAndShapeOverlapping,"ShapeOverlappingWithSdt.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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]/w:t[1]"); } -DECLARE_OOXMLEXPORT_TEST(testLockedCanvas, "fdo78658.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLockedCanvas, "fdo78658.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // 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); } @@ -696,11 +660,9 @@ DECLARE_OOXMLEXPORT_TEST(fdo78474, "fdo78474.docx") assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2"); } -DECLARE_OOXMLEXPORT_TEST(testAbsolutePositionOffsetValue,"fdo78432.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbsolutePositionOffsetValue,"fdo78432.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; xmlXPathObjectPtr pXmlObjs[6]; pXmlObjs[0] = getXPathNode(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]/wp:positionH[1]/wp:posOffset[1]"); @@ -727,17 +689,15 @@ DECLARE_OOXMLEXPORT_TEST(testRubyHyperlink, "rubyhyperlink.fodt") // test that export doesn't assert with overlapping ruby / hyperlink attr } -DECLARE_OOXMLEXPORT_TEST(testfdo78300,"fdo78300.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78300,"fdo78300.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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]", 0); } -DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, "testWordArtWithinDraingtool.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWordArtWithinDraingtool, "testWordArtWithinDraingtool.docx") { /* * Within a file, there is a 2007 wordArt enclosed in a drawing tool * LO was exporting it as below: @@ -749,15 +709,13 @@ DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, "testWordArtWithinDraingto * */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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:txbx/w:txbxContent",1); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape",1); // Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict. 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:txbx/w:txbxContent/w:p/w:r/w:pict",1); } -DECLARE_OOXMLEXPORT_TEST(testfdo78663, "fdo78663.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78663, "fdo78663.docx") { /* * A 2007 word art tool is enclosed in a 2010 drawing toolWithin a file, * Originally the file has the following xml tag hierarchy. @@ -771,8 +729,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo78663, "fdo78663.docx") * */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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:txbx/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1); // Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict. @@ -795,27 +751,23 @@ DECLARE_OOXMLEXPORT_TEST(testFdo78957, "fdo78957.docx") CPPUNIT_ASSERT(cy >= 0 ); } -DECLARE_OOXMLEXPORT_TEST(testfdo79256, "fdo79256.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79256, "fdo79256.docx") { /* corruption issue also solved by fixing tdf#108064: * since that LO keeps MSO preset dash styles during OOXML export */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document/w:body/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:ln/a:prstDash", "val", "lgDash"); } -DECLARE_OOXMLEXPORT_TEST(testDashedLine_CustDash1000thOfPercent, "dashed_line_custdash_1000th_of_percent.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDash1000thOfPercent, "dashed_line_custdash_1000th_of_percent.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. */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc,"/w:document/w:body/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:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000"); assertXPath(pXmlDoc,"/w:document/w:body/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:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000"); @@ -827,7 +779,7 @@ DECLARE_OOXMLEXPORT_TEST(testDashedLine_CustDash1000thOfPercent, "dashed_line_cu assertXPath(pXmlDoc,"/w:document/w:body/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:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000"); } -DECLARE_OOXMLEXPORT_TEST(testDashedLine_CustDashPercentage, "dashed_line_custdash_percentage.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDashPercentage, "dashed_line_custdash_percentage.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. @@ -835,8 +787,6 @@ DECLARE_OOXMLEXPORT_TEST(testDashedLine_CustDashPercentage, "dashed_line_custdas * as '1000th of a percent'. */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc,"/w:document/w:body/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:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000"); assertXPath(pXmlDoc,"/w:document/w:body/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:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000"); @@ -848,11 +798,9 @@ DECLARE_OOXMLEXPORT_TEST(testDashedLine_CustDashPercentage, "dashed_line_custdas assertXPath(pXmlDoc,"/w:document/w:body/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:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000"); } -DECLARE_OOXMLEXPORT_TEST(testCommentInitials, "comment_initials.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCommentInitials, "comment_initials.odt") { xmlDocPtr pXmlDoc = parseExport("word/comments.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc,"/w:comments/w:comment[1]", "initials", "initials"); } @@ -872,7 +820,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.doc CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString()); } -DECLARE_OOXMLEXPORT_TEST(testfdo79591, "fdo79591.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79591, "fdo79591.docx") { /* Values set for docPr name and shape ID attributes * in RT file were not valid as per UTF-8 encoding format @@ -880,8 +828,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79591, "fdo79591.docx") * message "invalid character" */ xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr", "name", ""); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", ""); @@ -893,18 +839,16 @@ DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getShape(1), "Opaque")); } -DECLARE_OOXMLEXPORT_TEST(testFdo80894, "TextFrameRotation.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80894, "TextFrameRotation.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // Rotation value was not roundtripped for textframe. assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm", "rot","16200000"); } -DECLARE_OOXMLEXPORT_TEST(testfdo80895, "fdo80895.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80895, "fdo80895.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 @@ -912,8 +856,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80895, "fdo80895.docx") // Checking there is a shape in header without <a:noFill/> element. xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:noFill",0); assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:noFill",0); @@ -945,42 +887,33 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength()); } -DECLARE_OOXMLEXPORT_TEST(testPictureColormodeGrayscale, "picture_colormode_grayscale.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeGrayscale, "picture_colormode_grayscale.docx") { // The problem was that the grayscale was not exported xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:grayscl", 1); } -DECLARE_OOXMLEXPORT_TEST(testPictureColormodeBlackWhite, "picture_colormode_black_white.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeBlackWhite, "picture_colormode_black_white.odt") { xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:biLevel", "thresh", "50000"); } -DECLARE_OOXMLEXPORT_TEST(testPictureColormodeWatermark, "picture_colormode_watermark.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeWatermark, "picture_colormode_watermark.odt") { xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); - if (!pXmlDoc) - return; - assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "bright", "70000"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "contrast", "-70000"); } -DECLARE_OOXMLEXPORT_TEST(testExportShadow, "bnc637947.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportShadow, "bnc637947.odt") { // The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dist" , "109865"); assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dir" , "634411"); @@ -988,11 +921,9 @@ DECLARE_OOXMLEXPORT_TEST(testExportShadow, "bnc637947.odt") assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha", "val" , "38000"); } -DECLARE_OOXMLEXPORT_TEST(testExportAdjustmentValue, "tdf91429.docx") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportAdjustmentValue, "tdf91429.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; 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", "val 50000"); } @@ -1087,21 +1018,17 @@ DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx") } #endif -DECLARE_OOXMLEXPORT_TEST(testTDF93675, "no-numlevel-but-indented.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTDF93675, "no-numlevel-but-indented.odt") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; assertXPath(pXmlDoc, "//w:ind", "start", "1418"); } -DECLARE_OOXMLEXPORT_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt") +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); - if (!pXmlDoc) - return; // there should be no flipH and flipV attributes in this case assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipH"); assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipV"); |