sw/qa/extras/htmlexport/htmlexport.cxx | 4 ++-- sw/qa/extras/odfexport/odfexport.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 26 +++++++++++++------------- sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 6 +++--- sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 6 +++--- sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 2 +- sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 6 +++--- sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 14 +++++++------- sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 2 +- sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 6 +++--- sw/qa/extras/rtfexport/rtfexport.cxx | 2 +- sw/qa/extras/rtfexport/rtfexport3.cxx | 6 +++--- sw/qa/extras/rtfexport/rtfexport4.cxx | 6 +++--- sw/qa/extras/ww8export/ww8export2.cxx | 14 +++++++------- sw/qa/extras/ww8export/ww8export3.cxx | 10 +++++----- sw/qa/inc/swmodeltestbase.hxx | 7 +++---- sw/qa/unit/swmodeltestbase.cxx | 2 +- 22 files changed, 71 insertions(+), 72 deletions(-)
New commits: commit 24c49a6e2b9f2609b060d87a4a3253803c62cc5a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Nov 8 02:01:15 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Nov 8 07:37:09 2022 +0100 swmodeltestbase: make mbExported private Change-Id: Idff0960c05f2330ce746147f0b3a2e0aa3b7c6fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142410 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 9900f4886011..3ccf3e487252 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -709,7 +709,7 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleImg, "reqif-ole-img.xhtml") // Check alternate text (it was empty, for export the 'alt' attribute was used). CPPUNIT_ASSERT_EQUAL(OUString("OLE Object"), getProperty<OUString>(xObject, "Title").trim()); - if (!mbExported) + if (!isExported()) return; // "type" attribute was missing for the inner <object> element. @@ -877,7 +877,7 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, "reqif-ole2.xhtml") // document storage, but the embedded object already opened it, so an // exception of type com.sun.star.io.IOException was thrown. - if (mbExported) + if (isExported()) { // Check that the replacement graphic is exported at RTF level. SvMemoryStream aStream; diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index ec034b7f95b7..b1df8b80f0e5 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -1813,7 +1813,7 @@ DECLARE_ODFEXPORT_TEST(testBtlrFrame, "btlr-frame.odt") CPPUNIT_ASSERT(pFlyFrame); CPPUNIT_ASSERT(pFlyFrame->IsVertLRBT()); - if (!mbExported) + if (!isExported()) // Not yet exported, don't modify the doc model for test purposes. return; @@ -2321,7 +2321,7 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt") // This was image/x-vclgraphic, not exposing the info that the image is a PDF one. CPPUNIT_ASSERT_EQUAL(OUString("application/pdf"), getProperty<OUString>(xGraphic, "MimeType")); - if (mbExported) + if (isExported()) { uno::Sequence<uno::Any> aArgs{ uno::Any(maTempFile.GetURL()) }; uno::Reference<container::XNameAccess> xNameAccess(m_xSFactory->createInstanceWithArguments("com.sun.star.packages.zip.ZipFileAccess", aArgs), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 468b60dee8c1..bf3bf059e8fc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -295,7 +295,7 @@ DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, "dropdown-in-cell.docx") uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xCell, uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextRangeCompare->compareRegionStarts(xAnchor, xCell)); } - else if (!mbExported) + else if (!isExported()) { // ComboBox was imported as DropDown text field uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -925,7 +925,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97090, "tdf97090.docx") DECLARE_OOXMLEXPORT_TEST(testTdf89791, "tdf89791.docx") { - if (mbExported) + if (isExported()) { uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("docProps/custom.xml"))); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index dc5ee0a72783..a78ddcb9c578 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -1243,7 +1243,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableMarginAdjustment) DECLARE_OOXMLEXPORT_TEST(testTdf119760_tableInTablePosition, "tdf119760_tableInTablePosition.docx") { - if ( mbExported ) + if ( isExported() ) { xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); @@ -1412,7 +1412,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105875_VmlShapeRotationWithFlip, "tdf105875_VmlS { // tdf#105875: check whether the rotation of the VML bezier shape is ok (with flip too) // TODO: fix export too - if (mbExported) + if (isExported()) return; { diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 7bead3a2bb1f..67ebd4f569d7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -674,7 +674,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx") // page 1 header: 1 paragraph, 2 flys, 1 draw object assertXPath(pXmlDoc, "/root/page[1]/header/txt", 1); assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/fly", 2); - if (mbExported) // somehow there's an additional shape on re-import? + if (isExported()) // somehow there's an additional shape on re-import? assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 2); else assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 1); @@ -1144,7 +1144,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf80526_word_wrap, "tdf80526_word_wrap.docx") { // tdf#80526: check whether the "wrap" property has been set // TODO: fix export too - if (mbExported) + if (isExported()) return; uno::Reference<drawing::XShape> xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xShape, "TextWordWrap")); @@ -1210,7 +1210,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf145720, "tdf104797.docx") { // check moveFromRangeStart/End and moveToRangeStart/End (to keep tracked text moving) xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - if (mbExported) + if (isExported()) { // These were 0 (missing move*FromRange* elements) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", 1); @@ -1242,7 +1242,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf150166, "tdf150166.docx") { // check moveFromRangeStart/End and moveToRangeStart/End (to keep tracked text moving) xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - if (mbExported) + if (isExported()) { assertXPath(pXmlDoc, "//w:moveFromRangeStart", 0); // This was 2 (missing RangeStart elements, but bad unpaired RangeEnds) @@ -1263,7 +1263,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510, "TC-table-DnD-move.docx") { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table move by drag & drop xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - if (mbExported) + if (isExported()) { // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 2); @@ -1275,7 +1275,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510_table_from_row, "TC-table-Separate-Move.d { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table move by drag & drop xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - if (mbExported) + if (isExported()) { // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 1); @@ -1289,7 +1289,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510_within_table, "TC-table-rowDND.docx") { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table row move by DnD xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - if (mbExported) + if (isExported()) { // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:del", 1); @@ -1301,7 +1301,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510_within_table2, "TC-table-rowDND-front.doc { // check moveFromRangeStart/End and moveToRangeStart/End for tracked table row move by DnD xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - if (mbExported) + if (isExported()) { // This was 0 (missing tracked table row deletion/insertion) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1); @@ -1512,7 +1512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132271) loadAndSave("tdf149388.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // import change tracking in floating tables - if (!mbExported) + if (!isExported()) { assertXPath(pXmlDoc, "//w:del", 2); assertXPath(pXmlDoc, "//w:ins", 2); @@ -1547,7 +1547,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136667) loadAndSave("tdf149388_fly.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // import change tracking in floating tables - if (!mbExported) + if (!isExported()) { assertXPath(pXmlDoc, "//w:del", 2); assertXPath(pXmlDoc, "//w:ins", 4); @@ -1782,7 +1782,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81100) assertXPath(pDump, "/root/page[2]/body/tab[1]", 1); assertXPath(pDump, "/root/page[2]/body/tab[1]/row", 2); assertXPath(pDump, "/root/page[3]/body/tab", 1); - if (!mbExported) // TODO export tblHeader=false + if (!isExported()) // TODO export tblHeader=false assertXPath(pDump, "/root/page[3]/body/tab/row", 1); } @@ -2142,7 +2142,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargi CPPUNIT_ASSERT(lcl_nearEqual(nTopHFly, 851)); // this seems to be an import bug - if (!mbExported) + if (!isExported()) CPPUNIT_ASSERT(lcl_nearEqual(nTopFFly, 14403)); CPPUNIT_ASSERT(lcl_nearEqual(nHeightHead, 567)); @@ -2153,7 +2153,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargi // after export these heights increase to like 567. // not sure if it is another import, or export bug... or just the result of the modified document - if (!mbExported) + if (!isExported()) { CPPUNIT_ASSERT(lcl_nearEqual(nHeightHFlyBound, 57)); CPPUNIT_ASSERT(lcl_nearEqual(nHeightFFlyBound, 57)); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 0b7953bcb54e..71998af86753 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -582,7 +582,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, "para-adjust-distribute.docx" CPPUNIT_TEST_FIXTURE(Test, testInputListExport) { loadAndReload("tdf122186_input_list.odt"); - if (!mbExported) // importing the ODT, an input field + if (!isExported()) // importing the ODT, an input field { uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -759,7 +759,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123460, "tdf123460.docx") xRun.set(xRunEnum->nextElement(), uno::UNO_QUERY); CPPUNIT_ASSERT(hasProperty(xRun, "Bookmark")); // deleted paragraph mark at the end of the second paragraph - if (mbExported) + if (isExported()) { // there is no run after the MoveBookmark CPPUNIT_ASSERT(!xRunEnum->hasMoreElements()); @@ -822,7 +822,7 @@ DECLARE_OOXMLEXPORT_TEST(testTbrlFrameVml, "tbrl-frame-vml.docx") uno::Reference<beans::XPropertySet> xTextFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xTextFrame.is()); - if (mbExported) + if (isExported()) { // DML import: creates a TextBox, eaVert read back as TB_RL in TextWritingMode diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 41b580a5f978..b53a2f891892 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -760,7 +760,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149421, "tdf121661.docx") // This was false CPPUNIT_ASSERT_GREATER( static_cast<sal_Int16>(0), getProperty<sal_Int16>(xStyle, "ParaHyphenationZone")); - if (!mbExported) + if (!isExported()) { CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int16>(851), getProperty<sal_Int16>(xStyle, "ParaHyphenationZone")); // modify hyphenation zone (note: only hyphenation zone set in Standard paragraph style @@ -1312,7 +1312,7 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header- // i.e. both the header and the footer on page 3 was wrong. // Additional problem: top margin on page 3 was wrong. - if (mbExported) + if (isExported()) { xmlDocUniquePtr pXml = parseExport("word/document.xml"); // Without the accompanying fix in place, this test would have failed with: @@ -1457,7 +1457,7 @@ DECLARE_OOXMLEXPORT_TEST(testVmlShapeTextWordWrap, "tdf97618_testVmlShapeTextWor { // tdf#97618 The text wrapping of a shape was not handled in a canvas. // TODO: fix export too - if (mbExported) + if (isExported()) return; xmlDocUniquePtr pXmlDoc = parseLayoutDump(); if (!pXmlDoc) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 7d276d15bfd9..696bfa303b99 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -910,7 +910,7 @@ DECLARE_OOXMLEXPORT_TEST(testCommentDoneModel, "CommentDone.docx") css::uno::Any aComment = xFields->nextElement(); css::uno::Reference<css::beans::XPropertySet> xComment(aComment, css::uno::UNO_QUERY_THROW); - if (!mbExported) + if (!isExported()) { // Check that it's resolved when initially read CPPUNIT_ASSERT_EQUAL(true, xComment->getPropertyValue("Resolved").get<bool>()); @@ -928,7 +928,7 @@ DECLARE_OOXMLEXPORT_TEST(testCommentDoneModel, "CommentDone.docx") aComment = xFields->nextElement(); xComment.set(aComment, css::uno::UNO_QUERY_THROW); - if (!mbExported) + if (!isExported()) { // Check that it's unresolved when initially read CPPUNIT_ASSERT_EQUAL(false, xComment->getPropertyValue("Resolved").get<bool>()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 3ab402f7ba74..63f845908310 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -94,7 +94,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148380_fldLocked, "tdf148380_fldLocked.docx") // Verify that these are fields, and not just plain text // (import only, since export thankfully just dumps these fixed fields as plain text - if (mbExported) + if (isExported()) return; uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); auto xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -674,7 +674,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123642_BookmarkAtDocEnd, "tdf123642.docx") DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx") { - if (mbExported) + if (isExported()) { // Block SDT is turned into run SDT on export, so the next import will have this as content // control, not as a field. diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 7103bf762c28..01d3992285ee 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -63,7 +63,7 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx") // width 8.61cm and 325px in UI in Word and rounds down to 8609 Hmm. Considering scaling of the // parent group to the anchor extent (* 3118485 / 3108960) we get a display width of 3108960 EMU // = 8636Hmm. FIXME: Expected value is as in LO 7.2. Reason for difference is yet unknown. - if (mbExported) + if (isExported()) { uno::Reference<drawing::XShape> xYear(xGroup->getByIndex(1), uno::UNO_QUERY); // This was 2, due to incorrect handling of parent transformations inside DML groupshapes. diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 4e3812960d90..b84571c8e9c5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -152,7 +152,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyUnProtected, "tdf120852_readOnlyU uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY_THROW); const sal_Int32 nLastSection = xSections->getCount() - 1; uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(nLastSection), uno::UNO_QUERY_THROW); - if ( !mbExported ) + if ( !isExported() ) { CPPUNIT_ASSERT_MESSAGE("Section is not protected", !getProperty<bool>(xSect, "IsProtected")); // Enable section protection. The round-trip should have forms protection enabled. @@ -808,7 +808,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128646) xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:pPr/w:rPr/w:vanish", 1); - if (!mbExported) + if (!isExported()) // originally no <w:vanish> (the same as <w:vanish val="false">) assertXPath(pXmlDoc,"/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish", 0); else @@ -824,7 +824,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119800) xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:vanish", 1); - if (!mbExported) + if (!isExported()) // originally no <w:vanish> (the same as <w:vanish val="false">) assertXPath(pXmlDoc,"/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish", 0); else diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index 13245f6f22fc..d57f65fa8dec 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -260,10 +260,10 @@ DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillBitmapCrop, "dml-shape-fillbitmapcrop.d // 1st shape has some cropping text::GraphicCrop aGraphicCropStruct = getProperty<text::GraphicCrop>(getShape(1), "GraphicCrop"); - CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? 454 : 455 ), aGraphicCropStruct.Left ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? 367 : 368 ), aGraphicCropStruct.Right ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? -454 : -455 ), aGraphicCropStruct.Top ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(mbExported ? -367 : -368 ), aGraphicCropStruct.Bottom ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(isExported() ? 454 : 455 ), aGraphicCropStruct.Left ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(isExported() ? 367 : 368 ), aGraphicCropStruct.Right ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(isExported() ? -454 : -455 ), aGraphicCropStruct.Top ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(isExported() ? -367 : -368 ), aGraphicCropStruct.Bottom ); // 2nd shape has no cropping aGraphicCropStruct = getProperty<text::GraphicCrop>(getShape(2), "GraphicCrop"); @@ -369,7 +369,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeChildPosition, "dml-groupshape-childpo xChildGroup.set(xGroup->getByIndex(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(-2123), xChildGroup->getPosition().X); - CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 14023 : 14021), xChildGroup->getPosition().Y); + CPPUNIT_ASSERT_EQUAL(sal_Int32(isExported() ? 14023 : 14021), xChildGroup->getPosition().Y); } CPPUNIT_TEST_FIXTURE(Test, testDMLGradientFillTheme) @@ -466,7 +466,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloatingMargins, "table-floating-margins.docx" CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xFrame, "TopMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), getProperty<sal_Int32>(xFrame, "BottomMargin")); - if (!mbExported) + if (!isExported()) return; // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table. xmlDocUniquePtr pXmlDoc = parseExport(); @@ -1036,7 +1036,7 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAlignmentFromTopMargin, // tdf#133045 These shapes are relatively aligned from top margin, vertically to // top, center and bottom. - if (mbExported) + if (isExported()) return; xmlDocUniquePtr pXmlDoc = parseLayoutDump(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 50c98590e765..5ee39c6b5e13 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -999,7 +999,7 @@ DECLARE_OOXMLEXPORT_TEST(testN820509, "n820509.docx") // M.d.yyyy date format was unhandled. SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); - if (mbExported) + if (isExported()) { uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 043b15a99673..66d6e97ce74f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -500,7 +500,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth, "tdf97648_relativeWidth.doc CPPUNIT_ASSERT_EQUAL( sal_Int32(0), getProperty<sal_Int32>(getShape(1), "LeftMargin") ); - if (!mbExported) + if (!isExported()) { CPPUNIT_ASSERT_EQUAL_MESSAGE("Text should wrap above/below the line", text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(getShape(1), "Surround")); CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(2), "HoriOrient")); @@ -977,7 +977,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote) xEndnotes->getByIndex(0) >>= xEndnoteText; // ODT footnote-at-document-end's closest DOCX match is an endnote, so the two imports will not exactly match by design. - if (!mbExported) + if (!isExported()) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote count", sal_Int32(5), xFootnotes->getCount() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote count", sal_Int32(1), xEndnotes->getCount() ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 59de586a9b1e..3e17f449c4fd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66401) DECLARE_OOXMLEXPORT_TEST( testDateFieldInShape, "date_field_in_shape.docx" ) { // This was crashed on export. - if (mbExported) + if (isExported()) { uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); uno::Reference<text::XText> xShapeText = xShape->getText(); @@ -730,7 +730,7 @@ DECLARE_OOXMLEXPORT_TEST( testDateFieldInShape, "date_field_in_shape.docx" ) DECLARE_OOXMLEXPORT_TEST( testDateFieldAtEndOfParagraph, "date_field_at_end_of_paragraph.docx" ) { // Additional line end was added by import and it was crashed on export - if (mbExported) + if (isExported()) { uno::Reference<beans::XPropertySet> xTextPortion(getRun(getParagraph(2), 1), uno::UNO_QUERY); OUString aPortionType; @@ -786,7 +786,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDropDownFieldEntryLimit) CPPUNIT_ASSERT(bool(pListEntries != pParameters->end())); css::uno::Sequence<OUString> vListEntries; pListEntries->second >>= vListEntries; - if (!mbExported) + if (!isExported()) CPPUNIT_ASSERT_EQUAL(sal_Int32(26), vListEntries.getLength()); else CPPUNIT_ASSERT_EQUAL(sal_Int32(25), vListEntries.getLength()); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 49dd8b811a7a..dc34e15ca953 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -1261,7 +1261,7 @@ DECLARE_RTFEXPORT_TEST(testTdf98806, "tdf98806.rtf") DECLARE_RTFEXPORT_TEST(testTdf61901, "tdf61901.rtf") { // Test the file directly, as current RTF import gives the correct font name with and without the fix. - if (mbExported) + if (isExported()) { SvStream* pStream = maTempFile.GetStream(StreamMode::READ); OString sLine; diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 6297966bae1b..8b263bff1b8e 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -124,12 +124,12 @@ DECLARE_RTFEXPORT_TEST(testTdf116436_tableBackground, "tdf116436_tableBackground uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); - if (mbExported) + if (isExported()) CPPUNIT_ASSERT_EQUAL(Color(0xF8DF7C), getProperty<Color>(xCell, "BackColor")); xCell.set(xTable->getCellByName("A6")); CPPUNIT_ASSERT_EQUAL(Color(0x81D41A), getProperty<Color>(xCell, "BackColor")); xCell.set(xTable->getCellByName("B6")); - if (mbExported) + if (isExported()) CPPUNIT_ASSERT_EQUAL(Color(0xFFFBCC), getProperty<Color>(xCell, "BackColor")); } @@ -260,7 +260,7 @@ DECLARE_RTFEXPORT_TEST(testTdf117505, "tdf117505.odt") DECLARE_RTFEXPORT_TEST(testTdf112520, "tdf112520.docx") { - if (!mbExported) + if (!isExported()) return; // Assert that the white shape is on top of the yellow one. diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 62175994c4a6..6cbda01af917 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -244,7 +244,7 @@ DECLARE_RTFEXPORT_TEST(testAnchoredAtSamePosition, "anchor.fodt") CPPUNIT_ASSERT_EQUAL(OUString("foobar"), getParagraph(1)->getString()); SwFrameFormats& rFlys(*pDoc->GetSpzFrameFormats()); - if (mbExported) + if (isExported()) { // 2, not 3: the form control becomes a field on export... CPPUNIT_ASSERT_EQUAL(size_t(2), rFlys.size()); } @@ -253,7 +253,7 @@ DECLARE_RTFEXPORT_TEST(testAnchoredAtSamePosition, "anchor.fodt") CPPUNIT_ASSERT_EQUAL(size_t(3), rFlys.size()); } - sal_Int32 const nIndex(mbExported ? 4 : 3); + sal_Int32 const nIndex(isExported() ? 4 : 3); CPPUNIT_ASSERT_EQUAL(RndStdIds::FLY_AT_CHAR, rFlys[0]->GetAnchor().GetAnchorId()); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(12), rFlys[0]->GetAnchor().GetContentAnchor()->GetNodeIndex()); @@ -487,7 +487,7 @@ DECLARE_RTFEXPORT_TEST(testTdf129522_removeShadowStyle, "tdf129522_removeShadowS table::BorderLine2 aBorderLine = getProperty<table::BorderLine2>(xRun, "CharRightBorder"); // MS formats can't have a shadow without a border. // Char borders are all or none, so have to decide to add borders, or throw away shadow... - if (mbExported) + if (isExported()) CPPUNIT_ASSERT(sal_uInt32(0) != aBorderLine.LineWidth); xRun.set(getRun(getParagraph(4), 2, "shadow")); diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 19646f03d5f9..2c013dee2ea3 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -152,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote) xEndnotes->getByIndex(0) >>= xEndnoteText; // ODT footnote-at-document-end's closest DOC match is an endnote, so the two imports will not exactly match by design. - if (!mbExported) + if (!isExported()) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote count", sal_Int32(5), xFootnotes->getCount() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote count", sal_Int32(1), xEndnotes->getCount() ); @@ -291,7 +291,7 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_marginRTL, "tdf80635_marginRightRTL.doc") 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); - if ( !mbExported ) + if ( !isExported() ) CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient")); } @@ -516,7 +516,7 @@ CPPUNIT_TEST_FIXTURE(Test, testActiveXCheckbox) CPPUNIT_ASSERT_EQUAL(1, getPages()); // First check box anchored as a floating object uno::Reference<drawing::XControlShape> xControlShape; - if(!mbExported) + if(!isExported()) xControlShape.set(getShape(1), uno::UNO_QUERY); else xControlShape.set(getShape(2), uno::UNO_QUERY); @@ -533,7 +533,7 @@ CPPUNIT_TEST_FIXTURE(Test, testActiveXCheckbox) CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty<text::TextContentAnchorType>(xPropertySet2,"AnchorType")); // Second check box anchored inline / as character - if(!mbExported) + if(!isExported()) xControlShape.set(getShape(2), uno::UNO_QUERY); else xControlShape.set(getShape(1), uno::UNO_QUERY); @@ -587,7 +587,7 @@ 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) + if (!isExported()) return; // Check whether we have all the necessary bookmarks exported and imported back @@ -747,7 +747,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCrossReferenceCustomFormat) CPPUNIT_ASSERT_EQUAL(1, getPages()); // tdf#42346: Cross references to tables were not saved // Check also captions with custom formatting - if (!mbExported) + if (!isExported()) return; // Check whether we have all the necessary bookmarks exported and imported back @@ -864,7 +864,7 @@ 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) + if (!isExported()) return; // Check whether we have all the necessary bookmarks exported and imported back diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index c2efc6d41c1c..6b9a687a0ea0 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -133,7 +133,7 @@ DECLARE_WW8EXPORT_TEST(testTdf148380_fldLocked, "tdf148380_fldLocked.doc") // Verify that these are fields, and not just plain text // (import only, since export thankfully just dumps these fixed fields as plain text - if (mbExported) + if (isExported()) return; uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); auto xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -217,7 +217,7 @@ DECLARE_WW8EXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.doc") DECLARE_WW8EXPORT_TEST(testTdf128501, "tdf128501.doc") { - if (!mbExported) + if (!isExported()) { uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor = getShape(1); CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), xShapeDescriptor->getShapeType()); @@ -807,7 +807,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame) loadAndReload("btlr-frame.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); - if (!mbExported) + if (!isExported()) { return; } @@ -962,10 +962,10 @@ DECLARE_WW8EXPORT_TEST(testTdf104239_chapterNumberTortureTest, "tdf104239_chapte CPPUNIT_ASSERT_EQUAL(OUString("2nd.ii"), getProperty<OUString>(xPara, "ListLabelString")); CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); // Level 2 xPara.set(getParagraph(9, "outline with Body listLvl(9)."), uno::UNO_QUERY); - if (!mbExported) + if (!isExported()) CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString")); xPara.set(getParagraph(10, "outline with Body listLvl(9) #2."), uno::UNO_QUERY); - if (!mbExported) + if (!isExported()) CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString")); xPara.set(getParagraph(11, "direct formatting - Body listLvl(9)."), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString")); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 3991cb56f511..b5577fa52cac 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -100,6 +100,7 @@ private: OUString maImportFilterOptions; OUString maImportFilterName; const OUString mpTestDocumentPath; + bool mbExported; ///< Does maTempFile already contain something useful? protected: css::uno::Reference< css::lang::XComponent > mxComponent; @@ -112,11 +113,8 @@ protected: sal_uInt32 mnStartTime; utl::TempFileNamed maTempFile; SvMemoryStream maMemory; ///< Underlying memory for parsed PDF files. - bool mbExported; ///< Does maTempFile already contain something useful? bool mbFontNameWYSIWYG; -protected: - virtual OUString getTestName() { return OUString(); } /// Copy&paste helper. @@ -217,7 +215,6 @@ protected: return false; } -protected: void dumpLayout(const css::uno::Reference< css::lang::XComponent > & rComponent); void discardDumpedLayout(); @@ -410,6 +407,8 @@ protected: * parse it. */ void WrapReqifFromTempFile(SvMemoryStream& rStream); + + bool isExported(){ return mbExported; } }; /** diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 14376aa6af25..8e422bd3aef0 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -56,10 +56,10 @@ void SwModelTestBase::paste(std::u16string_view aFilename, SwModelTestBase::SwModelTestBase(const OUString& pTestDocumentPath, const char* pFilter) : mpTestDocumentPath(pTestDocumentPath) + , mbExported(false) , mpXmlBuffer(nullptr) , mpFilter(pFilter) , mnStartTime(0) - , mbExported(false) , mbFontNameWYSIWYG(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get()) { maTempFile.EnableKillingFile();