summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorAttila Bakos <bakos.attilakaroly@nisz.hu>2020-08-06 16:39:41 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-22 17:43:27 +0200
commit5ac88d12b377f64ff36551bfb3cf95a4a23a167d (patch)
tree322dc928e8e06703436fb53caea9fcc87e01232a /sw/qa/extras
parent5661e36bda03ccb580a653352cdc84335fd6410c (diff)
tdf#129423 sw: Convert more tests to export-only
Remove early return to let the following assertXPath fail where applicable. Add an export-only unit test macro for ODF export as well. Change-Id: Ib093f736b0aa24a9603da69ba9f74f25fd099c73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100421 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx14
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport12.cxx8
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx16
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx90
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx24
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx27
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport6.cxx24
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx12
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx5
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmllinks.cxx16
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlw14export.cxx6
14 files changed, 55 insertions, 197 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index ee25f99822fe..715d9ad68d35 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2022,13 +2022,11 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16);
}
-DECLARE_ODFEXPORT_TEST(testTableStyles3, "table_styles_3.odt")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTableStyles3, "table_styles_3.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
// This test checks if default valued attributes aren't exported.
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
- if (!pXmlDoc)
- return;
// <style:paragraph-properties>
// For this element the only exported attributes are: "border-left", "border-bottom"
@@ -2097,13 +2095,11 @@ DECLARE_ODFIMPORT_TEST(testTableStyles4, "table_styles_4.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(xCell1Style, "BackColor"));
}
-DECLARE_ODFEXPORT_TEST(testTableStyles5, "table_styles_5.odt")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTableStyles5, "table_styles_5.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
// Test if cell styles doesn't have a style:parent-style-name attribute.
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
- if (!pXmlDoc)
- return;
assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.1']", "parent-style-name");
assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.2']", "parent-style-name");
@@ -2453,18 +2449,14 @@ DECLARE_ODFEXPORT_TEST(tdf118502, "tdf118502.odt")
CPPUNIT_ASSERT(xReplacementGraphic.is());
}
-DECLARE_ODFEXPORT_TEST(tdf99631, "tdf99631.docx")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(tdf99631, "tdf99631.docx")
{
// check import of VisualArea settings of the embedded XLSX OLE objects
xmlDocUniquePtr pXmlDoc = parseExport("Object 1/settings.xml");
- if (!pXmlDoc)
- return;
assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaWidth']", "4515");
assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaHeight']", "903");
xmlDocUniquePtr pXmlDoc2 = parseExport("Object 2/settings.xml");
- if (!pXmlDoc2)
- return;
assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaWidth']", "4515");
assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaHeight']", "1354");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 9766e160e63a..667695b96f70 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -889,11 +889,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx")
sParaText);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf105444, "tdf105444.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105444, "tdf105444.docx")
{
xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml");
- if (!pXmlComm)
- return;
// there is no extra paragraph on Win32, only a single one.
assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1);
}
@@ -1027,12 +1025,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), nCheck);
}
-DECLARE_OOXMLEXPORT_TEST(testLanguageInGroupShape, "tdf131922_LanguageInGroupShape.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLanguageInGroupShape, "tdf131922_LanguageInGroupShape.docx")
{
// tdf#131922: Check if good language is used in shape group texts
xmlDocUniquePtr pXml = parseExport("word/document.xml");
- if (!pXml)
- return;
assertXPath(pXml,
"/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/"
"a:graphic/a:graphicData/wpg:wgp/"
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index e4c59534048b..0a35aaa7df09 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -1083,11 +1083,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127116, "tdf127116.odt")
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf127339, "tdf127339.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127339, "tdf127339.docx")
{
xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels");
- if (!pXmlRels)
- return;
assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='#bookmark']", "TargetMode");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 3e415e25da18..01f0726f5296 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -705,19 +705,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx")
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Text"), sNodeType);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121661, "tdf121661.docx")
{
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- if (!pXmlSettings)
- return;
assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", "851");
}
-DECLARE_OOXMLEXPORT_TEST(testTdf121658, "tdf121658.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121658, "tdf121658.docx")
{
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- if (!pXmlSettings)
- return;
assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps");
}
@@ -1159,12 +1155,10 @@ DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt")
assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/w:suppressAutoHyphens", "val", "true");
}
-DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupShapeText.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupShapeText.docx")
{
// tdf#131776: Check if strikeout is used in shape group texts
xmlDocUniquePtr pXml = parseExport("word/document.xml");
- if (!pXml)
- return;
// double strike (dstrike)
// no "val" attribute
@@ -1211,12 +1205,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131539, "tdf131539.odt")
CPPUNIT_ASSERT(aXmlVal.indexOf("margin-left:139.95")>-1);
}
-DECLARE_OOXMLEXPORT_TEST(testLineWidthRounding, "tdf126363_LineWidthRounding.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineWidthRounding, "tdf126363_LineWidthRounding.docx")
{
// tdf#126363: check if line with stays the same after export
xmlDocUniquePtr pXml = parseExport("word/document.xml");
- if (!pXml)
- return;
// this was 57240 (it differs from the original 57150, losing the preset line width)
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "57150");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index c9cc9bd617c3..ad96c19673c3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -39,8 +39,6 @@ protected:
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123621, "tdf123621.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
"/wp:positionV/wp:posOffset", "1080135");
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index d3558b59e6e8..504be6950cd0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -150,12 +150,10 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt")
}
}
-DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testStyleInheritance, "style-inheritance.docx")
{
// Check that now styleId's are more like what MSO produces
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
// the 1st style always must be Normal
assertXPath(pXmlStyles, "/w:styles/w:style[1]", "styleId", "Normal");
// some random style later
@@ -250,12 +248,10 @@ DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx")
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:pPr/w:suppressAutoHyphens", 0);
}
-DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCalendar1, "calendar1.docx")
{
// Document has a non-trivial table style, test the roundtrip of it.
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:basedOn", "val", "TableNormal");
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rsid", "val", "00903003");
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblPr/w:tblStyleColBandSize", "val", "1");
@@ -354,13 +350,11 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar5, "calendar5.docx")
CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),3), "CharHeight"));
}
-DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTcBorders, "testTcBorders.docx")
{
//fdo#76635 : Table borders are not getting preserved.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:val = 'single']",1);
assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:sz = 4]", 1);
@@ -373,11 +367,9 @@ DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", float(150), getProperty<float>(xStyle, "CharWeight"));
}
-DECLARE_OOXMLEXPORT_TEST(testQuicktables, "quicktables.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testQuicktables, "quicktables.docx")
{
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
// These were missing in the Calendar3 table style.
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:rFonts", "cstheme", "majorBidi");
@@ -403,11 +395,9 @@ DECLARE_OOXMLEXPORT_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_TEST(testFdo71302, "fdo71302.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo71302, "fdo71302.docx")
{
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
// This got renamed to "Strong Emphasis" without a good reason.
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Strong']", 1);
@@ -783,14 +773,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt")
CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && crop.Left == crop.Right);
}
-DECLARE_OOXMLEXPORT_TEST(testFootnoteParagraphTag, "testFootnote.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFootnoteParagraphTag, "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.
*/
xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml");
- if (!pXmlFootnotes)
- return;
assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]","id","2");
assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r/w:footnoteRef", 1);
}
@@ -820,12 +808,10 @@ DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(getShape(1), "FillColor"));
}
-DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testThemePreservation, "theme-preservation.docx")
{
// check default font theme values have been preserved
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi");
assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "cstheme", "minorBidi");
@@ -838,8 +824,6 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx")
// check direct format font theme values have been preserved
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "hAnsiTheme", "majorHAnsi");
assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "asciiTheme", "majorHAnsi");
@@ -850,8 +834,6 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx")
// check the themeFontLang values in settings file
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- if (!pXmlSettings)
- return;
assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "val", "en-US");
assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "eastAsia", "zh-CN");
assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "bidi", "he-IL");
@@ -878,11 +860,9 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx")
assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeShade", "80");
}
-DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTableThemePreservation, "table-theme-preservation.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// check cell theme colors have been preserved
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd", "themeFill", "accent6");
@@ -1004,61 +984,51 @@ 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_TEST(testSingleCellTableBorders, "tdf124399_SingleCellTableBorders.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSingleCellTableBorders, "tdf124399_SingleCellTableBorders.docx")
{
// tdf#124399: Extra borders on single cell tables fixed.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top [@w:val = 'nil']", 1);
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 1);
}
-DECLARE_OOXMLEXPORT_TEST(testInsideBorders, "tdf129242_InsideBorders.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testInsideBorders, "tdf129242_InsideBorders.docx")
{
// tdf#129242: Don't remove inside borders if the table has more than one cells.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// If this is not 0, then inside borders are removed.
assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders", 0);
}
-DECLARE_OOXMLEXPORT_TEST(testRightBorder, "tdf129442_RightBorder.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRightBorder, "tdf129442_RightBorder.docx")
{
// tdf#129442: Right border of a one column table was missing.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// If the right border is missing like in the bug, then there is a <w:right w:val="nil" /> tag in tcBorders.
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_TEST(testBottomBorder, "tdf129450_BottomBorder.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBottomBorder, "tdf129450_BottomBorder.docx")
{
// tdf#129450: Missing bottom border in one row table.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// If there is no bottom border, it is shown in tcBorders.
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_TEST(testBottomBorders, "tdf129452_BottomBorders.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBottomBorders, "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.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0);
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0);
@@ -1067,28 +1037,22 @@ DECLARE_OOXMLEXPORT_TEST(testBottomBorders, "tdf129452_BottomBorders.docx")
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcBorders/w:bottom", 0);
}
-DECLARE_OOXMLEXPORT_TEST(testFontTypes, "tdf120344_FontTypes.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontTypes, "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.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/w:rPr/w:rFonts [@w:ascii='Consolas']", 1);
// Now the font type of the numbering symbols, should be Arial Black.
xmlDocUniquePtr qXmlDocument = parseExport("word/numbering.xml");
- if (!qXmlDocument)
- return;
assertXPath(qXmlDocument, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:rPr/w:rFonts [@w:ascii='Arial Black']", 1);
}
-DECLARE_OOXMLEXPORT_TEST(testNumberingLevels, "tdf95495.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberingLevels, "tdf95495.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// tdf#95495: set list level of the custom style based on the setting of the parent style
// [this assertXPath is not a very good test, since the numbering definition is not set on the paragraph itself,
@@ -1100,48 +1064,40 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingLevels, "tdf95495.docx")
assertXPath(pXmlDoc, "//body/txt[5]/LineBreak", "Line", "A.2.1 .DESCRIPTION");
}
-DECLARE_OOXMLEXPORT_TEST(testVerticalBorders, "calendar3.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVerticalBorders, "calendar3.docx")
{
// tdf#130799: Inside vertical borders of a table should not be missing.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// Left and right borders.
assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2);
}
-DECLARE_OOXMLEXPORT_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx")
{
// tdf#100751: Both x and y flip should happen.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
OUString arrowStyle = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group/v:shape[2]", "style");
CPPUNIT_ASSERT(arrowStyle.indexOf(u"flip:xy") != sal_Int32(-1));
}
-DECLARE_OOXMLEXPORT_TEST(testArrowPosition, "tdf104565_ArrowPosition.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowPosition, "tdf104565_ArrowPosition.docx")
{
// tdf#104565: Test correct position.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// This is the correct Y coordinate, the incorrect was 817880.
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
"/wp:positionV/wp:posOffset", "516255");
}
-DECLARE_OOXMLEXPORT_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx")
{
// tdf#123346: Check arrow marker.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
"/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", "arrow");
@@ -1161,23 +1117,19 @@ DECLARE_OOXMLEXPORT_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth.odt")
"/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "0");
}
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromLeftMargin, "tdf132976_testRelativeAnchorWidthFromLeftMargin.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromLeftMargin, "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();
- if (!pXmlDoc)
- return;
assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width", "1133");
}
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromInsideOutsideMargin, "tdf133861_RelativeAnchorWidthFromInsideOutsideMargin.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromInsideOutsideMargin, "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();
- if (!pXmlDoc)
- return;
// Inside
assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[1]/bounds", "width", "1440");
// Outside
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 80c9821cf0f6..928e4557d8b0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -203,11 +203,9 @@ DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx")
CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType);
}
-DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73550, "fdo73550.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// This was wrap="none".
assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts");
}
@@ -893,12 +891,10 @@ 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_TEST(testFdo76016, "fdo76016.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76016, "fdo76016.docx")
{
// check XML
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- if (!pXmlDoc)
- return;
assertXPath(pXmlDoc, "//a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]", "name", "adj1");
assertXPath(pXmlDoc, "//a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]", "name", "adj2");
}
@@ -1206,12 +1202,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocxTablePosition, "floating-table-posit
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "4611");
}
-DECLARE_OOXMLEXPORT_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupSapeText.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupSapeText.docx")
{
// tdf#123351: Check if correct underline is used.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"
"/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "single");
@@ -1260,12 +1254,10 @@ DECLARE_OOXMLEXPORT_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupS
"/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_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineColorGroupedShapes.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineColorGroupedShapes.docx")
{
// tdf#132491 : Check if correct color is used for underline.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/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:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "FF0000");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
@@ -1274,22 +1266,18 @@ DECLARE_OOXMLEXPORT_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineCo
"/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color");
}
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorWidthFromRightMargin, "tdf133670_testRelativeAnchorWidthFromRightMargin.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorWidthFromRightMargin, "tdf133670_testRelativeAnchorWidthFromRightMargin.docx")
{
// tdf#133670 The width was set relative from right margin, but this was handled relative from page width.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- if (!pXmlDoc)
- return;
auto nWidth = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "width").toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(2408, nWidth, 1);
}
-DECLARE_OOXMLEXPORT_TEST(testAutoFitForLegacyShapes, "tdf112312_AutoFitForLegacyShapes.odt")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAutoFitForLegacyShapes, "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");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
"wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:noAutofit");
assertXPathNoAttribute(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 c5d81fba9c5b..7ef68c54404a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -339,11 +339,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO75431, "fdo75431.docx")
assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type", "val", "nextPage");
}
-DECLARE_OOXMLEXPORT_TEST(testFDO77725, "fdo77725.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO77725, "fdo77725.docx")
{
xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml");
- if (!pXmlFootnotes)
- return;
assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]", 0);
assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[2]", 0);
@@ -433,16 +431,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testContentTypeOLE, "fdo77759.docx")
"Excel.Sheet.12");
}
-DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78420, "fdo78420.docx")
{
xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml");
- if (!pXmlHeader)
- return;
-
xmlDocUniquePtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels");
- if(!pXmlHeaderRels)
- return;
assertXPath(pXmlHeaderRels,"/rels:Relationships/rels:Relationship[1]","Id","rId1");
}
@@ -605,8 +598,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78907,"fdo78907.docx")
assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page" );
xmlDocUniquePtr pXmlDoc1 = parseExport("word/footer1.xml");
- if (!pXmlDoc1)
- return;
assertXPath ( pXmlDoc1, "/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl", 0 );
}
@@ -691,13 +682,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx")
"Excel.SheetBinaryMacroEnabled.12");
}
-DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80097, "fdo80097.docx")
{
//fdo#76635 : Table borders are not getting preserved.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
//Table Cell Borders
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:top[@w:val = 'single']",1);
@@ -714,13 +703,11 @@ DECLARE_OOXMLEXPORT_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_TEST(testTdf95033, "tdf95033.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95033, "tdf95033.docx")
{
//tdf#95033 : Table borders defined by row-level tblPrEx are not getting preserved.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
//Not disabled table cell borders
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0);
@@ -731,11 +718,9 @@ DECLARE_OOXMLEXPORT_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_TEST(testTdf133455, "tdf133455.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133455, "tdf133455.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
//Not disabled table cell borders
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'nil']", 0);
@@ -1329,8 +1314,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testZOrderInHeader, "tdf120760_ZOrderInHeade
{
// tdf#120760 Check that the Z-Order of the background is smaller than the front shape's.
xmlDocUniquePtr pXml = parseExport("word/header1.xml");
- if (!pXml)
- return;
// Get the Z-Order of the background image and of the shape in front of it.
sal_Int32 nBackground = getXPath(pXml, "/w:hdr/w:p[1]/w:r[1]/w:drawing/wp:anchor", "relativeHeight").toInt32();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 7435604dcbda..568b21daac61 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -46,8 +46,6 @@ protected:
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133701, "tdf133701.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "hSpace", "567");
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vSpace", "284");
@@ -524,14 +522,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testImageData, "image_data.docx")
CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape/v:imagedata", "detectmouseclick").match("t"));
}
-DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo70838, "fdo70838.docx")
{
// The problem was that VMLExport::Commit didn't save the correct width and height,
// and ImplEESdrWriter::ImplFlipBoundingBox made a mistake calculating the position
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// Check DML document
@@ -710,12 +706,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo70942, "fdo70942.docx")
"prst", "ellipse");
}
-DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx")
{
// The problem was that the position of the picture was incorrect, it was shifted towards the bottom right corner.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
OString aXPath("/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:xfrm/a:off");
// This was 720.
@@ -724,11 +718,9 @@ DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx")
assertXPath(pXmlDocument, aXPath, "y", "0");
}
-DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeThemePreservation, "shape-theme-preservation.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// check shape style has been preserved
assertXPath(pXmlDocument,
@@ -873,11 +865,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLineStyle_DashType, "LineStyle_DashType.
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDot");
}
-DECLARE_OOXMLEXPORT_TEST(testGradientFillPreservation, "gradient-fill-preservation.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGradientFillPreservation, "gradient-fill-preservation.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
// check rgb colors for every step in the gradient of the first shape
assertXPath(pXmlDocument,
@@ -972,11 +962,9 @@ DECLARE_OOXMLIMPORT_TEST(testTdf107119, "tdf107119.docx")
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(XPropsWrap, "Surround"));
}
-DECLARE_OOXMLEXPORT_TEST(testTdf133457, "tdf133457.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133457, "tdf133457.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr", "vAnchor", "text");
}
@@ -984,8 +972,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133457, "tdf133457.docx")
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133924, "tdf133924.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "wrap", "around");
assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "wrap", "notBeside");
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 208c0354d264..61d914ced235 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -99,14 +99,14 @@ DECLARE_OOXMLEXPORT_TEST(testDkVert, "dkvert.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<drawing::Hatch>(xShape, "FillHatch").Distance);
}
-DECLARE_OOXMLEXPORT_TEST(testTextWatermark, "textWatermark.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTextWatermark, "textWatermark.docx")
{
//The problem was that the watermark ID was not preserved,
//and Word uses the object ID to identify if it is a watermark.
//It has to have the 'PowerPlusWaterMarkObject' string in it
xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml");
if (!pXmlHeader1)
- return;
+ return;
assertXPath(pXmlHeader1, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]","id","PowerPlusWaterMarkObject93701316");
@@ -115,7 +115,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextWatermark, "textWatermark.docx")
CPPUNIT_ASSERT(!sSpid.isEmpty());
}
-DECLARE_OOXMLEXPORT_TEST(testPictureWatermark, "pictureWatermark.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureWatermark, "pictureWatermark.docx")
{
//The problem was that the watermark ID was not preserved,
//and Word uses the object ID to identify if it is a watermark.
@@ -123,7 +123,7 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWatermark, "pictureWatermark.docx")
xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml");
if (!pXmlHeader1)
- return;
+ return;
// Check the watermark ID
assertXPath(pXmlHeader1, "/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:shape[1]","id","WordPictureWatermark11962361");
@@ -1123,12 +1123,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlipAndRotateCustomShape, "flip_and_rota
1701, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y").toInt32(), 1);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf92335, "tdf92335.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf92335, "tdf92335.docx")
{
// Don't export redundant ListLabel character styles
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
assertXPath(pXmlStyles, "//w:style[@w:styleId='ListLabel1']", 0);
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
index a6a5b37af52e..9c9088dda817 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
@@ -24,13 +24,10 @@ protected:
}
};
-DECLARE_OOXMLEXPORT_TEST(testSaveAsDotX, "sample.dotx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSaveAsDotX, "sample.dotx")
{
xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml");
- if (!pXmlDocCT)
- return;
-
// Ensure that document has correct content type
assertXPath(pXmlDocCT,
"/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']",
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 82397edbec02..b4da04e47f11 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -226,15 +226,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCaption4, "TableWithAboveCaptions.docx")
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " SEQ Table \\* ARABIC ");
}
-DECLARE_OOXMLEXPORT_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.docx")
{
// Problem is that footer1.xml.rels contains the empty
// Target due to which the file get corrupted
// in MS Office 2007.
// Check for footer1.xml.rels file.
xmlDocUniquePtr pXmlRels = parseExport("word/_rels/footer1.xml.rels");
- if (!pXmlRels)
- return;
// Check the value of Target which is http://www.google.com/.
assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship","Target","http://www.google.com/");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
index 9f94f57b92e6..d4348732fb52 100644
--- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
@@ -179,8 +179,6 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", US
USE_TEMP_DIR)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
"relative.docx");
@@ -190,8 +188,6 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", US
DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target");
CPPUNIT_ASSERT(sTarget.startsWith("file:///"));
@@ -202,8 +198,6 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", US
USE_TEMP_DIR)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", "test.docx");
}
@@ -212,8 +206,6 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", US
DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target");
CPPUNIT_ASSERT(sTarget.startsWith("file:///"));
@@ -223,8 +215,6 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", US
DECLARE_LINKS_EXPORT_TEST(testTdf123627_export, "tdf123627.docx", USE_RELATIVE, USE_TEMP_DIR)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
"test.docx");
@@ -233,8 +223,6 @@ DECLARE_LINKS_EXPORT_TEST(testTdf123627_export, "tdf123627.docx", USE_RELATIVE,
DECLARE_LINKS_EXPORT_TEST(testTdf126590_export, "tdf126590.docx", USE_ABSOLUTE, DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
// in the original file: Target="file:///C:\TEMP\test.docx" => invalid file URI
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
"file:///C:/TEMP/test.docx");
@@ -243,8 +231,6 @@ DECLARE_LINKS_EXPORT_TEST(testTdf126590_export, "tdf126590.docx", USE_ABSOLUTE,
DECLARE_LINKS_EXPORT_TEST(testTdf126768_export, "tdf126768.docx", USE_ABSOLUTE, DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
// in the original file: "file:///C:\\TEMP\\test.docx" => invalid file URI
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
"file:///C:/TEMP/test.docx");
@@ -254,8 +240,6 @@ DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_
DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- if (!pXmlDoc)
- return;
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
INetURLObject::decode( OUString("file:///C:/TEMP/%C3%A9kezet.docx"), INetURLObject::DecodeMechanism::ToIUri,
diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
index d7701586b167..157939060024 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
@@ -244,17 +244,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_TextEffects_StylisticSets_CntxtAlts, "T
}
-DECLARE_OOXMLEXPORT_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts.docx")
{
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- if (!pXmlDocument)
- return;
assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14");
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- if (!pXmlStyles)
- return;
assertXPath(pXmlStyles, "/w:styles", "Ignorable", "w14");
}