diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-05-12 10:20:51 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-05-13 11:16:28 +0200 |
commit | 3ae3fe7a5758beb0fd27ae77e1f28d7825bc1e70 (patch) | |
tree | f9df05d0bc74ff60cee0074b710bdaa388ca54a6 | |
parent | 7c831c94ceaf7f48383315216573b1f5691c10bc (diff) |
CppUnittest: ooxmlexport: assert pages in odf files
Change-Id: I3ea11ed9c2fa366e4f615df3c417c89758cbe4db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94038
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 9 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 22 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 5 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 11 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 14 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 7 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 11 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 5 |
15 files changed, 105 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ac1c714348d9..8d5fee8748f1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -369,6 +369,7 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx") DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noinheritChapterNumbering.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // in LO, it appears that styles based on the Chapter Numbering style explicitly set the // numbering style/outline level to 0 by default, and that LO prevents inheriting directly from "Outline" style. // Adding this preventative unit test to ensure that any fix for tdf106541 doesn't make incorrect assumptions. @@ -634,6 +635,7 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphMark, "paragraph-mark.docx") DECLARE_OOXMLEXPORT_TEST(testParagraphMarkNonempty, "paragraph-mark-nonempty.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport()) // There were two <w:sz> elements, make sure the 40 one is dropped and the 20 one is kept. assertXPath(pXmlDoc, "//w:p/w:pPr/w:rPr/w:sz", "val", "20"); @@ -710,6 +712,7 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlSymbolChicagoList, "symbol_chicago_list.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHTW, "numlist-zhtw.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","taiwaneseCountingThousand" ); @@ -717,6 +720,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHTW, "numlist-zhtw.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHCN, "numlist-zhcn.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","chineseCountingThousand" ); @@ -724,6 +728,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOoxmlNumListZHCN, "numlist-zhcn.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOOxmlOutlineNumberTypes, "outline-number-types.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pStyle", "val", "Heading1"); @@ -811,6 +816,7 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin, "effectextent-margin.docx") DECLARE_OOXMLEXPORT_TEST(testTdf88583, "tdf88583.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), getProperty<sal_Int32>(getParagraph(1), "FillColor")); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 4ba57fabc25f..422e374c3280 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -827,6 +827,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo85542, "fdo85542.docx") DECLARE_OOXMLEXPORT_TEST(testTdf65955, "tdf65955.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xBookmarksByIdx->getCount()); @@ -845,6 +846,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf65955, "tdf65955.odt") DECLARE_OOXMLEXPORT_TEST(testTdf65955_2, "tdf65955_2.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xBookmarksByIdx->getCount()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 1e9e55da8958..2133feded15e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -84,6 +84,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") DECLARE_OOXMLEXPORT_TEST(testTdf116436_rowFill, "tdf116436_rowFill.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); @@ -99,6 +100,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121665_back2backColumnBreaks, "tdf121665_back2ba DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent0, "tdf126795_TabsRelativeToIndent0.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence<style::TabStop> >(getParagraph( 2 ), "ParaTabStops"); CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment ); @@ -107,6 +109,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent0, "tdf126795_TabsRel DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent1, "tdf126795_TabsRelativeToIndent1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence<style::TabStop> >(getParagraph( 2 ), "ParaTabStops"); CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment ); @@ -182,6 +185,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121561_tocTitleDocx, "tdf121456_tabsOffset.odt") { + CPPUNIT_ASSERT_EQUAL(7, getPages()); xmlDocUniquePtr pXmlDoc = parseExport(); // get TOC node @@ -361,6 +365,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf94801, "tdf94801.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphSplitOnSectionBorder, "parasplit-on-section-border.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Test document has only two paragraphs. After splitting, it should contain @@ -371,6 +376,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphSplitOnSectionBorder, "paraspli DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf44832_testSectionWithDifferentHeader, "tdf44832_section_new_header.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1); } @@ -415,6 +421,7 @@ DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.d DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf117805, "tdf117805.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); @@ -688,6 +695,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119760_positionCellBorder, "tdf119760_positionCe DECLARE_OOXMLEXPORT_TEST(testTdf98620_environmentBiDi, "tdf98620_environmentBiDi.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( getParagraph(1), "WritingMode" )); CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_RIGHT), getProperty<sal_Int32>( getParagraph(1), "ParaAdjust" )); @@ -1205,6 +1213,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105215, "tdf105215.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // check paragraphs with removed paragraph mark diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index ff7bbc5e4b01..872e94adac6e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -38,6 +38,7 @@ protected: DECLARE_OOXMLEXPORT_TEST(testTableCrossReference, "table_cross_reference.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // MSO uses simple bookmarks for referencing table caption, so we do the same by export if (!mbExported) @@ -211,6 +212,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableCrossReference, "table_cross_reference.odt") DECLARE_OOXMLEXPORT_TEST(testTableCrossReferenceCustomFormat, "table_cross_reference_custom_format.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // Check also captions with custom formatting if (!mbExported) @@ -344,6 +346,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableCrossReferenceCustomFormat, DECLARE_OOXMLEXPORT_TEST(testObjectCrossReference, "object_cross_reference.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); // tdf#42346: Cross references to objects were not saved // MSO uses simple bookmarks for referencing table caption, so we do the same by export if (!mbExported) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index d7102f0631ee..28f91f578645 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -304,6 +304,7 @@ DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx") DECLARE_OOXMLEXPORT_TEST(testTdf127316_autoEscapement, "tdf127316_autoEscapement.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // This should be roughly .8*35% of the ORIGINAL(non-reduced) size. However, during export the // proportional height has to be changed into direct formatting, which then changes the relative percent. // In this case, a 24pt font, proportional at 65% becomes roughly a 16pt font. @@ -345,6 +346,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript, "tdf99602_charStyleSub DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript2, "tdf99602_charStyleSubscript2.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // *_In styles_*, don't let the proportionality/escapement affect the fontsize - otherwise it starts doubling up, // so instead just throw away the values and use the default settings instead - meaning fontsize is unaffected. // subscript custom: Proportional size is 80%, lower by 25%. @@ -455,6 +457,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle2, "tdf118947_tableStyle2.docx" DECLARE_OOXMLEXPORT_TEST(tdf123912_protectedForm, "tdf123912_protectedForm.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -479,6 +482,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf124600b, "tdf124600b.docx") DECLARE_OOXMLEXPORT_TEST(testDateControl, "empty-date-control.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Check that we exported the empty date control correctly // Date form field is converted to date content control. if (!mbExported) @@ -525,6 +529,7 @@ DECLARE_OOXMLEXPORT_TEST(testDateControl, "empty-date-control.odt") DECLARE_OOXMLEXPORT_TEST(testTdf121867, "tdf121867.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); SwEditShell* pEditShell = pTextDoc->GetDocShell()->GetEditShell(); // Without the accompanying fix in place, this test would have failed with @@ -554,6 +559,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, "para-adjust-distribute.docx" DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (!mbExported) // importing the ODT, an input field { uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -582,6 +588,7 @@ DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt") DECLARE_OOXMLEXPORT_TEST(testTdf116371, "tdf116371.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure the rotation is exported correctly, and size not distorted auto xShape(getShape(1)); CPPUNIT_ASSERT_DOUBLES_EQUAL(4700.0, getProperty<double>(xShape, "RotateAngle"), 10); @@ -623,6 +630,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTextInput, "textinput.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -771,6 +779,7 @@ DECLARE_OOXMLEXPORT_TEST(testTbrlFrameVml, "tbrl-frame-vml.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf119037, "tdf119037.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); @@ -870,6 +879,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf78657, "tdf78657_picture_hyperlink.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBtlrFrame, "btlr-frame.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); comphelper::SequenceAsHashMap aGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); // Without the accompanying fix in place, this test would have failed with 'Expected: @@ -880,6 +890,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBtlrFrame, "btlr-frame.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125518, "tdf125518.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1037,6 +1048,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127116, "tdf127116.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1056,6 +1068,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127339, "tdf127339.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127362, "tdf127362.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels"); @@ -1069,6 +1082,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127362, "tdf127362.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127605, "tdf127605.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name"); @@ -1078,6 +1092,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127605, "tdf127605.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127732, "internal_hyperlink_frame.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:bookmarkStart", "name"); @@ -1087,6 +1102,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127732, "internal_hyperlink_frame.odt DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127733, "internal_hyperlink_ole.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1097,6 +1113,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127733, "internal_hyperlink_ole.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127734, "internal_hyperlink_region.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name"); @@ -1106,6 +1123,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127734, "internal_hyperlink_region.od DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127735, "internal_hyperlink_table.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:bookmarkStart", "name"); @@ -1115,6 +1133,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127735, "internal_hyperlink_table.odt DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123628, "tdf123628.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); @@ -1137,6 +1156,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); if (!pXmlStyles) return; @@ -1146,12 +1166,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127579, "tdf127579.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "InternetLink"); } DECLARE_OOXMLEXPORT_TEST(testTdf128304, "tdf128304.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); css::text::WritingMode eMode; uno::Reference<beans::XPropertySet> xProps1(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xProps1->getPropertyValue("TextWritingMode") >>= eMode); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 8c40788c3dd9..e92fc7fb76dc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -311,6 +311,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf87569d, "tdf87569_drawingml.docx") DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // check character properties { uno::Reference<beans::XPropertySet> xStyle( @@ -434,6 +435,7 @@ DECLARE_OOXMLEXPORT_TEST(testPageContentBottom, "page-content-bottom.docx") DECLARE_OOXMLEXPORT_TEST(testTdf129522_removeShadowStyle, "tdf129522_removeShadowStyle.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles"); uno::Reference< beans::XPropertySet > xStyleProps(paragraphStyles->getByName("Shadow"), uno::UNO_QUERY_THROW); table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xStyleProps, "ParaShadowFormat"); @@ -815,6 +817,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77796, "tdf77796.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128290, "tdf128290.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXml = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXml); assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblLayout", "type", "fixed"); @@ -872,6 +875,7 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header- DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Explicitly set hyphenation=auto on document level xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml"); CPPUNIT_ASSERT(pXmlSettings); @@ -930,6 +934,7 @@ DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupS DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131539, "tdf131539.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); //The positions of OLE objects were not exported, check if now it is exported correctly xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(p_XmlDoc); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index be666192f555..f9541a29678a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -70,6 +70,7 @@ protected: DECLARE_OOXMLEXPORT_TEST(testPageGraphicBackground, "page-graphic-background.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // No idea how the graphic background should be exported (seems there is no // way to do a non-tiling export to OOXML), but at least the background // color shouldn't be black. @@ -103,6 +104,7 @@ DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx") DECLARE_OOXMLEXPORT_TEST(defaultTabStopNotInStyles, "empty.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The default tab stop was mistakenly exported to a style. // xray ThisComponent.StyleFamilies(1)(0).ParaTabStop uno::Reference< container::XNameAccess > paragraphStyles = getStyles( "ParagraphStyles" ); @@ -179,6 +181,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo38244, "fdo38244.docx") DECLARE_OOXMLEXPORT_TEST(testCommentsNested, "comments-nested.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xOuter = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 2), "TextField"); CPPUNIT_ASSERT_EQUAL(OUString("Outer"), getProperty<OUString>(xOuter, "Content")); @@ -193,6 +196,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathEscape, "math-escape.docx") DECLARE_OOXMLEXPORT_TEST(testFdo51034, "fdo51034.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that the 'l' param of the HYPERLINK field was parsed with = "#", not += "#". CPPUNIT_ASSERT_EQUAL(OUString("http://Www.google.com/#a"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); } @@ -323,6 +327,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathVerticalStacks, "math-vertical_stacks.docx") DECLARE_OOXMLEXPORT_TEST(testTable, "table.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure we write qFormat for well-known style names. xmlDocUniquePtr pXmlDocCT = parseExport("word/styles.xml"); CPPUNIT_ASSERT(pXmlDocCT); @@ -404,6 +409,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableBorders, "table-borders.docx") DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that we lacked the fallback to export the replacement // graphic for OLE objects. But we can actually export the OLE itself now, // so check that instead. @@ -442,6 +448,7 @@ DECLARE_OOXMLEXPORT_TEST(test1Table1Page, "1-table-1-page.docx") DECLARE_OOXMLEXPORT_TEST(testTextFrames, "textframes.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The frames were simply missing, so let's check if all 3 frames were imported back. uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess = xDrawPageSupplier->getDrawPage(); @@ -549,6 +556,7 @@ DECLARE_OOXMLEXPORT_TEST(testMathLiteral, "math-literal.docx") DECLARE_OOXMLEXPORT_TEST(testFdo48557, "fdo48557.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Inner margins of the textframe wasn't exported. uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextLeftDistance")); @@ -784,6 +792,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66543, "fdo66543.docx") DECLARE_OOXMLEXPORT_TEST(testN822175, "n822175.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); // Was text::WrapTextMode_THROUGH, due to missing Surround handling in the exporter. CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(xFrame, "Surround")); @@ -814,6 +823,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66773, "fdo66773.docx") DECLARE_OOXMLEXPORT_TEST(testFdo58577, "fdo58577.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The second frame was simply missing, so let's check if both frames were imported back. uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess = xDrawPageSupplier->getDrawPage(); @@ -919,6 +929,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx") DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The shape had no background, no paragraph adjust and no font color. uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "FillColor")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index a1e572fed89f..5b4db5f10a86 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -94,6 +94,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92470_footnoteRestart, "tdf92470_footnoteRestart DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1),1), uno::UNO_QUERY); // OOXML has just one border attribute (<w:bdr>) for text border so all side has // the same border with the same padding @@ -770,6 +771,7 @@ DECLARE_OOXMLEXPORT_TEST(testPNGImageCrop, "test_PNG_ImageCrop.docx") DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // borderlessImage - image WITHOUT BORDERS : simulate padding with -crop text::GraphicCrop crop = getProperty<text::GraphicCrop>(getShape(2), "GraphicCrop"); CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 ); @@ -942,6 +944,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testcantSplit, "2_table_doc.docx") DECLARE_OOXMLEXPORT_TEST(testDontSplitTable, "tdf101589_dontSplitTable.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); //single row tables need to prevent split by setting row to no split CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]") ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 9e0e23b3c723..f90bc6d357d7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -67,6 +67,7 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx") DECLARE_OOXMLEXPORT_TEST(testBezier, "bezier.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws = xDrawPageSupplier->getDrawPage(); // Check that no shape got lost: a bezier, a line and a text shape. @@ -415,6 +416,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, "chart-in-footer.docx") DECLARE_OOXMLEXPORT_TEST(testNestedTextFrames, "nested-text-frames.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // First problem was LO crashed during export (crash test) // Second problem was LO made file corruption, writing out nested text boxes, which can't be handled by Word. @@ -765,6 +767,7 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, "paragraphWithComments.docx" DECLARE_OOXMLEXPORT_TEST(testTdf104707_urlComment, "tdf104707_urlComment.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); @@ -986,6 +989,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103001, "tdf103001.docx") DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) // There should be a section break that's in the middle of the document: right after the table. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 5cf517190550..7f52e3f09e12 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -112,6 +112,7 @@ DECLARE_OOXMLEXPORT_TEST(testDecimalNumberingNoLeveltext, "decimal-numbering-no- DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNoDuplicateAttributeExport, "duplicate-east-asia.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // File asserting while saving in LO. parseExport("word/document.xml"); } @@ -284,6 +285,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFloatingTable, "fdo77887.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:vMerge", "val", "restart"); @@ -294,6 +296,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeRight, "tdf90681-1.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOldComplexMergeleft, "tdf90681-2.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:vMerge", "val", "restart"); @@ -480,6 +483,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887, "fdo78887.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78887b, "missing_newline.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/w:br[1]", 1); @@ -601,6 +605,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78907,"fdo78907.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf118702,"tdf118702.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:type", "val", "nextPage" ); assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz", "orient", "landscape" ); @@ -1072,6 +1077,7 @@ DECLARE_OOXMLEXPORT_TEST(testSectionProtection, "sectionprot.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSectionProtection2, "sectionprot2.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true"); @@ -1145,6 +1151,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf89991_revisionView, "tdf89991.docx") DECLARE_OOXMLEXPORT_TEST(tdf122201_editUnprotectedText, "tdf122201_editUnprotectedText.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // get the document SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -1167,6 +1174,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf122201_editUnprotectedText, "tdf122201_editUnprotect DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) { // this test must not be zero @@ -1176,12 +1184,14 @@ DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") DECLARE_OOXMLEXPORT_TEST(testOO47778_1, "ooo47778-3.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[3]", "c"); } DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[4]", "c"); @@ -1195,24 +1205,28 @@ DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[2]", "B"); } DECLARE_OOXMLEXPORT_TEST(testKDE302504, "kde302504-1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//v:shape", "ID", "KoPathShape"); } DECLARE_OOXMLEXPORT_TEST(testKDE216114, "kde216114-1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//w:pict", 1); } DECLARE_OOXMLEXPORT_TEST(testOO72950, "ooo72950-1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml")) assertXPath(pXmlDoc, "//w:tbl", 1); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index 7e9e9dcae0c6..0ce0b3c150b3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -49,6 +49,7 @@ DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlZorder, "dml-zorder.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was "0": causing that in Word, the second shape was on top, while in the original odt the first shape is on top. assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "relativeHeight", "2"); @@ -945,6 +946,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExtentValue, "fdo74605.docx") // other dimension. DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSyncedRelativePercent, "tdf93676-1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // check no explicit pctHeight has been exported, all we care diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 572f19026653..a0e2b920dadc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -148,6 +148,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76979, "fdo76979.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104539, "tdf104539.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw", @@ -815,6 +816,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDashedLine_CustDashPercentage, "dashed_l DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCommentInitials, "comment_initials.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/comments.xml"); assertXPath(pXmlDoc,"/w:comments/w:comment[1]", "initials", "initials"); @@ -917,6 +919,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeGrayscale, "picture_colo DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeBlackWhite, "picture_colormode_black_white.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); 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"); @@ -924,6 +927,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeBlackWhite, "picture_col DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeWatermark, "picture_colormode_watermark.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml"); 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"); @@ -932,6 +936,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureColormodeWatermark, "picture_colo DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testExportShadow, "bnc637947.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1040,6 +1045,7 @@ DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTDF93675, "no-numlevel-but-indented.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//w:ind", "start", "1418"); } @@ -1048,6 +1054,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTDF93675, "no-numlevel-but-indented.odt" DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // there should be no flipH and flipV attributes in this case assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipH"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 772f4bd9dc82..526e8b6372c9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -87,6 +87,7 @@ DECLARE_OOXMLEXPORT_TEST(testN751054, "n751054.docx") DECLARE_OOXMLEXPORT_TEST(testTdf48569, "tdf48569.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // File crashing while saving in LO text::TextContentAnchorType eValue = getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"); CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, eValue); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 88e081898622..8a31375fd561 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -350,6 +350,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118812, "tdf118812_tableStyles-compre DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107626, "tdf107626.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // This was 2 (missing trailing cell in merged cell range) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc", 3); @@ -476,6 +477,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, "tdf46940_do DECLARE_OOXMLEXPORT_TEST(testTdf98700_keepWithNext, "tdf98700_keepWithNext.odt") { + CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading style keeps with next", true, getProperty<bool>(getParagraph(1), "ParaKeepTogether")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Default style doesn't keep with next", false, getProperty<bool>(getParagraph(2), "ParaKeepTogether")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 1 style inherits keeps with next", true, getProperty<bool>(getParagraph(3), "ParaKeepTogether")); @@ -892,6 +894,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx" DECLARE_OOXMLEXPORT_TEST(testTdf55427_footnote2endnote, "tdf55427_footnote2endnote.odt") { + CPPUNIT_ASSERT_EQUAL(4, getPages()); uno::Reference<beans::XPropertySet> xPageStyle(getStyles("ParagraphStyles")->getByName("Footnote"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", sal_Int32(0xFF007F), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); xPageStyle.set(getStyles("ParagraphStyles")->getByName("Endnote"), uno::UNO_QUERY); @@ -985,6 +988,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf106001_2, "tdf106001-2.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // In test ODT CharScaleWidth = 900, this was not changed upon OOXML export to stay in [1..600], now it's clamped to 600 // Note: we disregard what's set in pPr / rPr and only care about r / rPr xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1092,6 +1096,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107889, "tdf107889.docx") DECLARE_OOXMLEXPORT_TEST(testTdf107837, "tdf107837.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); // This was true, a balanced section from ODF turned into a non-balanced one after OOXML roundtrip. @@ -1100,6 +1105,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107837, "tdf107837.odt") DECLARE_OOXMLEXPORT_TEST(testTdf107684, "tdf107684.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml")) // This was 1, <w:outlineLvl> was duplicated for Heading1. assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1); @@ -1150,6 +1156,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105095, "tdf105095.docx") DECLARE_OOXMLEXPORT_TEST(testTdf106062_nonHangingFootnote, "tdf106062_nonHangingFootnote.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); @@ -1216,6 +1223,7 @@ DECLARE_OOXMLEXPORT_TEST( testActiveXCheckbox, "activex_checkbox.docx" ) DECLARE_OOXMLEXPORT_TEST(testActiveXControlAlign, "activex_control_align.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // First check box aligned as a floating object uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xControlShape.is()); @@ -1317,6 +1325,7 @@ DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark-shapetype.docx") DECLARE_OOXMLEXPORT_TEST(testActiveXControlAtRunEnd, "activex_control_at_run_end.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Two issues were here: // 1) second shape was not export (it is anchored to the end of the run) // 2) inline property was inherited to the second shape by mistake @@ -1368,6 +1377,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXOptionButtonGroup, "activex_option_button_gr DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf112169, "tdf112169.odt") { + CPPUNIT_ASSERT_EQUAL(6, getPages()); // LO crashed while export because of character background color handling //tdf76683 - Cannot be negative number - use firstLine instead of hanging @@ -1378,6 +1388,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(tdf112169, "tdf112169.odt") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103090, "tdf103090.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Get bookmark name diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 8ac7b706d1da..e23815c5b40f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -59,6 +59,7 @@ DECLARE_OOXMLEXPORT_TEST(testN789482, "n789482.docx") DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBnc834035, "bnc834035.odt") { + CPPUNIT_ASSERT_EQUAL(3, getPages()); // Illustration index had wrong hyperlinks: anchor was using Writer's // <seqname>!<index>|sequence syntax, not a bookmark name. xmlDocUniquePtr pXmlDoc = parseExport(); @@ -68,6 +69,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testBnc834035, "bnc834035.odt") DECLARE_OOXMLEXPORT_TEST(testCp1000015, "cp1000015.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // Redline and hyperlink end got exported in an incorrect order. getParagraph(1, "Hello."); getParagraph(2, "http://www.google.com/"); @@ -574,12 +576,14 @@ DECLARE_OOXMLEXPORT_TEST(testToxmarkHyperlink, "toxmarkhyperlink.fodt") DECLARE_OOXMLEXPORT_TEST(testOO34469, "ooo34469-1.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport()) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating_New_files|outline"); } DECLARE_OOXMLEXPORT_TEST(testOO39845, "ooo39845-7.odt") { + CPPUNIT_ASSERT_EQUAL(1, getPages()); if (xmlDocUniquePtr pXmlDoc = parseExport()) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "Figure4|graphic"); } @@ -637,6 +641,7 @@ DECLARE_OOXMLEXPORT_TEST( testDateFieldAtEndOfParagraph, "date_field_at_end_of_p DECLARE_OOXMLEXPORT_TEST(testDropDownFieldEntryLimit, "tdf126792.odt" ) { + CPPUNIT_ASSERT_EQUAL(1, getPages()); // In MSO, there is a limit of 25 for the items in a drop-down form field. // So we truncate the list of items to not exceed this limit. |