From c44f64621fe11d6a46c79b9793c7c67c60bb66e8 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 4 Nov 2022 10:45:08 +0100 Subject: SwModelTestBase: make mpTestDocumentPath private in preparation for future inheritance from UnoApiTest Change-Id: Ie5dee5af3609d8490d7d7bad0d6dbc4c8fc17bb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142280 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- .../accessibilitycheck/AccessibilityCheckTest.cxx | 31 +-- sw/qa/core/attr/attr.cxx | 9 +- sw/qa/core/crsr/crsr.cxx | 9 +- sw/qa/core/doc/doc.cxx | 23 +- sw/qa/core/docnode/docnode.cxx | 11 +- sw/qa/core/draw/draw.cxx | 28 +-- sw/qa/core/edit/edit.cxx | 9 +- sw/qa/core/fields/fields.cxx | 11 +- sw/qa/core/frmedt/frmedt.cxx | 11 +- sw/qa/core/layout/layout.cxx | 58 ++--- sw/qa/core/objectpositioning/objectpositioning.cxx | 15 +- sw/qa/core/text/text.cxx | 36 +-- sw/qa/core/txtnode/txtnode.cxx | 17 +- sw/qa/core/undo/undo.cxx | 13 +- sw/qa/core/unocore/unocore.cxx | 20 +- sw/qa/core/view/view.cxx | 9 +- sw/qa/extras/htmlexport/htmlexport.cxx | 67 ++---- sw/qa/extras/htmlimport/htmlimport.cxx | 51 ++-- sw/qa/extras/indexing/IndexingExportTest.cxx | 16 +- sw/qa/extras/indexing/SearchResultLocatorTest.cxx | 10 +- sw/qa/extras/layout/layout.cxx | 265 +++++++++------------ sw/qa/extras/layout/layout2.cxx | 204 ++++++++-------- sw/qa/extras/mailmerge/mailmerge.cxx | 6 +- sw/qa/extras/mailmerge/mailmerge2.cxx | 6 +- sw/qa/extras/odfexport/odfexport.cxx | 2 +- sw/qa/extras/odfexport/odfexport2.cxx | 4 +- sw/qa/extras/odfimport/odffeatures.cxx | 16 +- sw/qa/extras/odfimport/odfimport.cxx | 161 ++++++------- sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 2 +- sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 32 ++- sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 4 +- sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 16 +- sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 8 +- sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 10 +- sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 4 +- sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 13 +- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 191 ++++++++------- sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 102 ++++---- sw/qa/extras/rtfexport/rtfexport.cxx | 2 +- sw/qa/extras/rtfexport/rtfexport2.cxx | 12 +- sw/qa/extras/rtfexport/rtfexport3.cxx | 4 +- sw/qa/extras/rtfexport/rtfexport4.cxx | 12 +- sw/qa/extras/rtfexport/rtfexport5.cxx | 8 +- sw/qa/extras/rtfimport/rtfimport.cxx | 191 ++++++++------- sw/qa/extras/tiledrendering/tiledrendering.cxx | 7 +- sw/qa/extras/txtimport/txtimport.cxx | 16 +- .../data/floating_table/small_floating_table.odt | Bin 8977 -> 0 bytes .../floating_table/unfloatable_floating_table.doc | Bin 69120 -> 0 bytes .../floating_table/unfloatable_floating_table.docx | Bin 14282 -> 0 bytes .../floating_table/unfloatable_floating_table.odt | Bin 9331 -> 0 bytes .../unfloatable_small_floating_table.docx | Bin 13381 -> 0 bytes .../extras/uiwriter/data/small_floating_table.odt | Bin 0 -> 8977 bytes .../uiwriter/data/unfloatable_floating_table.doc | Bin 0 -> 69120 bytes .../uiwriter/data/unfloatable_floating_table.docx | Bin 0 -> 14282 bytes .../uiwriter/data/unfloatable_floating_table.odt | Bin 0 -> 9331 bytes .../data/unfloatable_small_floating_table.docx | Bin 0 -> 13381 bytes sw/qa/extras/uiwriter/uiwriter.cxx | 59 ++--- sw/qa/extras/uiwriter/uiwriter2.cxx | 118 +++++---- sw/qa/extras/uiwriter/uiwriter3.cxx | 140 +++++------ sw/qa/extras/uiwriter/uiwriter4.cxx | 90 +++---- sw/qa/extras/uiwriter/uiwriter5.cxx | 127 +++++----- sw/qa/extras/uiwriter/uiwriter6.cxx | 113 ++++----- sw/qa/extras/uiwriter/uiwriter7.cxx | 48 ++-- sw/qa/extras/uiwriter/uiwriter8.cxx | 84 +++---- sw/qa/extras/unowriter/unowriter.cxx | 35 ++- sw/qa/extras/ww8export/ww8export.cxx | 2 +- sw/qa/extras/ww8export/ww8export3.cxx | 6 +- sw/qa/extras/ww8import/ww8import.cxx | 28 +-- sw/qa/filter/html/html.cxx | 6 +- sw/qa/filter/ww8/ww8.cxx | 9 +- sw/qa/inc/swmodeltestbase.hxx | 23 +- sw/qa/uibase/frmdlg/frmdlg.cxx | 12 +- sw/qa/uibase/shells/shells.cxx | 11 +- sw/qa/uibase/uiview/uiview.cxx | 19 +- sw/qa/uibase/uno/uno.cxx | 9 +- sw/qa/unit/swmodeltestbase.cxx | 28 +-- 76 files changed, 1332 insertions(+), 1387 deletions(-) delete mode 100644 sw/qa/extras/uiwriter/data/floating_table/small_floating_table.odt delete mode 100644 sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.doc delete mode 100644 sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.docx delete mode 100644 sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.odt delete mode 100644 sw/qa/extras/uiwriter/data/floating_table/unfloatable_small_floating_table.docx create mode 100644 sw/qa/extras/uiwriter/data/small_floating_table.odt create mode 100644 sw/qa/extras/uiwriter/data/unfloatable_floating_table.doc create mode 100644 sw/qa/extras/uiwriter/data/unfloatable_floating_table.docx create mode 100644 sw/qa/extras/uiwriter/data/unfloatable_floating_table.odt create mode 100644 sw/qa/extras/uiwriter/data/unfloatable_small_floating_table.docx diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx index b7561ad01764..cc8b3742be74 100644 --- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx +++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx @@ -10,15 +10,18 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/accessibilitycheck/data/"; - class AccessibilityCheckTest : public SwModelTestBase { +public: + AccessibilityCheckTest() + : SwModelTestBase("/sw/qa/core/accessibilitycheck/data/") + { + } }; CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckDocumentIssues) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "DocumentTest.odt"); + SwDoc* pDoc = createSwDoc("DocumentTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -30,7 +33,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckDocumentIssues) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testTableSplitMergeAndAltText) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "AccessibilityTests1.odt"); + SwDoc* pDoc = createSwDoc("AccessibilityTests1.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -50,7 +53,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckParagraphIssues) { // Tests whether formatting issues are detected when the whole paragraph has them instead of // some text inside the paragraph - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "ParagraphTest.odt"); + SwDoc* pDoc = createSwDoc("ParagraphTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -61,7 +64,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckParagraphIssues) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckBackgroundImage) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "BackgroundImageTest.odt"); + SwDoc* pDoc = createSwDoc("BackgroundImageTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -72,7 +75,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckBackgroundImage) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckNewlineSpace) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "NewlineTest.odt"); + SwDoc* pDoc = createSwDoc("NewlineTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -84,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckNewlineSpace) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckSpacebarSpace) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "SpaceTest.odt"); + SwDoc* pDoc = createSwDoc("SpaceTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -95,7 +98,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckSpacebarSpace) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testHyperlinks) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HyperlinkTest.odt"); + SwDoc* pDoc = createSwDoc("HyperlinkTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -107,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testHyperlinks) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckHighlightedText) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HighlightTest.odt"); + SwDoc* pDoc = createSwDoc("HighlightTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -118,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckHighlightedText) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testNumberingCheck) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "AccessibilityTests_NumberingCheck.odt"); + SwDoc* pDoc = createSwDoc("AccessibilityTests_NumberingCheck.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -133,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testNumberingCheck) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckFakeFootnote) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "FakeFootnoteTest.odt"); + SwDoc* pDoc = createSwDoc("FakeFootnoteTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -145,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckFakeFootnote) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckFakeCaption) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "FakeCaptionTest.odt"); + SwDoc* pDoc = createSwDoc("FakeCaptionTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); @@ -156,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckFakeCaption) CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckTableFormatting) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TableFormattingTest.odt"); + SwDoc* pDoc = createSwDoc("TableFormattingTest.odt"); CPPUNIT_ASSERT(pDoc); sw::AccessibilityCheck aCheck(pDoc); aCheck.check(); diff --git a/sw/qa/core/attr/attr.cxx b/sw/qa/core/attr/attr.cxx index 0df9d9ef0451..0b60c1424092 100644 --- a/sw/qa/core/attr/attr.cxx +++ b/sw/qa/core/attr/attr.cxx @@ -15,17 +15,20 @@ namespace { -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/attr/data/"; - /// Covers sw/source/core/attr/ fixes. class Test : public SwModelTestBase { +public: + Test() + : SwModelTestBase("/sw/qa/core/attr/data/") + { + } }; CPPUNIT_TEST_FIXTURE(Test, testSwAttrSet) { // Given a document with track changes and the whole document is selected: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "attr-set.docx"); + SwDoc* pDoc = createSwDoc("attr-set.docx"); SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); dispatchCommand(mxComponent, ".uno:SelectAll", {}); diff --git a/sw/qa/core/crsr/crsr.cxx b/sw/qa/core/crsr/crsr.cxx index eba0ac114b47..eec0f9a42c31 100644 --- a/sw/qa/core/crsr/crsr.cxx +++ b/sw/qa/core/crsr/crsr.cxx @@ -27,11 +27,14 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/crsr/data/"; - /// Covers sw/source/core/crsr/ fixes. class SwCoreCrsrTest : public SwModelTestBase { +public: + SwCoreCrsrTest() + : SwModelTestBase("/sw/qa/core/crsr/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testFindReplace) @@ -87,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testFindReplace) CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testSelAllStartsWithTable) { - load(DATA_DIRECTORY, "sel-all-starts-with-table.odt"); + load("sel-all-starts-with-table.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); SwDoc* pDoc = pDocShell->GetDoc(); diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx index 4a7324e7905f..67523084d9f7 100644 --- a/sw/qa/core/doc/doc.cxx +++ b/sw/qa/core/doc/doc.cxx @@ -36,11 +36,14 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/doc/data/"; - /// Covers sw/source/core/doc/ fixes. class SwCoreDocTest : public SwModelTestBase { +public: + SwCoreDocTest() + : SwModelTestBase("/sw/qa/core/doc/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testMathInsertAnchorType) @@ -69,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testMathInsertAnchorType) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextboxTextRotateAngle) { // Check the writing direction of the only TextFrame in the document. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "textbox-textrotateangle.odt"); + SwDoc* pDoc = createSwDoc("textbox-textrotateangle.odt"); SwFrameFormats& rFrameFormats = *pDoc->GetSpzFrameFormats(); CPPUNIT_ASSERT_EQUAL(static_cast(2), rFrameFormats.size()); CPPUNIT_ASSERT_EQUAL(o3tl::narrowing(RES_DRAWFRMFMT), rFrameFormats[0]->Which()); @@ -87,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextboxTextRotateAngle) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testNumDownIndent) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "num-down-indent.docx"); + SwDoc* pDoc = createSwDoc("num-down-indent.docx"); SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); pWrtShell->Down(/*bSelect=*/false); @@ -106,7 +109,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testNumDownIndent) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testLocaleIndependentTemplate) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "locale-independent-template.odt"); + SwDoc* pDoc = createSwDoc("locale-independent-template.odt"); SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); SfxItemSet aSet(pWrtShell->GetAttrPool(), svl::Items); @@ -126,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testLocaleIndependentTemplate) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextBoxZOrder) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "textbox-zorder.docx"); + SwDoc* pDoc = createSwDoc("textbox-zorder.docx"); SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats(); CPPUNIT_ASSERT_EQUAL(static_cast(3), rFormats.size()); const SwFrameFormat* pEllipse = rFormats[2]; @@ -143,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextBoxZOrder) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextBoxMakeFlyFrame) { // Given a document with an as-char textbox (as-char draw format + at-char fly format): - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "textbox-makeflyframe.docx"); + SwDoc* pDoc = createSwDoc("textbox-makeflyframe.docx"); // When cutting the textbox and pasting it to a new document: SwView* pView = pDoc->GetDocShell()->GetView(); @@ -262,7 +265,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testContentControlDelete) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testCopyBookmarks) { // Given a document with a bookmark in a header that is linked later: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "copy-bookmarks.docx"); + SwDoc* pDoc = createSwDoc("copy-bookmarks.docx"); // When checking the # of non-copy bookmarks in the resulting doc model: sal_Int32 nActual = 0; @@ -417,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testBookmarkDeleteListeners) CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testBookmarkDeleteRedline) { // Given a document with redlines, a mark (annotation mark) inside a redline: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "bookmark-delete-redline.doc"); + SwDoc* pDoc = createSwDoc("bookmark-delete-redline.doc"); // When hiding deletions / showing only inserts, make sure we don't crash: // Without the accompanying fix in place, this test would have crashed, equal_range() was used @@ -432,7 +435,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testHeaderFooterDelete) // Then make sure that we don't crash: // Without the accompanying fix in place, this test would have crashed, an invalidated iterator // was used in sw::mark::MarkManager::deleteMarks(). - createSwDoc(DATA_DIRECTORY, "header-footer-delete.docx"); + createSwDoc("header-footer-delete.docx"); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/core/docnode/docnode.cxx b/sw/qa/core/docnode/docnode.cxx index 4967b95d955d..12363e756f12 100644 --- a/sw/qa/core/docnode/docnode.cxx +++ b/sw/qa/core/docnode/docnode.cxx @@ -14,18 +14,21 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/docnode/data/"; - /// Covers sw/source/core/docnode/ fixes. class Test : public SwModelTestBase { +public: + Test() + : SwModelTestBase("/sw/qa/core/docnode/data/") + { + } }; CPPUNIT_TEST_FIXTURE(Test, testRedlineEndsBeforeToC) { // Load a document where a delete redline ends right before a ToC, then redlines are hidden at a // layout level. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "redline-ends-before-toc.docx"); + SwDoc* pDoc = createSwDoc("redline-ends-before-toc.docx"); const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); // Without the accompanying fix in place, this test would have resulted in an assertion failure // in InsertCnt_(), because the start of the section was hidden, but not its end. @@ -38,7 +41,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineEndsBeforeToC) CPPUNIT_TEST_FIXTURE(Test, testTdf150086) { // Load a document where an insert redline ends right before a ToC - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf150086.docx"); + SwDoc* pDoc = createSwDoc("tdf150086.docx"); const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); CPPUNIT_ASSERT_EQUAL(static_cast(8), rTable.size()); diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx index 25f7e1bd442d..799400c85ee9 100644 --- a/sw/qa/core/draw/draw.cxx +++ b/sw/qa/core/draw/draw.cxx @@ -23,17 +23,20 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/draw/data/"; - /// Covers sw/source/core/draw/ fixes. class SwCoreDrawTest : public SwModelTestBase { +public: + SwCoreDrawTest() + : SwModelTestBase("/sw/qa/core/draw/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTextboxDeleteAsChar) { // Load a document with an as-char shape in it that has a textbox and an image in it. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "as-char-textbox.docx"); + SwDoc* pDoc = createSwDoc("as-char-textbox.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); sal_Int32 nActual = pPage->GetObjCount(); @@ -59,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTextboxUndoOrdNum) // - picture // - draw format + fly format and a picture in it // - picture - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "textbox-undo-ordnum.docx"); + SwDoc* pDoc = createSwDoc("textbox-undo-ordnum.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats(); // Test the state before del + undo. @@ -106,17 +109,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTextboxUndoOrdNum) CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) { // Load a document with a textframe without border, one with only left border - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf107727_FrameBorder.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("tdf107727_FrameBorder.odt"); // Export to RTF and reload - uno::Reference xStorable(mxComponent, uno::UNO_QUERY); - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - utl::MediaDescriptor aMediaDescriptor; - aMediaDescriptor["FilterName"] <<= OUString("Rich Text Format"); - xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); - mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument", {}); + reload("Rich Text Format", nullptr); // Get frame without border and inspect it. uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); @@ -144,12 +140,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testSdtTextboxHeader) { // Given a 2 page document, same header on both pages, content control in the header and - // shape+fly pair (textbox) anchored in the same header: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "sdt-textbox-header.docx"; - + // shape+fly pair (textbox) anchored in the same header // When loading that document, then make sure that layout doesn't fail with an assertion because // the "master SdrObj should have the highest index" invariant doesn't hold: - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("sdt-textbox-header.docx"); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/core/edit/edit.cxx b/sw/qa/core/edit/edit.cxx index 9f0b3d4dd62b..9edbdb8ceb6e 100644 --- a/sw/qa/core/edit/edit.cxx +++ b/sw/qa/core/edit/edit.cxx @@ -13,20 +13,23 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/edit/data/"; - namespace { /// Covers sw/source/core/edit/ fixes. class Test : public SwModelTestBase { +public: + Test() + : SwModelTestBase("/sw/qa/core/edit/data/") + { + } }; } CPPUNIT_TEST_FIXTURE(Test, testRedlineHidden) { // Given a document with ShowRedlineChanges=false: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "redline-hidden.fodt"); + SwDoc* pDoc = createSwDoc("redline-hidden.fodt"); // When formatting a paragraph by setting the para adjust to center, then make sure setting the // new item set on the paragraph doesn't crash: diff --git a/sw/qa/core/fields/fields.cxx b/sw/qa/core/fields/fields.cxx index 6875b1b2c1ae..b9e4e28287a2 100644 --- a/sw/qa/core/fields/fields.cxx +++ b/sw/qa/core/fields/fields.cxx @@ -26,10 +26,13 @@ namespace /// Covers sw/source/core/fields/ fixes. class Test : public SwModelTestBase { +public: + Test() + : SwModelTestBase("/sw/qa/core/fields/data/") + { + } }; -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/fields/data/"; - CPPUNIT_TEST_FIXTURE(Test, testAuthorityTooltip) { // Create a document with a bibliography reference in it. @@ -69,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAuthorityTooltip) CPPUNIT_TEST_FIXTURE(Test, testTdf143424) { - createSwDoc(DATA_DIRECTORY, "tdf143424.odt"); + createSwDoc("tdf143424.odt"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess( @@ -97,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143424) CPPUNIT_TEST_FIXTURE(Test, testChapterFieldsFollowedBy) { - createSwDoc(DATA_DIRECTORY, "chapter_field_followedby.odt"); + createSwDoc("chapter_field_followedby.odt"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess( diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx index e6fd394b81fa..86f19a0ae17d 100644 --- a/sw/qa/core/frmedt/frmedt.cxx +++ b/sw/qa/core/frmedt/frmedt.cxx @@ -24,17 +24,20 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/frmedt/data/"; - /// Covers sw/source/core/frmedt/ fixes. class SwCoreFrmedtTest : public SwModelTestBase { +public: + SwCoreFrmedtTest() + : SwModelTestBase("/sw/qa/core/frmedt/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testTextboxReanchor) { // Load a document with a textframe and a textbox(shape+textframe). - load(DATA_DIRECTORY, "textbox-reanchor.odt"); + load("textbox-reanchor.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); SdrPage* pDrawPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); @@ -111,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testVertPosFromBottomBoundingBox) CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testPasteFlyInTextBox) { // Given a document that contains a textbox, which contains an sw image (fly frame) - load(DATA_DIRECTORY, "paste-fly-in-textbox.docx"); + load("paste-fly-in-textbox.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index d75157f2b860..d6763199e76c 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -24,18 +24,21 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/layout/data/"; - /// Covers sw/source/core/layout/ fixes. class SwCoreLayoutTest : public SwModelTestBase { +public: + SwCoreLayoutTest() + : SwModelTestBase("/sw/qa/core/layout/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTableFlyOverlap) { // Load a document that has an image anchored in the header. // It also has a table which has the wrap around the image. - load(DATA_DIRECTORY, "table-fly-overlap.docx"); + load("table-fly-overlap.docx"); SwTwips nFlyTop = parseDump("//header/txt/anchored/fly/infos/bounds", "top").toInt32(); SwTwips nFlyHeight = parseDump("//header/txt/anchored/fly/infos/bounds", "height").toInt32(); SwTwips nFlyBottom = nFlyTop + nFlyHeight; @@ -54,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTdf128195) { // Load a document that has two paragraphs in the header. // The second paragraph should have its bottom spacing applied. - load(DATA_DIRECTORY, "tdf128195.docx"); + load("tdf128195.docx"); sal_Int32 nTxtHeight = parseDump("//header/txt[2]/infos/bounds", "height").toInt32(); sal_Int32 nTxtBottom = parseDump("//header/txt[2]/infos/bounds", "bottom").toInt32(); CPPUNIT_ASSERT_EQUAL(static_cast(2269), nTxtHeight); @@ -64,14 +67,14 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTdf128195) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBIRT) { // this looped - load(DATA_DIRECTORY, "birt_min.odt"); + load("birt_min.odt"); } CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBorderCollapseCompat) { // Load a document with a border conflict: top cell has a dotted bottom border, bottom cell has // a solid upper border. - load(DATA_DIRECTORY, "border-collapse-compat.docx"); + load("border-collapse-compat.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); @@ -91,7 +94,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBtlrTableRowSpan) { // Load a document which has a table. The A1 cell has btlr text direction, and the A1..A3 cells // are merged. - load(DATA_DIRECTORY, "btlr-table-row-span.odt"); + load("btlr-table-row-span.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); @@ -108,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBtlrTableRowSpan) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTableFlyOverlapSpacing) { // Load a document that has an image on the right of a table. The table wraps around the image. - load(DATA_DIRECTORY, "table-fly-overlap-spacing.docx"); + load("table-fly-overlap-spacing.docx"); SwTwips nFlyTop = parseDump("//body/txt/anchored/fly/infos/bounds", "top").toInt32(); SwTwips nFlyHeight = parseDump("//body/txt/anchored/fly/infos/bounds", "height").toInt32(); SwTwips nFlyBottom = nFlyTop + nFlyHeight; @@ -125,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTableFlyOverlapSpacing) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTablesMoveBackwards) { // Load a document with 1 pages: empty content on first page, then 21 tables on the second page. - load(DATA_DIRECTORY, "tables-move-backwards.odt"); + load("tables-move-backwards.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); @@ -149,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTablesMoveBackwards) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards) { // Load a document with the ContinuousEndnotes flag turned on. - load(DATA_DIRECTORY, "continuous-endnotes-move-backwards.doc"); + load("continuous-endnotes-move-backwards.doc"); xmlDocUniquePtr pLayout = parseLayoutDump(); // We have 2 pages. assertXPath(pLayout, "/root/page", 2); @@ -167,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph) { // tdf#134783 check whether position of shape is good if it is anchored to paragraph and // the "Don't add space between paragraphs of the same style" option is set - load(DATA_DIRECTORY, "tdf134783_testAnchorPositionBasedOnParagraph.fodt"); + load("tdf134783_testAnchorPositionBasedOnParagraph.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "top", "1671"); @@ -181,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxStaysInsideShape) { // tdf#135198: check whether text box stays inside shape after moving it upwards - load(DATA_DIRECTORY, "shape-textbox.odt"); + load("shape-textbox.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -196,7 +199,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen) { // tdf#138050: a freshly opened document containing a shape with a text box // should not appear to be modified - load(DATA_DIRECTORY, "textbox-phantom-change.docx"); + load("textbox-phantom-change.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -207,7 +210,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical) { - load(DATA_DIRECTORY, "textbox-autogrow-vertical.docx"); + load("textbox-autogrow-vertical.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); @@ -230,7 +233,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextboxModification) { // Load a document with a textbox in it: the layout will have to position the shape part. - load(DATA_DIRECTORY, "textbox-modification.docx"); + load("textbox-modification.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); @@ -242,7 +245,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextboxModification) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBtlrNestedCell) { // Load a document with a nested table, the inner A1 cell has a btlr text direction. - load(DATA_DIRECTORY, "btlr-nested-cell.odt"); + load("btlr-nested-cell.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); @@ -269,7 +272,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testKeepwithnextFullheight) // conflicting requirements. // Without the accompanying fix in place, this test would have failed with a layout loop in // SwEditShell::CalcLayout(). - load(DATA_DIRECTORY, "keepwithnext-fullheight.fodt"); + load("keepwithnext-fullheight.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -424,13 +427,13 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMarginPageBorder) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTdf45908_invoice) { // without the fix, this was hanging (and slowly consuming memory) on fileopen. - load(DATA_DIRECTORY, "tdf45908_invoice.odt"); + load("tdf45908_invoice.odt"); } CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testVerticallyMergedCellBorder) { // Given a document with a table: 2 columns, 5 rows. B2 -> B5 is merged: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "vmerge-cell-border.docx"); + SwDoc* pDoc = createSwDoc("vmerge-cell-border.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // When rendering the table: @@ -501,15 +504,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testVerticallyMergedCellBorder) } } -CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testCrashRemoveFromLayout) -{ - load(DATA_DIRECTORY, "tdf122894-4.doc"); -} +CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testCrashRemoveFromLayout) { load("tdf122894-4.doc"); } CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testLinkedBullet) { // Given a document with a graphic bullet, where the image is a linked one: - load(DATA_DIRECTORY, "linked-bullet.odt"); + load("linked-bullet.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); @@ -529,7 +529,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testLinkedBullet) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testInnerCellBorderIntersect) { // Given a table with both outer and inner borders: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "inner-border.docx"); + SwDoc* pDoc = createSwDoc("inner-border.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // When rendering table borders: @@ -582,7 +582,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testInnerCellBorderIntersect) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoubleBorderVertical) { // Given a table with a left and right double border, outer is thick, inner is thin: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "double-border-vertical.docx"); + SwDoc* pDoc = createSwDoc("double-border-vertical.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // When rendering that document: @@ -630,7 +630,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoubleBorderVertical) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoubleBorderHorizontal) { // Given a table with a top and bottom double border, outer is thin, inner is thick: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "double-border-horizontal.docx"); + SwDoc* pDoc = createSwDoc("double-border-horizontal.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // When rendering table borders: @@ -678,7 +678,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoubleBorderHorizontal) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testParaBorderInCellClip) { // Given a document which has outside-cell borders defined, which should not be visible: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "para-border-in-cell-clip.docx"); + SwDoc* pDoc = createSwDoc("para-border-in-cell-clip.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // When rendering those borders: @@ -698,7 +698,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testParaBorderInCellClip) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoublePageBorder) { // Given a page with a top and bottom double border, outer is thick, inner is thin: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "double-page-border.docx"); + SwDoc* pDoc = createSwDoc("double-page-border.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // When rendering that document: diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx b/sw/qa/core/objectpositioning/objectpositioning.cxx index e3aace4ffc87..94cb96e449ca 100644 --- a/sw/qa/core/objectpositioning/objectpositioning.cxx +++ b/sw/qa/core/objectpositioning/objectpositioning.cxx @@ -16,17 +16,20 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/objectpositioning/data/"; - /// Covers sw/source/core/objectpositioning/ fixes. class SwCoreObjectpositioningTest : public SwModelTestBase { +public: + SwCoreObjectpositioningTest() + : SwModelTestBase("/sw/qa/core/objectpositioning/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testOverlapCrash) { // Load a document with 2 images. - load(DATA_DIRECTORY, "overlap-crash.odt"); + load("overlap-crash.odt"); // Change their anchor type to to-char. uno::Reference xShape1(getShape(1), uno::UNO_QUERY); @@ -145,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertAlignBottomMargin) CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVertAlignBottomMarginWithFooter) { // Load an empty document with footer. - load(DATA_DIRECTORY, "bottom-margin-with-footer.docx"); + load("bottom-margin-with-footer.docx"); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); // Insert three shapes and align it the bottom,center,top of page print area bottom. @@ -218,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testInsideOutsideVertAlignBott { // Load a document, with two shapes. // The shapes align the outside and inside of page print area bottom. - load(DATA_DIRECTORY, "inside-outside-vert-align.docx"); + load("inside-outside-vert-align.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //15704 @@ -241,7 +244,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreObjectpositioningTest, testVMLVertAlignBottomMargin) // The shapes align the top,center,bottom,outside and inside of page print area bottom. // The height of page print area bottom is 4320 ~ 7.62cm. // The size of shapes are 442 ~ 0.78cm - load(DATA_DIRECTORY, "vml-vertical-alignment.docx"); + load("vml-vertical-alignment.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //11803 diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 0bece6e95f2b..4127a3c1c108 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -41,16 +41,19 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/"; - /// Covers sw/source/core/text/ fixes. class SwCoreTextTest : public SwModelTestBase { +public: + SwCoreTextTest() + : SwModelTestBase("/sw/qa/core/text/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testFootnoteConnect) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "footnote-connect.fodt"); + SwDoc* pDoc = createSwDoc("footnote-connect.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Jump to the start of the next page. pWrtShell->SttNxtPg(); @@ -134,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection) { - createSwDoc(DATA_DIRECTORY, "tabovermargin-section.fodt"); + createSwDoc("tabovermargin-section.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nWidth = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabRight']", "nWidth").toInt32(); @@ -149,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineHeight) { // Given a document with an as-char image, height in twips not fitting into sal_uInt16: - createSwDoc(DATA_DIRECTORY, "line-height.fodt"); + createSwDoc("line-height.fodt"); // When laying out that document: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -165,7 +168,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineHeight) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineWidth) { // Given a document with an as-char image, width in twips not fitting into sal_uInt16: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "line-width.fodt"); + SwDoc* pDoc = createSwDoc("line-width.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); sal_Int32 nOldLeft = pWrtShell->GetCharRect().Left(); @@ -186,7 +189,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testChineseAutoFirstLineIndent) // The test document contains two simple multi-line paragraph. For both paragraphs, the first line indent // is set to 'auto'. Line spacing is 100% for the 1st paragraph and 200% for the 2nd paragraph. // Also, there is a "AutoFirstLineIndentDisregardLineSpace" capability flag set in the document. - createSwDoc(DATA_DIRECTORY, "firstLineIndent-withFlag.fodt"); + createSwDoc("firstLineIndent-withFlag.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -205,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testChineseAutoFirstLineIndent) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRuby) { // Given a document with multiple ruby portions: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "ruby.fodt"); + SwDoc* pDoc = createSwDoc("ruby.fodt"); // When laying out that document: SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); @@ -246,13 +249,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testEmptyNumberingPageSplit) { // Given a document with 2 pages: the only para on page 1 is a numbering without a number // portion: - createSwDoc(DATA_DIRECTORY, "empty-numbering-page-split.fodt"); + createSwDoc("empty-numbering-page-split.fodt"); // When inserting an image that doesn't fit the body frame: // Then make sure that the layout update after insertion finishes: uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", - m_directories.getURLFromSrc(DATA_DIRECTORY) + "image.png"), + comphelper::makePropertyValue("FileName", createFileURL(u"image.png")), }; // Without the accompanying fix in place, this never finished. dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); @@ -261,7 +263,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testEmptyNumberingPageSplit) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak) { // Given a document with a fly frame and two characters wrapped around it: - createSwDoc(DATA_DIRECTORY, "clearing-break.fodt"); + createSwDoc("clearing-break.fodt"); // Insert a clearing break between "A" and "B": uno::Reference xDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xDocument->getText(); @@ -291,7 +293,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakAtStart) { // Given a document with a fly frame and a character wrapped around it: - createSwDoc(DATA_DIRECTORY, "clearing-break-start.fodt"); + createSwDoc("clearing-break-start.fodt"); // Insert a clearing break before "X": uno::Reference xDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xDocument->getText(); @@ -457,7 +459,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakVertical) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakHeader) { // Given a document with a shape in the header and a clearing break in the body text: - createSwDoc(DATA_DIRECTORY, "clearing-break-header.fodt"); + createSwDoc("clearing-break-header.fodt"); // When laying out that document: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -556,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf120715_CursorMoveWhenTypingSpaceAtCenteredLineEnd) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); + SwDoc* pDoc = createSwDoc("tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Make a paint to force the call of AddExtraBlankWidth, that calculate width for holePortions. @@ -578,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf43100_CursorMoveToSpacesOverMargin) // These differences are based on its paragraphs // - alignment (left, center, right, justified), // - line count (1 line, 2 lines, blank line containing only spaces) - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); + SwDoc* pDoc = createSwDoc("tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Make a paint to force the call of AddExtraBlankWidth, that calculate width for holePortions. @@ -827,7 +829,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionFormat) { // Given a document with a single paragraph, direct formatting asks 24pt font size for the // numbering and the text portion: - createSwDoc(DATA_DIRECTORY, "number-portion-format.odt"); + createSwDoc("number-portion-format.odt"); // When laying out that document: xmlDocUniquePtr pXmlDoc = parseLayoutDump(); diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx index f9a95640e865..d8da288ad8bf 100644 --- a/sw/qa/core/txtnode/txtnode.cxx +++ b/sw/qa/core/txtnode/txtnode.cxx @@ -31,11 +31,14 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/txtnode/data/"; - /// Covers sw/source/core/txtnode/ fixes. class SwCoreTxtnodeTest : public SwModelTestBase { +public: + SwCoreTxtnodeTest() + : SwModelTestBase("/sw/qa/core/txtnode/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testBtlrCellChinese) @@ -44,7 +47,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testBtlrCellChinese) // classified as vertical, i.e. the glyph has the same direction in both the lrtb ("Latin") and // tbrl ("Chinese") directions. Make sure that Chinese text is handled the same way in the btlr // case as it's handled in the Latin case. - load(DATA_DIRECTORY, "btlr-cell-chinese.doc"); + load("btlr-cell-chinese.doc"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); @@ -60,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testBtlrCellChinese) CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxCopyAnchor) { - load(DATA_DIRECTORY, "textbox-copy-anchor.docx"); + load("textbox-copy-anchor.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pShell->GetWrtShell(); @@ -88,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxCopyAnchor) CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxNodeSplit) { - load(DATA_DIRECTORY, "textbox-node-split.docx"); + load("textbox-node-split.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pShell->GetWrtShell(); @@ -132,7 +135,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTitleFieldInvalidate) comphelper::LibreOfficeKit::setActive(true); // Given a document with a title field: - load(DATA_DIRECTORY, "title-field-invalidate.fodt"); + load("title-field-invalidate.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); pTextDoc->initializeForTiledRendering({}); SwDocShell* pShell = pTextDoc->GetDocShell(); @@ -168,7 +171,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTitleFieldInvalidate) CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testFlyAnchorUndo) { // Given a document with a fly frame, anchored after the last char of the document: - load(DATA_DIRECTORY, "fly-anchor-undo.odt"); + load("fly-anchor-undo.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); SwDoc* pDoc = pShell->GetDoc(); diff --git a/sw/qa/core/undo/undo.cxx b/sw/qa/core/undo/undo.cxx index 0e9ef5b0231e..12d316c49259 100644 --- a/sw/qa/core/undo/undo.cxx +++ b/sw/qa/core/undo/undo.cxx @@ -22,17 +22,20 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/undo/data/"; - /// Covers sw/source/core/undo/ fixes. class SwCoreUndoTest : public SwModelTestBase { +public: + SwCoreUndoTest() + : SwModelTestBase("/sw/qa/core/undo/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTextboxCutSave) { // Load the document and select all. - load(DATA_DIRECTORY, "textbox-cut-save.docx"); + load("textbox-cut-save.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); @@ -58,7 +61,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTextboxCutSave) CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTextboxCutUndo) { - load(DATA_DIRECTORY, "textbox-cut-undo.docx"); + load("textbox-cut-undo.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); @@ -87,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTextboxCutUndo) CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTableCopyRedline) { // Given a document with two table cells and redlining enabled: - load(DATA_DIRECTORY, "table-copy-redline.odt"); + load("table-copy-redline.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); SwDocShell* pDocShell = pTextDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx index ee1592110157..fdab71600312 100644 --- a/sw/qa/core/unocore/unocore.cxx +++ b/sw/qa/core/unocore/unocore.cxx @@ -31,20 +31,20 @@ using namespace ::com::sun::star; -namespace -{ -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/unocore/data/"; -} - /// Covers sw/source/core/unocore/ fixes. class SwCoreUnocoreTest : public SwModelTestBase { +public: + SwCoreUnocoreTest() + : SwModelTestBase("/sw/qa/core/unocore/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf119081) { // Load a doc with a nested table in it. - load(DATA_DIRECTORY, "tdf119081.odt"); + load("tdf119081.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDocShell* pDocShell = pTextDoc->GetDocShell(); @@ -169,8 +169,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testViewCursorTextFrame) { // Given a document with a graphic and holding a reference to that graphic frame: createSwDoc(); - uno::Sequence aInsertArgs = { comphelper::makePropertyValue( - "FileName", m_directories.getURLFromSrc(DATA_DIRECTORY) + "graphic.png") }; + uno::Sequence aInsertArgs + = { comphelper::makePropertyValue("FileName", createFileURL(u"graphic.png")) }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aInsertArgs); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( @@ -198,7 +198,7 @@ static void BasicDisplayErrorHandler(const OUString& /*rErr*/, const OUString& / CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testBrokenEmbeddedObject) { // Given a document with a broken embedded object (the XML markup is not well-formed): - load(DATA_DIRECTORY, "broken-embedded-object.odt"); + load("broken-embedded-object.odt"); uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xObjects(xSupplier->getEmbeddedObjects(), uno::UNO_QUERY); @@ -544,7 +544,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testInsertFileInContentControlException) // Reject inserting a document inside the content control: xCursor->goLeft(1, false); - OUString aURL(m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf119081.odt"); + OUString aURL(createFileURL(u"tdf119081.odt")); uno::Reference xInsertable(xCursor, uno::UNO_QUERY); CPPUNIT_ASSERT_THROW(xInsertable->insertDocumentFromURL(aURL, {}), uno::RuntimeException); diff --git a/sw/qa/core/view/view.cxx b/sw/qa/core/view/view.cxx index 3ff399a0f8ea..d2ba15d9b458 100644 --- a/sw/qa/core/view/view.cxx +++ b/sw/qa/core/view/view.cxx @@ -24,20 +24,23 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/view/data/"; - namespace { /// Covers sw/source/core/view/ fixes. class Test : public SwModelTestBase { +public: + Test() + : SwModelTestBase("/sw/qa/core/view/data/") + { + } }; } CPPUNIT_TEST_FIXTURE(Test, testUpdateOleObjectPreviews) { // Given a document with two embedded objects, both with broken native data: - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "update-ole-object-previews.odt"); + SwDoc* pDoc = createSwDoc("update-ole-object-previews.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // When updating the previews of those embedded objects (right after document load, before diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index db78ecc8d22a..9900f4886011 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -258,6 +258,11 @@ private: class SwHtmlDomExportTest : public SwModelTestBase, public HtmlTestTools { public: + SwHtmlDomExportTest() + : SwModelTestBase("/sw/qa/extras/htmlexport/data/") + { + } + /// Get the .ole path, assuming maTempFile is an XHTML export result. OUString GetOlePath(); OUString GetPngPath(); @@ -326,8 +331,6 @@ void SwHtmlDomExportTest::ImportFromReqif(const OUString& rUrl) mxComponent = loadFromDesktop(rUrl, "com.sun.star.text.TextDocument", aLoadProperties); } -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/htmlexport/data/"; - DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo81276, "fdo81276.html") { uno::Reference xPageStyles(getStyles("PageStyles")); @@ -748,8 +751,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIfPngImg) CPPUNIT_ASSERT(aStream.indexOf("image/png") != -1); }; - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-png-img.xhtml"; - ImportFromReqif(aURL); + ImportFromReqif(createFileURL(u"reqif-png-img.xhtml")); verify(/*bExported=*/false); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); uno::Sequence aStoreProperties = { @@ -941,8 +943,7 @@ DECLARE_HTMLEXPORT_TEST(testTransparentImage, "transparent-image.odt") CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTransparentImageReqIf) { - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "transparent-image.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("transparent-image.odt"); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); uno::Sequence aStoreProperties = { comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")), @@ -1071,8 +1072,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testRTFOLEMimeType) { // Import a document with an embedded object. OUString aType("test/rtf"); - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-ole-data.xhtml"; - ImportFromReqif(aURL); + ImportFromReqif(createFileURL(u"reqif-ole-data.xhtml")); // Export it. uno::Reference xStorable(mxComponent, uno::UNO_QUERY); @@ -1098,8 +1098,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testRTFOLEMimeType) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testChinese) { // Load a document with Chinese text in it. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-chinese.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("reqif-chinese.odt"); // Export it. ExportToReqif(); @@ -1187,8 +1186,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifParagraphAlignment) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF) { // Save to reqif-xhtml. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf-ole.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("pdf-ole.odt"); ExportToReqif(); OUString aRtfUrl = GetOlePath(); @@ -1229,8 +1227,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1Paint) { // Load the bug document, which has OLE1 data in it, which is not a wrapper around OLE2 data. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "paint-ole.xhtml"; - ImportFromReqif(aURL); + ImportFromReqif(createFileURL(u"paint-ole.xhtml")); // Save it as ODT to inspect the result of the OLE1 -> OLE2 conversion. save("writer8"); @@ -1276,8 +1273,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1Paint) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PaintBitmapFormat) { // Given a document with a 8bpp bitmap: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "paint-ole-bitmap-format.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("paint-ole-bitmap-format.odt"); // When exporting to reqif-xhtml with ExportImagesAsOLE enabled: uno::Reference xStorable(mxComponent, uno::UNO_QUERY); @@ -1374,8 +1370,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testUnderlineNone) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataNoOle2) { // Save to reqif-xhtml. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "no-ole2-pres-data.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("no-ole2-pres-data.odt"); ExportToReqif(); OUString aRtfUrl = GetOlePath(); SvMemoryStream aOle1; @@ -1391,8 +1386,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataNoOle2) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataWmfOnly) { // Save to reqif-xhtml. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole1-pres-data-wmf.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("ole1-pres-data-wmf.odt"); ExportToReqif(); OUString aRtfUrl = GetOlePath(); SvMemoryStream aOle1; @@ -1409,8 +1403,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataWmfOnly) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifAscharObjsize) { // Given a document with an as-char anchored embedded object: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-aschar-objsize.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("reqif-aschar-objsize.odt"); // When exporting to reqif-xhtml: ExportToReqif(); @@ -1432,9 +1425,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifAscharObjsize) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifObjdataPresentationDataSize) { // Given a document with an OLE2 embedded object, containing a preview: - OUString aURL - = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-objdata-presentationdatasize.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("reqif-objdata-presentationdatasize.odt"); // When exporting to ReqIF: ExportToReqif(); @@ -1600,9 +1591,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifImageToOle) { // Given a document with an image: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.png"; uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", aImageURL), + comphelper::makePropertyValue("FileName", createFileURL(u"ole2.png")), }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); @@ -1644,9 +1634,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedPNGDirectly) { // Given a document with an image: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.png"; uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", aImageURL), + comphelper::makePropertyValue("FileName", createFileURL(u"ole2.png")), }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); @@ -1669,9 +1658,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedJPGDirectly) { // Given a document with an image: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-ole-img.jpg"; uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", aImageURL), + comphelper::makePropertyValue("FileName", createFileURL(u"reqif-ole-img.jpg")), }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); @@ -1696,13 +1684,12 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedPNGShapeDirectly) { // Given a document with an image shape: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.png"; uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance("com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY); xShape->setSize(awt::Size(10000, 10000)); uno::Reference xShapeProps(xShape, uno::UNO_QUERY); - xShapeProps->setPropertyValue("GraphicURL", uno::Any(aImageURL)); + xShapeProps->setPropertyValue("GraphicURL", uno::Any(createFileURL(u"ole2.png"))); uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); xDrawPageSupplier->getDrawPage()->add(xShape); @@ -1724,13 +1711,12 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedJPGShapeDirectly) { // Given a document with an image: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "reqif-ole-img.jpg"; uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance("com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY); xShape->setSize(awt::Size(10000, 10000)); uno::Reference xShapeProps(xShape, uno::UNO_QUERY); - xShapeProps->setPropertyValue("GraphicURL", uno::Any(aImageURL)); + xShapeProps->setPropertyValue("GraphicURL", uno::Any(createFileURL(u"reqif-ole-img.jpg"))); uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); xDrawPageSupplier->getDrawPage()->add(xShape); @@ -1755,13 +1741,12 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedPNGShapeAsOLE) { // Given a document with an image shape: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.png"; uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance("com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY); xShape->setSize(awt::Size(10000, 10000)); uno::Reference xShapeProps(xShape, uno::UNO_QUERY); - xShapeProps->setPropertyValue("GraphicURL", uno::Any(aImageURL)); + xShapeProps->setPropertyValue("GraphicURL", uno::Any(createFileURL(u"ole2.png"))); uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); xDrawPageSupplier->getDrawPage()->add(xShape); @@ -1922,9 +1907,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOleBmpTransparent) { // Given a document with a transparent image: loadURL("private:factory/swriter", nullptr); - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "transparent.png"; uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", aImageURL), + comphelper::makePropertyValue("FileName", createFileURL(u"transparent.png")), }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); @@ -2051,8 +2035,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testListsHeading) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml) { // Given a document containing an embedded object, with EMF preview: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.odt"; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", {}); + load("ole2.odt"); // When exporting to HTML: uno::Reference xStorable(mxComponent, uno::UNO_QUERY); @@ -2243,7 +2226,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testClearingBreak) // Given a document with an at-para anchored image + a clearing break: // When loading that file: - load(mpTestDocumentPath, "clearing-break.html"); + load("clearing-break.html"); // Then make sure that the clear property of the break is not ignored: verify(); reload(mpFilter, "clearing-break.html"); diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index f5b4f5605729..c1e4981cf983 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -40,7 +40,7 @@ class HtmlImportTest : public SwModelTestBase CPPUNIT_TEST_FIXTURE(HtmlImportTest, testPictureImport) { - load(mpTestDocumentPath, "picture.html"); + load("picture.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); // The document contains two pictures stored as a link. @@ -57,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testPictureImport) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testInlinedImage) { - load(mpTestDocumentPath, "inlined_image.html"); + load("inlined_image.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); // The document contains only one embedded picture inlined in img's src attribute. @@ -95,7 +95,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testInlinedImage) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testInlinedImagesPageAndParagraph) { - load(mpTestDocumentPath, "PageAndParagraphFilled.html"); + load("PageAndParagraphFilled.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testInlinedImagesPageAndParagraph) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testListStyleType) { - load(mpTestDocumentPath, "list-style.html"); + load("list-style.html"); // check unnumbered list style - should be type circle here uno::Reference< beans::XPropertySet > xParagraphProperties(getParagraph(4), uno::UNO_QUERY); @@ -181,7 +181,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testListStyleType) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testMetaIsoDates) { - load(mpTestDocumentPath, "meta-ISO8601-dates.html"); + load("meta-ISO8601-dates.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDocShell* pDocShell(pTextDoc->GetDocShell()); @@ -202,7 +202,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testMetaIsoDates) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageWidthAuto) { - load(mpTestDocumentPath, "image-width-auto.html"); + load("image-width-auto.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwTextAttr const*const pAttr(pTextDoc->GetDocShell()->GetDoc()->GetEditShell()-> @@ -215,7 +215,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageWidthAuto) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageLazyRead) { - load(mpTestDocumentPath, "image-lazy-read.html"); + load("image-lazy-read.html"); auto xGraphic = getProperty>(getShape(1), "Graphic"); Graphic aGraphic(xGraphic); // This failed, import loaded the graphic, it wasn't lazy-read. @@ -224,7 +224,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageLazyRead) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testChangedby) { - load(mpTestDocumentPath, "meta-changedby.html"); + load("meta-changedby.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDocShell* pDocShell(pTextDoc->GetDocShell()); @@ -250,7 +250,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testChangedby) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTableBorder1px) { - load(mpTestDocumentPath, "table_border_1px.html"); + load("table_border_1px.html"); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); @@ -301,7 +301,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTableBorder1px) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testOutlineLevel) { - load(mpTestDocumentPath, "outline-level.html"); + load("outline-level.html"); // This was 0, HTML imported into Writer lost the outline numbering for // Heading 1 styles. CPPUNIT_ASSERT_EQUAL(static_cast(1), @@ -312,14 +312,14 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testReqIfBr) { setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "reqif-br.xhtml"); + load("reqif-br.xhtml"); // was not recognized as a line break from a ReqIf file. CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("aaa\nbbb")); } CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf80194_subscript) { - load(mpTestDocumentPath, "tdf80194_subscript.html"); + load("tdf80194_subscript.html"); uno::Reference xPara = getParagraph(1); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty(getRun(xPara, 1), "CharEscapement"), 0); // Most recently, the default subscript was 33%, which is much too large for a subscript. @@ -341,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testReqIfTable) { setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "reqif-table.xhtml"); + load("reqif-table.xhtml"); // to see this: soffice --infilter="HTML (StarWriter):xhtmlns=reqif-xhtml" sw/qa/extras/htmlimport/data/reqif-table.xhtml // Load a table with xhtmlns=reqif-xhtml filter param. uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -365,7 +365,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testReqIfTable) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageSize) { - load(mpTestDocumentPath, "image-size.html"); + load("image-size.html"); awt::Size aSize = getShape(1)->getSize(); OutputDevice* pDevice = Application::GetDefaultDevice(); Size aPixelSize(200, 400); @@ -379,7 +379,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testImageSize) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf142781) { - load(mpTestDocumentPath, "tdf142781.html"); + load("tdf142781.html"); OutputDevice* pDevice = Application::GetDefaultDevice(); Size aPixelSize(672, 480); Size aExpected = pDevice->PixelToLogic(aPixelSize, MapMode(MapUnit::Map100thMM)); @@ -398,7 +398,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf142781) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf122789) { - load(mpTestDocumentPath, "tdf122789.html"); + load("tdf122789.html"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -410,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf122789) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf118579) { - load(mpTestDocumentPath, "tdf118579.html"); + load("tdf118579.html"); //Without the fix in place, the file fails to load SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testReqIfPageStyle) { setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "reqif-page-style.xhtml"); + load("reqif-page-style.xhtml"); // Without the accompanying fix in place, this test would have failed with // 'Expected: Standard, Actual : HTML'. CPPUNIT_ASSERT_EQUAL(OUString("Standard"), @@ -442,8 +442,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testAllowedRTFOLEMimeTypes) comphelper::makePropertyValue("FilterOptions", OUString("xhtmlns=reqif-xhtml")), comphelper::makePropertyValue("AllowedRTFOLEMimeTypes", aTypes), }; - OUString aURL - = m_directories.getURLFromSrc(mpTestDocumentPath) + "allowed-rtf-ole-mime-types.xhtml"; + OUString aURL = createFileURL(u"allowed-rtf-ole-mime-types.xhtml"); mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", aLoadProperties); uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xObjects(xSupplier->getEmbeddedObjects(), @@ -462,7 +461,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testAllowedRTFOLEMimeTypes) CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testHiddenTextframe) { // Load HTML content into Writer, similar to HTML paste. - load(mpTestDocumentPath, "hidden-textframe.html"); + load("hidden-textframe.html"); // Check the content of the draw page. uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); @@ -481,7 +480,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleImg) // ignored): setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "ole-img.xhtml"); + load("ole-img.xhtml"); // Then make sure the result is a single Writer image: uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); @@ -500,7 +499,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleImgSvg) // ignored): setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "ole-img-svg.xhtml"); + load("ole-img-svg.xhtml"); // Then make sure the result is a single Writer image: uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); @@ -515,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleImgSvg) CPPUNIT_TEST_FIXTURE(HtmlImportTest, testUTF16_nonBMP) { - load(mpTestDocumentPath, "emojis16BE.html"); + load("emojis16BE.html"); // tdf#146173: non-BMP characters' surrogates didn't combine correctly CPPUNIT_ASSERT_EQUAL(OUString(u"a text with emojis: 🌾 ☀👨🏼‍🌾🏃🏼‍♂️🤙🏽🔍"), getParagraph(1)->getString()); @@ -527,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleData) // (containing PNG): setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "ole-data.xhtml"); + load("ole-data.xhtml"); // Then make sure the result is a single clickable Writer image: uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); @@ -548,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleData2) // Given an XHTML with 2 objects: the first has a link, the second does not have: setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "ole-data2.xhtml"); + load("ole-data2.xhtml"); // Then make sure that the second image doesn't have a link set: uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/indexing/IndexingExportTest.cxx b/sw/qa/extras/indexing/IndexingExportTest.cxx index c38f5f1bd413..2161f7476967 100644 --- a/sw/qa/extras/indexing/IndexingExportTest.cxx +++ b/sw/qa/extras/indexing/IndexingExportTest.cxx @@ -44,7 +44,7 @@ public: void IndexingExportTest::testIndexingExport_Paragraphs() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_VariousParagraphs.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_VariousParagraphs.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -79,7 +79,7 @@ void IndexingExportTest::testIndexingExport_Paragraphs() void IndexingExportTest::testIndexingExport_Images() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Images.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Images.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -101,7 +101,7 @@ void IndexingExportTest::testIndexingExport_Images() void IndexingExportTest::testIndexingExport_OLE() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_OLE.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_OLE.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -120,7 +120,7 @@ void IndexingExportTest::testIndexingExport_OLE() void IndexingExportTest::testIndexingExport_Shapes() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Shapes.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Shapes.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -159,7 +159,7 @@ void IndexingExportTest::testIndexingExport_Shapes() void IndexingExportTest::testIndexingExport_Tables() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Tables.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Tables.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -226,7 +226,7 @@ void IndexingExportTest::testIndexingExport_Tables() void IndexingExportTest::testIndexingExport_Sections() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Sections.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Sections.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -257,7 +257,7 @@ void IndexingExportTest::testIndexingExport_Sections() void IndexingExportTest::testIndexingExport_Fontwork() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Fontwork.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Fontwork.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; @@ -281,7 +281,7 @@ void IndexingExportTest::testIndexingExport_Fontwork() void IndexingExportTest::testIndexingExport_Header_Footer() { - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Header_Footer.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Header_Footer.odt"); CPPUNIT_ASSERT(pDoc); SvMemoryStream aMemoryStream; diff --git a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx index a4de60444c10..670069318ab8 100644 --- a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx +++ b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx @@ -41,7 +41,7 @@ void SearchResultLocatorTest::testSearchResultLocator() if (!IsDefaultDPI()) return; - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_VariousParagraphs.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_VariousParagraphs.odt"); CPPUNIT_ASSERT(pDoc); sw::search::SearchResultLocator aLocator(pDoc); @@ -68,7 +68,7 @@ void SearchResultLocatorTest::testSearchResultLocatorUsingXmlPayload() if (!IsDefaultDPI()) return; - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_VariousParagraphs.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_VariousParagraphs.odt"); CPPUNIT_ASSERT(pDoc); sw::search::SearchResultLocator aLocator(pDoc); @@ -96,7 +96,7 @@ void SearchResultLocatorTest::testSearchResultLocatorUsingJsonPayload() if (!IsDefaultDPI()) return; - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_VariousParagraphs.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_VariousParagraphs.odt"); CPPUNIT_ASSERT(pDoc); sw::search::SearchResultLocator aLocator(pDoc); @@ -124,7 +124,7 @@ void SearchResultLocatorTest::testSearchResultLocatorForSdrObjects() if (!IsDefaultDPI()) return; - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Shapes.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Shapes.odt"); CPPUNIT_ASSERT(pDoc); sw::search::SearchResultLocator aLocator(pDoc); @@ -151,7 +151,7 @@ void SearchResultLocatorTest::testSearchResultLocatorForSdrObjectsUsingJsonPaylo if (!IsDefaultDPI()) return; - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "IndexingExport_Shapes.odt"); + SwDoc* pDoc = createSwDoc("IndexingExport_Shapes.odt"); CPPUNIT_ASSERT(pDoc); sw::search::SearchResultLocator aLocator(pDoc); diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 7d8f76698cb0..190478c40063 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -43,11 +43,15 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/layout/data/"; - /// Test to assert layout / rendering result of Writer. class SwLayoutWriter : public SwModelTestBase { +public: + SwLayoutWriter() + : SwModelTestBase("/sw/qa/extras/layout/data/") + { + } + protected: void CheckRedlineFootnotesHidden(); void CheckRedlineSectionsHidden(); @@ -119,7 +123,7 @@ void SwLayoutWriter::CheckRedlineSectionsHidden() CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes) { - createSwDoc(DATA_DIRECTORY, "redline_footnotes.odt"); + createSwDoc("redline_footnotes.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -279,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136588) { - load(DATA_DIRECTORY, "tdf136588.docx"); + load("tdf136588.docx"); auto pXMLLayoutDump = parseLayoutDump(); CPPUNIT_ASSERT(pXMLLayoutDump); @@ -696,7 +700,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134472.odt"); + SwDoc* pDoc = createSwDoc("tdf134472.odt"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "height", "843"); @@ -705,7 +709,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestNestedTableMoveFwd) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tabellen_test_windows_1.odt"); + SwDoc* pDoc = createSwDoc("tabellen_test_windows_1.odt"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // the row with the nested table should not be split but be the first row on page 2 @@ -718,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestNestedTableMoveFwd) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136613) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf136613.docx"); + SwDoc* pDoc = createSwDoc("tdf136613.docx"); CPPUNIT_ASSERT(pDoc); //get the flys and the root frame @@ -749,7 +753,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136613) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf88496) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf88496.docx"); + SwDoc* pDoc = createSwDoc("tdf88496.docx"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 4, table fallback "switch off repeating header" started on a new page @@ -1189,7 +1193,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025) { // Check the padding of the textbox - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf137025.docx"); + SwDoc* pDoc = createSwDoc("tdf137025.docx"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -1874,7 +1878,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143239-1-min.odt"); + SwDoc* pDoc = createSwDoc("tdf143239-1-min.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // These are unstable on macOS and Win64 builds, @@ -1934,7 +1938,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableOverlapFooterFly) { // Load a document that has a fly anchored in the footer. // It also has a table which initially overlaps with the fly, but then moves to the next page. - load(DATA_DIRECTORY, "footer-fly-table.fodt"); + load("footer-fly-table.fodt"); xmlDocUniquePtr pLayout = parseLayoutDump(); // no fly portions, was: 8 assertXPath(pLayout, @@ -1961,7 +1965,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableOverlapFooterFly) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134277) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134277.docx"); + SwDoc* pDoc = createSwDoc("tdf134277.docx"); CPPUNIT_ASSERT(pDoc); SwDocShell* pShell = pDoc->GetDocShell(); @@ -1979,7 +1983,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134277) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116486.docx"); + SwDoc* pDoc = createSwDoc("tdf116486.docx"); CPPUNIT_ASSERT(pDoc); OUString aTop = parseDump( "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/child::*[@type='PortionType::Fly']", @@ -1990,7 +1994,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf142080) { // this caused an infinite loop - load(DATA_DIRECTORY, "fdo43573-2-min.docx"); + load("fdo43573-2-min.docx"); xmlDocUniquePtr pLayout = parseLayoutDump(); // check the first paragraph on page 9 with its fly; the column was empty too @@ -2008,7 +2012,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf142080) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128198-1.docx"); + SwDoc* pDoc = createSwDoc("tdf128198-1.docx"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pLayout = parseLayoutDump(); // the problem was that line 5 was truncated at "this " @@ -2022,7 +2026,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testNoLineBreakAtSlash) { - load(DATA_DIRECTORY, "no-line-break-at-slash.fodt"); + load("no-line-break-at-slash.fodt"); xmlDocUniquePtr pLayout = parseLayoutDump(); // the line break was between "Foostrasse 13/c/" and "2" @@ -2046,7 +2050,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testNoLineBreakAtSlash) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106153) { - load(DATA_DIRECTORY, "tdf106153.docx"); + load("tdf106153.docx"); xmlDocUniquePtr pDump = parseLayoutDump(); const sal_Int64 nPageValLeft = getXPath(pDump, "/root/page/infos/bounds", "left").toInt64(); @@ -3056,7 +3060,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections) { - createSwDoc(DATA_DIRECTORY, "redline_sections.fodt"); + createSwDoc("redline_sections.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -3157,7 +3161,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_images) { - createSwDoc(DATA_DIRECTORY, "tdf69647_images.odt"); + createSwDoc("tdf69647_images.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 2, getPages()); @@ -3165,7 +3169,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_images) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_text) { - createSwDoc(DATA_DIRECTORY, "tdf69647_text.docx"); + createSwDoc("tdf69647_text.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 2, getPages()); @@ -3173,7 +3177,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_text) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) { - createSwDoc(DATA_DIRECTORY, "redline_table.fodt"); + createSwDoc("redline_table.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -3259,7 +3263,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057) { - createSwDoc(DATA_DIRECTORY, "tdf144057.fodt"); + createSwDoc("tdf144057.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -3320,7 +3324,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347) { - createSwDoc(DATA_DIRECTORY, "tdf144057.fodt"); + createSwDoc("tdf144057.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -3374,7 +3378,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) { - createSwDoc(DATA_DIRECTORY, "tdf109137.docx"); + createSwDoc("tdf109137.docx"); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); @@ -3390,124 +3394,79 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint72) -{ - createSwDoc(DATA_DIRECTORY, "forcepoint72-1.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint72) { createSwDoc("forcepoint72-1.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint75) -{ - createSwDoc(DATA_DIRECTORY, "forcepoint75-1.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint75) { createSwDoc("forcepoint75-1.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testUXTSOREL) -{ - createSwDoc(DATA_DIRECTORY, "LIBREOFFICE-UXTSOREL.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testUXTSOREL) { createSwDoc("LIBREOFFICE-UXTSOREL.rtf"); } //just care it doesn't crash/assert CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepointFootnoteFrame) { - createSwDoc(DATA_DIRECTORY, "forcepoint-swfootnoteframe-1.rtf"); + createSwDoc("forcepoint-swfootnoteframe-1.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint76) -{ - createSwDoc(DATA_DIRECTORY, "forcepoint76-1.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint76) { createSwDoc("forcepoint76-1.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testN4LA0OHZ) -{ - createSwDoc(DATA_DIRECTORY, "LIBREOFFICE-N4LA0OHZ.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testN4LA0OHZ) { createSwDoc("LIBREOFFICE-N4LA0OHZ.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint89) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint89.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint89) { createSwWebDoc("forcepoint89.html"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint90) -{ - createSwDoc(DATA_DIRECTORY, "forcepoint90.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint90) { createSwDoc("forcepoint90.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint91) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint91.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint91) { createSwWebDoc("forcepoint91.html"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92) -{ - createSwDoc(DATA_DIRECTORY, "forcepoint92.doc"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92) { createSwDoc("forcepoint92.doc"); } //just care it doesn't crash/assert CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint93) { - createSwDoc(DATA_DIRECTORY, "forcepoint93-1.rtf"); - createSwDoc(DATA_DIRECTORY, "forcepoint93-2.rtf"); + createSwDoc("forcepoint93-1.rtf"); + createSwDoc("forcepoint93-2.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint94.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94) { createSwWebDoc("forcepoint94.html"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint98) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint98.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint98) { createSwWebDoc("forcepoint98.html"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint100) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint100.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint100) { createSwWebDoc("forcepoint100.html"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint102) -{ - createSwDoc(DATA_DIRECTORY, "forcepoint102.rtf"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint102) { createSwDoc("forcepoint102.rtf"); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint103) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint103.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint103) { createSwWebDoc("forcepoint103.html"); } //just care it doesn't crash/assert CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf147485Forcepoint) { - createSwDoc(DATA_DIRECTORY, "tdf147485-forcepoint.docx"); + createSwDoc("tdf147485-forcepoint.docx"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118058.fodt"); + SwDoc* pDoc = createSwDoc("tdf118058.fodt"); // This resulted in a layout loop. pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); } //just care it doesn't crash/assert -CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint99) -{ - createSwWebDoc(DATA_DIRECTORY, "forcepoint99.html"); -} +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint99) { createSwWebDoc("forcepoint99.html"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611) { - createSwDoc(DATA_DIRECTORY, "tdf128611.fodt"); + createSwDoc("tdf128611.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); // Without the accompanying fix in place, this test would have failed with: @@ -3520,7 +3479,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125893) { - createSwDoc(DATA_DIRECTORY, "tdf125893.docx"); + createSwDoc("tdf125893.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 400. The paragraph must have zero top border. assertXPath(pXmlDoc, "/root/page/body/txt[4]/infos/prtBounds", "top", "0"); @@ -3528,7 +3487,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125893) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134463) { - createSwDoc(DATA_DIRECTORY, "tdf134463.docx"); + createSwDoc("tdf134463.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 621. The previous paragraph must have zero bottom border. assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/prtBounds", "top", "21"); @@ -3536,7 +3495,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134463) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117188) { - createSwDoc(DATA_DIRECTORY, "tdf117188.docx"); + createSwDoc("tdf117188.docx"); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); @@ -3557,7 +3516,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117188) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117187) { - createSwDoc(DATA_DIRECTORY, "tdf117187.odt"); + createSwDoc("tdf117187.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // there should be no fly portions @@ -3568,7 +3527,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117187) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf119875) { - createSwDoc(DATA_DIRECTORY, "tdf119875.odt"); + createSwDoc("tdf119875.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFirstTop = getXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "top").toInt32(); @@ -3581,7 +3540,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf119875) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287) { - createSwDoc(DATA_DIRECTORY, "tdf120287.fodt"); + createSwDoc("tdf120287.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, TabOverMargin Word-specific compat flag did not imply // default-in-Word printer-independent layout, resulting in an additional @@ -3591,7 +3550,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106234) { - createSwDoc(DATA_DIRECTORY, "tdf106234.fodt"); + createSwDoc("tdf106234.fodt"); // Ensure that all text portions are calculated before testing. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -3616,7 +3575,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106234) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287b) { - createSwDoc(DATA_DIRECTORY, "tdf120287b.fodt"); + createSwDoc("tdf120287b.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 1418, TabOverMargin did the right split of the paragraph to two // lines, but then calculated a too large tab portion size on the first @@ -3629,7 +3588,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287b) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287c) { - createSwDoc(DATA_DIRECTORY, "tdf120287c.fodt"); + createSwDoc("tdf120287c.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, the second line was not broken into a 2nd and a 3rd one, // rendering text outside the paragraph frame. @@ -3638,7 +3597,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf120287c) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122878) { - createSwDoc(DATA_DIRECTORY, "tdf122878.docx"); + createSwDoc("tdf122878.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // FIXME: the XPath should be adjusted when the proper floating table would be imported const sal_Int32 nTblTop @@ -3660,7 +3619,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122878) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115094) { - createSwDoc(DATA_DIRECTORY, "tdf115094.docx"); + createSwDoc("tdf115094.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nTopOfD1 @@ -3687,7 +3646,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115094) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf112290) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf112290.docx"); + SwDoc* pDoc = createSwDoc("tdf112290.docx"); CPPUNIT_ASSERT(pDoc); auto pXml = parseLayoutDump(); assertXPath(pXml, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", "Xxxx Xxxx"); @@ -3695,7 +3654,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf112290) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testKeepWithNextPlusFlyFollowTextFlow) { - createSwDoc(DATA_DIRECTORY, "keep-with-next-fly.fodt"); + createSwDoc("keep-with-next-fly.fodt"); { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -3747,7 +3706,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testKeepWithNextPlusFlyFollowTextFlow) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607) { - createSwDoc(DATA_DIRECTORY, "tdf122607.odt"); + createSwDoc("tdf122607.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/" @@ -3769,9 +3728,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607_regression) if (mxComponent.is()) mxComponent->dispose(); - OUString const pName("tdf122607_leerzeile.odt"); - - OUString const url(m_directories.getURLFromSrc(DATA_DIRECTORY) + pName); + OUString const url(createFileURL(u"tdf122607_leerzeile.odt")); // note: must set Hidden property, so that SfxFrameViewWindow_Impl::Resize() // does *not* forward initial VCL Window Resize and thereby triggers a @@ -3780,8 +3737,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607_regression) { beans::PropertyValue("Hidden", -1, uno::Any(true), beans::PropertyState_DIRECT_VALUE) }, }; - std::cout << pName << ":\n"; - // inline the loading because currently properties can't be passed... mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument", comphelper::containerToSequence(aFilterOptions)); @@ -3813,9 +3768,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150616) if (mxComponent.is()) mxComponent->dispose(); - OUString const pName("in_056132_mod.odt"); - - OUString const url(m_directories.getURLFromSrc(DATA_DIRECTORY) + pName); + OUString const url(createFileURL(u"in_056132_mod.odt")); // note: must set Hidden property, so that SfxFrameViewWindow_Impl::Resize() // does *not* forward initial VCL Window Resize and thereby triggers a @@ -3824,8 +3777,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150616) { beans::PropertyValue("Hidden", -1, uno::Any(true), beans::PropertyState_DIRECT_VALUE) }, }; - std::cout << pName << ":\n"; - // inline the loading because currently properties can't be passed... mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument", comphelper::containerToSequence(aFilterOptions)); @@ -3858,7 +3809,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150616) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "btlr-cell.odt"); + SwDoc* pDoc = createSwDoc("btlr-cell.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -4020,7 +3971,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123898) { - createSwDoc(DATA_DIRECTORY, "tdf123898.odt"); + createSwDoc("tdf123898.odt"); // Make sure spellchecker has done its job already Scheduler::ProcessEventsToIdle(); @@ -4035,7 +3986,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123898) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123651) { - createSwDoc(DATA_DIRECTORY, "tdf123651.docx"); + createSwDoc("tdf123651.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with 'Expected: 7639; // Actual: 12926'. The shape was below the second "Lorem ipsum" text, not above it. @@ -4047,19 +3998,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123651) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116501) { //just care it doesn't freeze - createSwDoc(DATA_DIRECTORY, "tdf116501.odt"); + createSwDoc("tdf116501.odt"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123163) { //just care it doesn't assert - createSwDoc(DATA_DIRECTORY, "tdf123163-1.docx"); + createSwDoc("tdf123163-1.docx"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testAbi11870) { //just care it doesn't assert - createSwDoc(DATA_DIRECTORY, "abi11870-2.odt"); + createSwDoc("abi11870-2.odt"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118719) @@ -4086,7 +4037,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118719) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTabOverMargin) { - createSwDoc(DATA_DIRECTORY, "tab-over-margin.odt"); + createSwDoc("tab-over-margin.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // 2nd paragraph has a tab over the right margin, and with the TabOverMargin compat option, @@ -4099,7 +4050,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testImageComment) { // Load a document that has "aaa" in it, then a commented image (4th char is the as-char image, // 5th char is the comment anchor). - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "image-comment.odt"); + SwDoc* pDoc = createSwDoc("image-comment.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Look up a layout position which is on the right of the image. @@ -4133,7 +4084,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testImageComment) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testScriptField) { // Test clicking script field inside table ( tdf#141079 ) - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf141079.odt"); + SwDoc* pDoc = createSwDoc("tdf141079.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Look up layout position which is the first cell in the table @@ -4166,7 +4117,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testScriptField) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCommentCursorPosition) { // Load a document that has "aaa" in it, followed by three comments. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "endOfLineComments.odt"); + SwDoc* pDoc = createSwDoc("endOfLineComments.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwRootFrame* pRoot = pWrtShell->GetLayout(); @@ -4199,7 +4150,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCommentCursorPosition) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCombiningCharacterCursorPosition) { // Load a document that has "a" in it, followed by a combining acute in a separate rext span - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf138592-a-acute.fodt"); + SwDoc* pDoc = createSwDoc("tdf138592-a-acute.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwRootFrame* pRoot = pWrtShell->GetLayout(); @@ -4228,7 +4179,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testCombiningCharacterCursorPosition) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222) { - createSwDoc(DATA_DIRECTORY, "tdf64222.docx"); + createSwDoc("tdf64222.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath( pXmlDoc, @@ -4238,7 +4189,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf113014) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf113014.fodt"); + SwDoc* pDoc = createSwDoc("tdf113014.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -4257,7 +4208,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf113014) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130218) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130218.fodt"); + SwDoc* pDoc = createSwDoc("tdf130218.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -4273,14 +4224,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130218) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127235) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf127235.odt"); + SwDoc* pDoc = createSwDoc("tdf127235.odt"); // This resulted in a layout loop. pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf138039) { - createSwDoc(DATA_DIRECTORY, "tdf138039.odt"); + createSwDoc("tdf138039.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -4304,7 +4255,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf138039) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134298) { - createSwDoc(DATA_DIRECTORY, "tdf134298.ott"); + createSwDoc("tdf134298.ott"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -4431,7 +4382,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testShapeAllowOverlapWrap) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124600) { - createSwDoc(DATA_DIRECTORY, "tdf124600.docx"); + createSwDoc("tdf124600.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: @@ -4447,7 +4398,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124601) // This is a testcase for the ContinuousEndnotes compat flag. // The document has 2 pages, the endnote anchor is on the first page. // The endnote should be on the 2nd page together with the last page content. - createSwDoc(DATA_DIRECTORY, "tdf124601.doc"); + createSwDoc("tdf124601.doc"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: @@ -4466,7 +4417,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124601b) // The shape has layoutInCell=1, so should match what Word does here. // Also the horizontal position should be in the last column, even if the anchor is in the // last-but-one column. - createSwDoc(DATA_DIRECTORY, "tdf124601b.doc"); + createSwDoc("tdf124601b.doc"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFlyTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32(); @@ -4592,7 +4543,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testContinuousEndnotesDeletePageAtStart) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128399.docx"); + SwDoc* pDoc = createSwDoc("tdf128399.docx"); SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); SwFrame* pPage = pLayout->GetLower(); SwFrame* pBody = pPage->GetLower(); @@ -4619,7 +4570,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf145826) { - createSwDoc(DATA_DIRECTORY, "tdf145826.odt"); + createSwDoc("tdf145826.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -4636,7 +4587,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf145826) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105481) { - createSwDoc(DATA_DIRECTORY, "tdf105481.odt"); + createSwDoc("tdf105481.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -4699,7 +4650,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105481) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117982) { - SwDoc* pDocument = createSwDoc(DATA_DIRECTORY, "tdf117982.docx"); + SwDoc* pDocument = createSwDoc("tdf117982.docx"); SwDocShell* pShell = pDocument->GetDocShell(); std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; @@ -4712,7 +4663,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117982) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128959) { // no orphan/widow control in table cells - SwDoc* pDocument = createSwDoc(DATA_DIRECTORY, "tdf128959.docx"); + SwDoc* pDocument = createSwDoc("tdf128959.docx"); CPPUNIT_ASSERT(pDocument); discardDumpedLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -4739,7 +4690,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf121658) if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) return; - createSwDoc(DATA_DIRECTORY, "tdf121658.odt"); + createSwDoc("tdf121658.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Only 2 hyphenated words should appear in the document (in the lowercase words). @@ -4753,7 +4704,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf149420) if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) return; - createSwDoc(DATA_DIRECTORY, "tdf149420.odt"); + createSwDoc("tdf149420.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Only 3 hyphenated words should appear in the document (last paragraph @@ -4768,7 +4719,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf149324) if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) return; - createSwDoc(DATA_DIRECTORY, "tdf149324.odt"); + createSwDoc("tdf149324.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Only 3 hyphenated words should appear in the document (last paragraph @@ -4783,7 +4734,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf149248) if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) return; - createSwDoc(DATA_DIRECTORY, "tdf149248.odt"); + createSwDoc("tdf149248.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Only 1 hyphenated word should appear in the document (last word of the second @@ -4794,7 +4745,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf149248) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testWriterImageNoCapture) { - createSwDoc(DATA_DIRECTORY, "writer-image-no-capture.docx"); + createSwDoc("writer-image-no-capture.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nPageLeft = getXPath(pXmlDoc, "//page/infos/bounds", "left").toInt32(); @@ -4833,7 +4784,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testStableAtPageAnchoredFlyPosition) // it also has a style:master-page named "StandardEntwurf", which contains some fields. // if you add a break to page 2, or append some text to page 4 (or just toggle display field names), // the page anchored frame on page 4 vanishes, as it is incorrectly moved out of the page bounds. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "stable-at-page-anchored-fly-position.odt"); + SwDoc* pDoc = createSwDoc("stable-at-page-anchored-fly-position.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // look up the layout position of the page-bound frame on page four @@ -4852,7 +4803,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testStableAtPageAnchoredFlyPosition) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134548) { - createSwDoc(DATA_DIRECTORY, "tdf134548.odt"); + createSwDoc("tdf134548.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Second paragraph has two non zero width tabs in beginning of line @@ -4880,7 +4831,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134548) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124423) { - createSwDoc(DATA_DIRECTORY, "tdf124423.docx"); + createSwDoc("tdf124423.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); @@ -4890,7 +4841,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124423) CPPUNIT_ASSERT_EQUAL(nPageWidth, nFly2Width); CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly1Width); - createSwDoc(DATA_DIRECTORY, "tdf124423.odt"); + createSwDoc("tdf124423.odt"); pXmlDoc = parseLayoutDump(); nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32(); @@ -4902,7 +4853,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124423) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf137185) { // First load the sample bugdoc - load(DATA_DIRECTORY, "tdf137185.odt"); + load("tdf137185.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); // Get the doc shell @@ -4942,7 +4893,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf137185) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf138782) { - CPPUNIT_ASSERT(createSwDoc(DATA_DIRECTORY, "tdf138782.docx")); + CPPUNIT_ASSERT(createSwDoc("tdf138782.docx")); auto pXml = parseLayoutDump(); CPPUNIT_ASSERT(pXml); @@ -4958,7 +4909,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf138782) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) { - createSwDoc(DATA_DIRECTORY, "tdf135035.docx"); + createSwDoc("tdf135035.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); @@ -4971,7 +4922,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_ASSERT_EQUAL(nParentWidth, nFly3Width); CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly1Width); - createSwDoc(DATA_DIRECTORY, "tdf135035.odt"); + createSwDoc("tdf135035.odt"); pXmlDoc = parseLayoutDump(); nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32(); @@ -4984,7 +4935,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf146704_EndnoteInSection.odt"); + SwDoc* pDoc = createSwDoc("tdf146704_EndnoteInSection.odt"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the fix, the endnote placed to 2. page @@ -4993,8 +4944,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection) CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) { - SwDoc* pDoc - = createSwDoc(DATA_DIRECTORY, "tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx"); + SwDoc* pDoc = createSwDoc("tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx"); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the fix, it would be 5 pages, but with the fix the whole document @@ -5012,8 +4962,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf54465_ColumnsWithFootnoteDoNotOccupy // was more than 1 page long. // Note: Somewhy this test miscalculates the layout of the old odt file. // It will be 4 pages long, while opened in Writer it is 5 pages long. - SwDoc* pDoc - = createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt"); + SwDoc* pDoc = createSwDoc("tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt"); CPPUNIT_ASSERT(pDoc); Scheduler::ProcessEventsToIdle(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -5023,7 +4972,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf54465_ColumnsWithFootnoteDoNotOccupy xmlXPathFreeObject(pXmlObj); discardDumpedLayout(); - pDoc = createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt"); + pDoc = createSwDoc("tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt"); CPPUNIT_ASSERT(pDoc); pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 1); diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 367eb23f05da..116bec33c80e 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -29,11 +29,15 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/layout/data/"; - /// Test to assert layout / rendering result of Writer. class SwLayoutWriter2 : public SwModelTestBase { +public: + SwLayoutWriter2() + : SwModelTestBase("/sw/qa/extras/layout/data/") + { + } + protected: void CheckRedlineCharAttributesHidden(); }; @@ -134,7 +138,7 @@ void SwLayoutWriter2::CheckRedlineCharAttributesHidden() CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf100680_as_char_wrap) { - createSwDoc(DATA_DIRECTORY, "tdf100680.docx"); + createSwDoc("tdf100680.docx"); auto pDump = parseLayoutDump(); assertXPath(pDump, "/root/page/header/txt/SwParaPortion/SwLineLayout[3]"); // If the third line missing that assert will fire, as was before the fix. @@ -142,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf100680_as_char_wrap) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes) { - createSwDoc(DATA_DIRECTORY, "redline_charatr.fodt"); + createSwDoc("redline_charatr.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -327,7 +331,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination) { - createSwDoc(DATA_DIRECTORY, "redline_footnote_pagination.fodt"); + createSwDoc("redline_footnote_pagination.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc()); @@ -375,7 +379,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951) { // Open the bugdoc - auto pDoc = createSwDoc(DATA_DIRECTORY, "tdf138951.odt"); + auto pDoc = createSwDoc("tdf138951.odt"); // Get the only shape uno::Reference xShape(getShape(1), uno::UNO_QUERY); @@ -405,7 +409,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150717) { - createSwDoc(DATA_DIRECTORY, "tdf150717.odt"); + createSwDoc("tdf150717.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // check bookmark colors defined in metadata assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[2]", "colors", @@ -427,7 +431,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150717) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150790) { - createSwDoc(DATA_DIRECTORY, "tdf150790.fodt"); + createSwDoc("tdf150790.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // point bookmark is shown as I-beam (only its text dump is |, as before on the screen) assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwBookmarkPortion", @@ -445,7 +449,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150790) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInNumbering) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf42748.fodt"); + SwDoc* pDoc = createSwDoc("tdf42748.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -469,7 +473,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInNumbering) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115523.fodt"); + SwDoc* pDoc = createSwDoc("tdf115523.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -490,7 +494,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering2) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115524.fodt"); + SwDoc* pDoc = createSwDoc("tdf115524.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -511,7 +515,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering2) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149710_RedlineNumberingEditing) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf149710.fodt"); + SwDoc* pDoc = createSwDoc("tdf149710.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -553,7 +557,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149710_RedlineNumberingEditing) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149709_RedlineNumberingLevel) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf149709.fodt"); + SwDoc* pDoc = createSwDoc("tdf149709.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -610,7 +614,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149709_RedlineNumberingLevel) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMark) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf149711.docx"); + SwDoc* pDoc = createSwDoc("tdf149711.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt", 6); @@ -627,7 +631,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMar CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInFootnote) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf85610.fodt"); + SwDoc* pDoc = createSwDoc("tdf85610.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -645,7 +649,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInFootnote) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf42748.fodt"); + SwDoc* pDoc = createSwDoc("tdf42748.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // create a 3-element list without change tracking @@ -673,7 +677,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving2) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf42748.fodt"); + SwDoc* pDoc = createSwDoc("tdf42748.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // create a 3-element list without change tracking @@ -706,7 +710,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving2) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMovingDOCX) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf104797.docx"); + SwDoc* pDoc = createSwDoc("tdf104797.docx"); SwDocShell* pShell = pDoc->GetDocShell(); SwEditShell* const pEditShell(pDoc->GetEditShell()); @@ -730,9 +734,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) if (mxComponent.is()) mxComponent->dispose(); - OUString const pName("table_cell_overlap.fodt"); - - OUString const url(m_directories.getURLFromSrc(DATA_DIRECTORY) + pName); + OUString const url(createFileURL(u"table_cell_overlap.fodt")); // note: must set Hidden property, so that SfxFrameViewWindow_Impl::Resize() // does *not* forward initial VCL Window Resize and thereby triggers a @@ -741,8 +743,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) { beans::PropertyValue("Hidden", -1, uno::Any(true), beans::PropertyState_DIRECT_VALUE) }, }; - std::cout << pName << ":\n"; - // inline the loading because currently properties can't be passed... mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument", comphelper::containerToSequence(aFilterOptions)); @@ -782,7 +782,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145719) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf145719.odt"); + SwDoc* pDoc = createSwDoc("tdf145719.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -798,7 +798,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145719) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testChangedTableRows) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "changed_table_rows.fodt"); + SwDoc* pDoc = createSwDoc("changed_table_rows.fodt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -817,7 +817,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testChangedTableRows) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145225_RedlineMovingWithBadInsertion) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf42748.fodt"); + SwDoc* pDoc = createSwDoc("tdf42748.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -852,7 +852,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145225_RedlineMovingWithBadInsertio CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146964_ReappearingMovedTextInHideChangesMode) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -884,7 +884,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146964_ReappearingMovedTextInHideCh CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125300) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125300.docx"); + SwDoc* pDoc = createSwDoc("tdf125300.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -907,7 +907,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125300) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116830) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116830.odt"); + SwDoc* pDoc = createSwDoc("tdf116830.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -934,7 +934,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116830) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf114163) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf114163.odt"); + SwDoc* pDoc = createSwDoc("tdf114163.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -949,7 +949,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf114163) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf131707) { - createSwDoc(DATA_DIRECTORY, "tdf131707_flyWrap.doc"); + createSwDoc("tdf131707_flyWrap.doc"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds", "top", "2185"); @@ -959,7 +959,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf131707) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf122225.docx"); + SwDoc* pDoc = createSwDoc("tdf122225.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -984,7 +984,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125335) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125335.odt"); + SwDoc* pDoc = createSwDoc("tdf125335.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -999,7 +999,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125335) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134247) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "legend-itemorder-min.docx"); + SwDoc* pDoc = createSwDoc("legend-itemorder-min.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1014,7 +1014,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134247) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf75659) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf75659.docx"); + SwDoc* pDoc = createSwDoc("tdf75659.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1031,7 +1031,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf75659) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136816) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf136816.odt"); + SwDoc* pDoc = createSwDoc("tdf136816.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1046,7 +1046,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136816) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "long_legendentry.docx"); + SwDoc* pDoc = createSwDoc("long_legendentry.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1063,7 +1063,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops) { - CPPUNIT_ASSERT(createSwDoc(DATA_DIRECTORY, "tdf138465min.docx")); + CPPUNIT_ASSERT(createSwDoc("tdf138465min.docx")); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -1079,7 +1079,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf123268) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf123268.odt"); + SwDoc* pDoc = createSwDoc("tdf123268.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1097,7 +1097,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf123268) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf133005) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf133005.odt"); + SwDoc* pDoc = createSwDoc("tdf133005.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1123,7 +1123,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf133005) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf115630) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115630.docx"); + SwDoc* pDoc = createSwDoc("tdf115630.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1148,7 +1148,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf115630) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf108021) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf108021.odt"); + SwDoc* pDoc = createSwDoc("tdf108021.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1163,7 +1163,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf108021) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125334) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125334.odt"); + SwDoc* pDoc = createSwDoc("tdf125334.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1178,7 +1178,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125334) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122800) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf122800.odt"); + SwDoc* pDoc = createSwDoc("tdf122800.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1193,7 +1193,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122800) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTruncatedAxisLabel) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "testTruncatedAxisLabel.odt"); + SwDoc* pDoc = createSwDoc("testTruncatedAxisLabel.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1211,7 +1211,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTruncatedAxisLabel) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf128996) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128996.docx"); + SwDoc* pDoc = createSwDoc("tdf128996.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1225,7 +1225,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf128996) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126244.docx"); + SwDoc* pDoc = createSwDoc("tdf126244.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1253,7 +1253,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf127304.odt"); + SwDoc* pDoc = createSwDoc("tdf127304.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1278,7 +1278,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "horizontal_multilevel.odt"); + SwDoc* pDoc = createSwDoc("horizontal_multilevel.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1293,7 +1293,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf69648) { - createSwDoc(DATA_DIRECTORY, "tdf69648.docx"); + createSwDoc("tdf69648.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); @@ -1332,7 +1332,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf69648) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116256) { // Open bugdoc - createSwDoc(DATA_DIRECTORY, "tdf116256.docx"); + createSwDoc("tdf116256.docx"); CPPUNIT_ASSERT(mxComponent); // Get the textbox @@ -1374,7 +1374,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116256) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138194) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "xaxis-labelbreak.docx"); + SwDoc* pDoc = createSwDoc("xaxis-labelbreak.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1391,7 +1391,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138194) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146272) { - createSwDoc(DATA_DIRECTORY, "tdf146272.odt"); + createSwDoc("tdf146272.odt"); uno::Reference xPicture(getShape(2), uno::UNO_QUERY); uno::Reference xDrawing(getShape(1), uno::UNO_QUERY); @@ -1412,7 +1412,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146272) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138773) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf138773.docx"); + SwDoc* pDoc = createSwDoc("tdf138773.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1430,7 +1430,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138773) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124796) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124796.odt"); + SwDoc* pDoc = createSwDoc("tdf124796.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1448,7 +1448,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124796) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf72727.odt"); + SwDoc* pDoc = createSwDoc("tdf72727.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1467,7 +1467,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130969.docx"); + SwDoc* pDoc = createSwDoc("tdf130969.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1482,7 +1482,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf40260.odt"); + SwDoc* pDoc = createSwDoc("tdf40260.odt"); SwDocShell* pShell = pDoc->GetDocShell(); std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); @@ -1500,7 +1500,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129054) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129054.docx"); + SwDoc* pDoc = createSwDoc("tdf129054.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1526,7 +1526,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129054) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129173) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "testAreaChartNumberFormat.docx"); + SwDoc* pDoc = createSwDoc("testAreaChartNumberFormat.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1541,7 +1541,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129173) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134866) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134866.docx"); + SwDoc* pDoc = createSwDoc("tdf134866.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1556,7 +1556,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134866) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf137116.docx"); + SwDoc* pDoc = createSwDoc("tdf137116.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1576,7 +1576,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137154) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf137154.docx"); + SwDoc* pDoc = createSwDoc("tdf137154.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1596,7 +1596,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137154) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138777) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "outside_long_data_label.docx"); + SwDoc* pDoc = createSwDoc("outside_long_data_label.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1614,7 +1614,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138777) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130031) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130031.docx"); + SwDoc* pDoc = createSwDoc("tdf130031.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1633,7 +1633,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130031) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130242) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130242.odt"); + SwDoc* pDoc = createSwDoc("tdf130242.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1660,7 +1660,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130242) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134121) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "piechart_leaderline.odt"); + SwDoc* pDoc = createSwDoc("piechart_leaderline.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1675,7 +1675,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134121) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138018) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf138018.docx"); + SwDoc* pDoc = createSwDoc("tdf138018.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1692,7 +1692,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138018) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130380) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130380.docx"); + SwDoc* pDoc = createSwDoc("tdf130380.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1715,7 +1715,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130380) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129095) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129095.docx"); + SwDoc* pDoc = createSwDoc("tdf129095.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1730,7 +1730,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129095) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf132956) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132956.docx"); + SwDoc* pDoc = createSwDoc("tdf132956.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1746,7 +1746,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf132956) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137819) { // Open the bugdoc and check if it went wrong - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf137819.fodt"); + SwDoc* pDoc = createSwDoc("tdf137819.fodt"); CPPUNIT_ASSERT(pDoc); // Change the anchor if the textbox to As_char @@ -1768,7 +1768,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137819) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122014) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf122014.docx"); + SwDoc* pDoc = createSwDoc("tdf122014.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1785,7 +1785,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122014) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134659) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134659.docx"); + SwDoc* pDoc = createSwDoc("tdf134659.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1802,7 +1802,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134659) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134235) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134235.docx"); + SwDoc* pDoc = createSwDoc("tdf134235.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1819,7 +1819,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134235) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134676) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134676.docx"); + SwDoc* pDoc = createSwDoc("tdf134676.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1836,7 +1836,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134676) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134146) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134146.docx"); + SwDoc* pDoc = createSwDoc("tdf134146.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1855,7 +1855,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134146) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136061) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf136061.docx"); + SwDoc* pDoc = createSwDoc("tdf136061.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1869,7 +1869,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136061) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116925.docx"); + SwDoc* pDoc = createSwDoc("tdf116925.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1889,7 +1889,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117028) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf117028.docx"); + SwDoc* pDoc = createSwDoc("tdf117028.docx"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1911,7 +1911,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117028) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf106390) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf106390.odt"); + SwDoc* pDoc = createSwDoc("tdf106390.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1929,7 +1929,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf106390) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion1) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "table-extrusion1.odt"); + SwDoc* pDoc = createSwDoc("table-extrusion1.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1949,7 +1949,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion1) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion2) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "table-extrusion2.odt"); + SwDoc* pDoc = createSwDoc("table-extrusion2.odt"); SwDocShell* pShell = pDoc->GetDocShell(); // Dump the rendering of the first page as an XML file. @@ -1968,14 +1968,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion2) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116848) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116848.odt"); + SwDoc* pDoc = createSwDoc("tdf116848.odt"); // This resulted in a layout loop. pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117245) { - createSwDoc(DATA_DIRECTORY, "tdf117245.odt"); + createSwDoc("tdf117245.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, TabOverMargin did not use a single line when there was // enough space for the text. @@ -1987,7 +1987,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117245) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf118672) { - createSwDoc(DATA_DIRECTORY, "tdf118672.odt"); + createSwDoc("tdf118672.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check if we have hyphenation support, otherwise can't test SwHyphPortion. @@ -2005,7 +2005,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf118672) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200) { - createSwDoc(DATA_DIRECTORY, "tdf150200.odt"); + createSwDoc("tdf150200.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // dash OUString sFirstLine @@ -2028,7 +2028,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200_DOCX) { - createSwDoc(DATA_DIRECTORY, "tdf150200.docx"); + createSwDoc("tdf150200.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // dash OUString sFirstLine @@ -2051,7 +2051,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200_DOCX) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438) { - createSwDoc(DATA_DIRECTORY, "tdf150438.odt"); + createSwDoc("tdf150438.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // left double quotation mark OUString sFirstLine @@ -2074,7 +2074,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438_DOCX) { - createSwDoc(DATA_DIRECTORY, "tdf150438.docx"); + createSwDoc("tdf150438.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // left double quotation mark OUString sFirstLine @@ -2097,7 +2097,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438_DOCX) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117923) { - createSwDoc(DATA_DIRECTORY, "tdf117923.doc"); + createSwDoc("tdf117923.doc"); // Ensure that all text portions are calculated before testing. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -2124,7 +2124,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117923) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606) { - createSwDoc(DATA_DIRECTORY, "tdf117923.docx"); + createSwDoc("tdf117923.docx"); // Ensure that all text portions are calculated before testing. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -2162,7 +2162,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118) { - createSwDoc(DATA_DIRECTORY, "tdf127118.docx"); + createSwDoc("tdf127118.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was Horizontal: merged cell split between pages didn't keep vertical writing direction assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[1]/cell[1]/txt[1]", "WritingMode", "VertBTLR"); @@ -2170,7 +2170,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220) { - createSwDoc(DATA_DIRECTORY, "tdf141220.docx"); + createSwDoc("tdf141220.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nShapeTop @@ -2182,7 +2182,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, TestTextBoxChangeViaUNO) { - CPPUNIT_ASSERT(createSwDoc(DATA_DIRECTORY, "TextBoxFrame.odt")); + CPPUNIT_ASSERT(createSwDoc("TextBoxFrame.odt")); // this file has a shape and a frame inside. Try to set up // the frame for the shape as textbox. Before this was not // implemented. This will be necessary for proper WPG import. @@ -2223,7 +2223,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, TestTextBoxChangeViaUNO) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf121509) { - auto pDoc = createSwDoc(DATA_DIRECTORY, "Tdf121509.odt"); + auto pDoc = createSwDoc("Tdf121509.odt"); CPPUNIT_ASSERT(pDoc); // Get all shape/frame formats @@ -2277,7 +2277,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf121509) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134685) { - createSwDoc(DATA_DIRECTORY, "tdf134685.docx"); + createSwDoc("tdf134685.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nWidth = getXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/infos/bounds", "width").toInt32(); @@ -2287,7 +2287,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134685) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf109077) { - createSwDoc(DATA_DIRECTORY, "tdf109077.docx"); + createSwDoc("tdf109077.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nShapeTop = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32(); @@ -2309,7 +2309,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUserFieldTypeLanguage) aOptions.Commit(); }); - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "user-field-type-language.fodt"); + SwDoc* pDoc = createSwDoc("user-field-type-language.fodt"); SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); pViewShell->UpdateFields(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -2356,7 +2356,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261) { #if !defined(_WIN32) && !defined(MACOSX) // Make sure that pressing a key in a btlr cell frame causes an immediate, correct repaint. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx"); + SwDoc* pDoc = createSwDoc("tdf124261.docx"); SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); SwFrame* pPageFrame = pLayout->GetLower(); CPPUNIT_ASSERT(pPageFrame->IsPageFrame()); @@ -2388,7 +2388,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135991) { - createSwDoc(DATA_DIRECTORY, "tdf135991.odt"); + createSwDoc("tdf135991.odt"); auto pDump = parseLayoutDump(); // There used to be negative values that made the column frames invisible. assertXPath(pDump, "//bounds[@top<0]", 0); @@ -2396,7 +2396,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135991) CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150642) { - createSwDoc(DATA_DIRECTORY, "tdf150642.odt"); + createSwDoc("tdf150642.odt"); auto pDump = parseLayoutDump(); // There used to be negative values that made the cell frame invisible. assertXPath(pDump, "//bounds[@left<0]", 0); diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index b5fa97b028ef..b9c8142090d3 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -87,7 +87,7 @@ public: utl::TempFileNamed aTempDir(nullptr, true); aTempDir.EnableKillingFile(); const OUString aWorkDir = aTempDir.GetURL(); - const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) ); + const OUString aURI( createFileURL(OUString::createFromAscii(datasource) ) ); const OUString aPrefix = column ? OUString::createFromAscii( column ) : "LOMM_"; const OUString aDBName = registerDBsource( aURI, aWorkDir ); initMailMergeJobAndArgs( filename, tablename, aDBName, aPrefix, aWorkDir, filter, selection, column != nullptr ); @@ -150,7 +150,7 @@ public: mMMargs.emplace_back( UNO_NAME_OUTPUT_TYPE, uno::Any( filter ? text::MailMergeType::FILE : text::MailMergeType::SHELL ) ); mMMargs.emplace_back( UNO_NAME_DOCUMENT_URL, uno::Any( - ( OUString( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)) ) ) ); + ( createFileURL(OUString::createFromAscii(filename)) ) ) ); mMMargs.emplace_back( UNO_NAME_DATA_SOURCE_NAME, uno::Any( aDBName ) ); mMMargs.emplace_back( UNO_NAME_OUTPUT_URL, uno::Any( aWorkDir ) ); if (filter) @@ -216,7 +216,7 @@ public: // Windows before MM uses it, MM won't work, as it's already open. // Don't move the load before the mail merge execution! // (see gb_CppunitTest_use_instdir_configuration) - load(mpTestDocumentPath, maMMtestFilename); + load(maMMtestFilename); if (mnCurOutputType == text::MailMergeType::SHELL) { diff --git a/sw/qa/extras/mailmerge/mailmerge2.cxx b/sw/qa/extras/mailmerge/mailmerge2.cxx index 687b0e3ab8fb..1d7d162968af 100644 --- a/sw/qa/extras/mailmerge/mailmerge2.cxx +++ b/sw/qa/extras/mailmerge/mailmerge2.cxx @@ -87,7 +87,7 @@ public: utl::TempFileNamed aTempDir(nullptr, true); aTempDir.EnableKillingFile(); const OUString aWorkDir = aTempDir.GetURL(); - const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) ); + const OUString aURI( createFileURL(OUString::createFromAscii(datasource)) ); const OUString aPrefix = column ? OUString::createFromAscii( column ) : "LOMM_"; const OUString aDBName = registerDBsource( aURI, aWorkDir ); initMailMergeJobAndArgs( filename, tablename, aDBName, aPrefix, aWorkDir, filter, selection, column != nullptr ); @@ -150,7 +150,7 @@ public: mMMargs.emplace_back( UNO_NAME_OUTPUT_TYPE, uno::Any( filter ? text::MailMergeType::FILE : text::MailMergeType::SHELL ) ); mMMargs.emplace_back( UNO_NAME_DOCUMENT_URL, uno::Any( - ( OUString( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)) ) ) ); + ( createFileURL(OUString::createFromAscii(filename)) ) ) ); mMMargs.emplace_back( UNO_NAME_DATA_SOURCE_NAME, uno::Any( aDBName ) ); mMMargs.emplace_back( UNO_NAME_OUTPUT_URL, uno::Any( aWorkDir ) ); if (filter) @@ -216,7 +216,7 @@ public: // Windows before MM uses it, MM won't work, as it's already open. // Don't move the load before the mail merge execution! // (see gb_CppunitTest_use_instdir_configuration) - load(mpTestDocumentPath, maMMTest2Filename); + load(maMMTest2Filename); if (mnCurOutputType == text::MailMergeType::SHELL) { diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 0fa0f9b5ed30..ec034b7f95b7 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2646,7 +2646,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles3) CPPUNIT_TEST_FIXTURE(Test, testTableStyles4) { - load(mpTestDocumentPath, "table_styles_4.odt"); + load("table_styles_4.odt"); // Test if loaded styles overwrite existing styles uno::Reference XFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFamilies(XFamiliesSupplier->getStyleFamilies()); diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 3eef5651edf5..da301082ed9a 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -633,7 +633,7 @@ DECLARE_ODFEXPORT_TEST(testTdf143605, "tdf143605.odt") CPPUNIT_TEST_FIXTURE(Test, testTdf57317_autoListName) { - load(mpTestDocumentPath, "tdf57317_autoListName.odt"); + load("tdf57317_autoListName.odt"); // The list style (from styles.xml) overrides a duplicate named auto-style //uno::Any aNumStyle = getStyles("NumberingStyles")->getByName("L1"); //CPPUNIT_ASSERT(aNumStyle.hasValue()); @@ -766,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleLink) { // Given a document with a para and a char style that links each other, when loading that // document: - load(mpTestDocumentPath, "style-link.fodt"); + load("style-link.fodt"); // Then make sure the char style links the para one: uno::Any aCharStyle = getStyles("CharacterStyles")->getByName("List Paragraph Char"); diff --git a/sw/qa/extras/odfimport/odffeatures.cxx b/sw/qa/extras/odfimport/odffeatures.cxx index 1116cfc5a60b..3f4784b929af 100644 --- a/sw/qa/extras/odfimport/odffeatures.cxx +++ b/sw/qa/extras/odfimport/odffeatures.cxx @@ -11,28 +11,20 @@ #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/odfimport/data/"; - class Test : public SwModelTestBase { public: Test() - : SwModelTestBase(DATA_DIRECTORY, "writer8") + : SwModelTestBase("/sw/qa/extras/odfimport/data/", "writer8") { } }; -CPPUNIT_TEST_FIXTURE(Test, testFeatureText) { load(mpTestDocumentPath, "feature_text.odt"); } +CPPUNIT_TEST_FIXTURE(Test, testFeatureText) { load("feature_text.odt"); } -CPPUNIT_TEST_FIXTURE(Test, testFeatureTextBold) -{ - load(mpTestDocumentPath, "feature_text_bold.odt"); -} +CPPUNIT_TEST_FIXTURE(Test, testFeatureTextBold) { load("feature_text_bold.odt"); } -CPPUNIT_TEST_FIXTURE(Test, testFeatureTextItalic) -{ - load(mpTestDocumentPath, "feature_text_italic.odt"); -} +CPPUNIT_TEST_FIXTURE(Test, testFeatureTextItalic) { load("feature_text_italic.odt"); } CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 49ebdbfdeba7..a186b2b7b216 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -60,23 +60,21 @@ typedef std::map > AllBordersMap; typedef std::pair > StringSequencePair; -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/odfimport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "writer8") {} + Test() : SwModelTestBase("/sw/qa/extras/odfimport/data/", "writer8") {} }; CPPUNIT_TEST_FIXTURE(Test, testEmptySvgFamilyName) { - load(mpTestDocumentPath, "empty-svg-family-name.odt"); + load("empty-svg-family-name.odt"); // .odt import did crash on the empty font list (which I think is valid according SVG spec) } CPPUNIT_TEST_FIXTURE(Test, testHideAllSections) { - load(mpTestDocumentPath, "fdo53210.odt"); + load("fdo53210.odt"); // This document has a section that is conditionally hidden, but has no empty paragraph after it. uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xMasters = xTextFieldsSupplier->getTextFieldMasters(); @@ -89,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHideAllSections) CPPUNIT_TEST_FIXTURE(Test, testOdtBorders) { - load(mpTestDocumentPath, "borders_ooo33.odt"); + load("borders_ooo33.odt"); AllBordersMap map; map.insert(StringSequencePair(OUString("B2"), { table::BorderLine(0, 2, 2, 35), // left @@ -274,14 +272,14 @@ CPPUNIT_TEST_FIXTURE(Test, testOdtBorders) CPPUNIT_TEST_FIXTURE(Test, testTdf41542_borderlessPadding) { - load(mpTestDocumentPath, "tdf41542_borderlessPadding.odt"); + load("tdf41542_borderlessPadding.odt"); // the page style's borderless padding should force this to 3 pages, not 1 CPPUNIT_ASSERT_EQUAL( 3, getPages() ); } CPPUNIT_TEST_FIXTURE(Test, testPageStyleLayoutDefault) { - load(mpTestDocumentPath, "hello.odt"); + load("hello.odt"); uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default Page Style"), uno::UNO_QUERY); // This was style::PageStyleLayout_MIRRORED. CPPUNIT_ASSERT_EQUAL(style::PageStyleLayout_ALL, getProperty(xPropertySet, "PageStyleLayout")); @@ -289,7 +287,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleLayoutDefault) CPPUNIT_TEST_FIXTURE(Test, testTimeFormFormats) { - load(mpTestDocumentPath, "timeFormFormats.odt"); + load("timeFormFormats.odt"); //FIXME: make it an ODFEXPORT_TEST. Validator fails with //attribute "form:current-value" has a bad value: "PT12H12M" does not satisfy the "time" type //See tdf#131127 @@ -331,7 +329,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTimeFormFormats) CPPUNIT_TEST_FIXTURE(Test, testDateFormFormats) { - load(mpTestDocumentPath, "dateFormFormats.odt"); + load("dateFormFormats.odt"); //FIXME: make it an ODFEXPORT_TEST. Validator fails with //unexpected attribute "form:input-required" //See tdf#131148 @@ -375,9 +373,9 @@ CPPUNIT_TEST_FIXTURE(Test, testDateFormFormats) CPPUNIT_TEST_FIXTURE(Test, testTdf149978) { - load(mpTestDocumentPath, "tdf149978.fodt"); + load("tdf149978.fodt"); // on Linux the bug only reproduces if a document has been loaded previously - load(mpTestDocumentPath, "tdf149978.fodt"); + load("tdf149978.fodt"); // this was nondeterministic so try 10 times for (int i = 1; i <= 10; ++i) { @@ -387,7 +385,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149978) CPPUNIT_TEST_FIXTURE(Test, testTdf64038) { - load(mpTestDocumentPath, "space.odt"); + load("space.odt"); // no space CPPUNIT_ASSERT_EQUAL(OUString("a"), getRun(getParagraph(4), 1)->getString()); CPPUNIT_ASSERT_EQUAL(OUString("b"), getRun(getParagraph(4), 2)->getString()); @@ -467,7 +465,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf64038) CPPUNIT_TEST_FIXTURE(Test, testTdf74524) { - load(mpTestDocumentPath, "tdf74524.odt"); + load("tdf74524.odt"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -492,7 +490,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf74524) CPPUNIT_TEST_FIXTURE(Test, testPageStyleLayoutRight) { - load(mpTestDocumentPath, "hello.odt"); + load("hello.odt"); uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default Page Style"), uno::UNO_QUERY); // This caused a crash. xPropertySet->setPropertyValue("PageStyleLayout", uno::Any(style::PageStyleLayout_RIGHT)); @@ -500,7 +498,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleLayoutRight) CPPUNIT_TEST_FIXTURE(Test, testFdo61952) { - load(mpTestDocumentPath, "hello.odt"); + load("hello.odt"); uno::Reference xPara(getParagraph(1), uno::UNO_QUERY); xPara->setPropertyValue("PageDescName", uno::Any(OUString("Left Page"))); xPara->setPropertyValue("PageDescName", uno::Any(OUString("Right Page"))); @@ -510,7 +508,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo61952) CPPUNIT_TEST_FIXTURE(Test, testFdo60842) { - load(mpTestDocumentPath, "fdo60842.odt"); + load("fdo60842.odt"); uno::Reference const xTable(getParagraphOrTable(1)); getCell(xTable, "A1", ""); getCell(xTable, "B1", "18/02/2012"); @@ -521,7 +519,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo60842) CPPUNIT_TEST_FIXTURE(Test, testFdo79269) { - load(mpTestDocumentPath, "fdo79269.odt"); + load("fdo79269.odt"); CPPUNIT_ASSERT_EQUAL(2, getPages()); // The problem was that the first-footer was shared. @@ -536,7 +534,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo79269) CPPUNIT_TEST_FIXTURE(Test, testFdo79269_header) { - load(mpTestDocumentPath, "fdo79269_header.odt"); + load("fdo79269_header.odt"); CPPUNIT_ASSERT_EQUAL(2, getPages()); uno::Reference xPropSet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); @@ -550,7 +548,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo79269_header) CPPUNIT_TEST_FIXTURE(Test, testPageBackground) { - load(mpTestDocumentPath, "PageBackground.odt"); + load("PageBackground.odt"); uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default Page Style"), uno::UNO_QUERY); // The background image was lost CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, getProperty(xPropertySet, "FillStyle")); @@ -566,7 +564,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBackground) CPPUNIT_TEST_FIXTURE(Test, testBibliographyEntryField) { - load(mpTestDocumentPath, "BibliographyEntryField.odt"); + load("BibliographyEntryField.odt"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -583,7 +581,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBibliographyEntryField) CPPUNIT_TEST_FIXTURE(Test, testFdo56272) { - load(mpTestDocumentPath, "fdo56272.odt"); + load("fdo56272.odt"); uno::Reference xShape = getShape(1); // Vertical position was incorrect. CPPUNIT_ASSERT_EQUAL(sal_Int32(422), xShape->getPosition().Y); // Was -2371 @@ -591,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo56272) CPPUNIT_TEST_FIXTURE(Test, testTdf128737) { - load(mpTestDocumentPath, "tdf128737.odt"); + load("tdf128737.odt"); // Without the fix in place, this test would have crashed CPPUNIT_ASSERT_EQUAL(4, getPages()); CPPUNIT_ASSERT_EQUAL(8, getShapes()); @@ -599,19 +597,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128737) CPPUNIT_TEST_FIXTURE(Test, testCalcFootnoteContent) { - load(mpTestDocumentPath, "ooo32780-1.odt"); + load("ooo32780-1.odt"); //this was a CalcFootnoteContent crash } CPPUNIT_TEST_FIXTURE(Test, testMoveSubTree) { - load(mpTestDocumentPath, "ooo77837-1.odt"); + load("ooo77837-1.odt"); //this was a MoveSubTree crash } CPPUNIT_TEST_FIXTURE(Test, testFdo75872_ooo33) { - load(mpTestDocumentPath, "fdo75872_ooo33.odt"); + load("fdo75872_ooo33.odt"); // graphics default style: line color and fill color changed uno::Reference xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(COL_BLACK, @@ -622,7 +620,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75872_ooo33) CPPUNIT_TEST_FIXTURE(Test, testFdo75872_aoo40) { - load(mpTestDocumentPath, "fdo75872_aoo40.odt"); + load("fdo75872_aoo40.odt"); // graphics default style: line color and fill color changed uno::Reference xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(Color(0x808080), @@ -633,7 +631,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75872_aoo40) CPPUNIT_TEST_FIXTURE(Test, testFdo55814) { - load(mpTestDocumentPath, "fdo55814.odt"); + load("fdo55814.odt"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -656,7 +654,7 @@ static void lcl_CheckShape( CPPUNIT_TEST_FIXTURE(Test, testFdo68839) { - load(mpTestDocumentPath, "fdo68839.odt"); + load("fdo68839.odt"); CPPUNIT_ASSERT_EQUAL(4, getShapes()); // check names lcl_CheckShape(getShape(1), "FrameXXX"); @@ -678,7 +676,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo68839) CPPUNIT_TEST_FIXTURE(Test, testFdo82165) { - load(mpTestDocumentPath, "fdo82165.odt"); + load("fdo82165.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); // there was a duplicate shape in the left header lcl_CheckShape(getShape(1), "Picture 9"); @@ -686,7 +684,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82165) CPPUNIT_TEST_FIXTURE(Test, testTdf89802) { - load(mpTestDocumentPath, "tdf89802.fodt"); + load("tdf89802.fodt"); // the text frame was dropped during import uno::Reference const xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference const xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -698,7 +696,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89802) CPPUNIT_TEST_FIXTURE(Test, testFdo37606) { - load(mpTestDocumentPath, "fdo37606.odt"); + load("fdo37606.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); @@ -745,7 +743,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo37606) #if HAVE_FEATURE_UI CPPUNIT_TEST_FIXTURE(Test, testFdo37606Copy) { - load(mpTestDocumentPath, "fdo37606.odt"); + load("fdo37606.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); @@ -773,7 +771,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo37606Copy) CPPUNIT_TEST_FIXTURE(Test, testFdo69862) { - load(mpTestDocumentPath, "fdo69862.odt"); + load("fdo69862.odt"); // The test doc is special in that it starts with a table and it also has a footnote. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -793,7 +791,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69862) CPPUNIT_TEST_FIXTURE(Test, testFdo69979) { - load(mpTestDocumentPath, "fdo69979.odt"); + load("fdo69979.odt"); // The test doc is special in that it starts with a table and it also has a header. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -813,7 +811,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69979) CPPUNIT_TEST_FIXTURE(Test, testSpellmenuRedline) { - load(mpTestDocumentPath, "spellmenu-redline.odt"); + load("spellmenu-redline.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); @@ -829,14 +827,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSpellmenuRedline) CPPUNIT_TEST_FIXTURE(Test, testTdf107776) { - load(mpTestDocumentPath, "tdf107776.fodt"); + load("tdf107776.fodt"); // Shape with a Graphics parent style name was imported as textbox. CPPUNIT_ASSERT(!getProperty(getShape(1), "TextBox")); } CPPUNIT_TEST_FIXTURE(Test, testAnnotationFormatting) { - load(mpTestDocumentPath, "annotation-formatting.odt"); + load("annotation-formatting.odt"); uno::Reference xTextField = getProperty< uno::Reference >(getRun(getParagraph(1), 1), "TextField"); uno::Reference xText = getProperty< uno::Reference >(xTextField, "TextRange"); // Make sure we test the right annotation. @@ -847,7 +845,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAnnotationFormatting) CPPUNIT_TEST_FIXTURE(Test, fdo81223) { - load(mpTestDocumentPath, "fdo81223.odt"); + load("fdo81223.odt"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); @@ -856,7 +854,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo81223) CPPUNIT_TEST_FIXTURE(Test, fdo90130_1) { - load(mpTestDocumentPath, "fdo90130-1.odt"); + load("fdo90130-1.odt"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); @@ -865,7 +863,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo90130_1) CPPUNIT_TEST_FIXTURE(Test, fdo90130_2) { - load(mpTestDocumentPath, "fdo90130-2.odt"); + load("fdo90130-2.odt"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); @@ -876,7 +874,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo90130_2) CPPUNIT_TEST_FIXTURE(Test, testBnc800714) { - load(mpTestDocumentPath, "bnc800714.fodt"); + load("bnc800714.fodt"); // Document's second paragraph wants to be together with the third one, but: // - it's in a section with multiple columns // - contains a single as-char anchored frame @@ -887,7 +885,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc800714) CPPUNIT_TEST_FIXTURE(Test, testTdf92586) { - load(mpTestDocumentPath, "tdf92586.odt"); + load("tdf92586.odt"); uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); // This was BitmapMode_NO_REPEAT. CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_STRETCH, getProperty(aPageStyle, "FillBitmapMode")); @@ -895,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92586) CPPUNIT_TEST_FIXTURE(Test, testTdf103025) { - load(mpTestDocumentPath, "tdf103025.odt"); + load("tdf103025.odt"); CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[1]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand")); CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[2]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand")); CPPUNIT_ASSERT_EQUAL(OUString("2014-02"), parseDump("/root/page[3]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand")); @@ -905,34 +903,34 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103025) CPPUNIT_TEST_FIXTURE(Test, testTdf76322_columnBreakInHeader) { - load(mpTestDocumentPath, "tdf76322_columnBreakInHeader.docx"); + load("tdf76322_columnBreakInHeader.docx"); // column breaks were ignored. First line should start in column 2 CPPUNIT_ASSERT_EQUAL( OUString("Test1"), parseDump("/root/page[1]/header/section/column[2]/body/txt/text()") ); } CPPUNIT_TEST_FIXTURE(Test, testTdf76349_1columnBreak) { - load(mpTestDocumentPath, "tdf76349_1columnBreak.odt"); + load("tdf76349_1columnBreak.odt"); //single-column breaks should only be treated as page breaks for MS formats - should be only one page here. CPPUNIT_ASSERT_EQUAL(1, getPages()); } CPPUNIT_TEST_FIXTURE(Test, testTdf96113) { - load(mpTestDocumentPath, "tdf96113.odt"); + load("tdf96113.odt"); // Background of the formula frame was white (0xffffff), not green. CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty(getShape(1), "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, testFdo47267) { - load(mpTestDocumentPath, "fdo47267-3.odt"); + load("fdo47267-3.odt"); // This was a Style Families getByName() crash } CPPUNIT_TEST_FIXTURE(Test, testTdf75221) { - load(mpTestDocumentPath, "tdf75221.odt"); + load("tdf75221.odt"); // When "Don't add space between paragraphs of the same style" setting set, // spacing between same-style paragraphs must be equal to their line spacing. // It used to be 0. @@ -942,7 +940,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf75221) CPPUNIT_TEST_FIXTURE(Test, testTdf101729) { - load(mpTestDocumentPath, "tdf101729.odt"); + load("tdf101729.odt"); sal_Int32 l = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "left").toInt32(); sal_Int32 w = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32(); sal_Int32 x = parseDump("/root/page/body/tab/row/cell[1]/txt/infos/bounds", "left").toInt32(); @@ -953,7 +951,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf101729) CPPUNIT_TEST_FIXTURE(Test, testTdf107392) { - load(mpTestDocumentPath, "tdf107392.odt"); + load("tdf107392.odt"); // Shapes from bottom to top were Frame, SVG, Bitmap, i.e. in the order as // they appeared in the document, not according to their requested z-index, // as sorting failed. @@ -966,7 +964,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107392) CPPUNIT_TEST_FIXTURE(Test, testTdf100033_1) { - load(mpTestDocumentPath, "tdf100033_1.odt"); + load("tdf100033_1.odt"); // Test document have three duplicated frames with the same name and position/size -> import one frame uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -975,7 +973,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100033_1) CPPUNIT_TEST_FIXTURE(Test, testWordAsCharShape) { - load(mpTestDocumentPath, "Word2010AsCharShape.odt"); + load("Word2010AsCharShape.odt"); // As-char shape had VertOrient "from-top"/NONE default from GetVOrient() uno::Reference const xShape(getShape(1)); CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty(xShape, "AnchorType")); @@ -987,7 +985,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWordAsCharShape) CPPUNIT_TEST_FIXTURE(Test, testTdf100033_2) { - load(mpTestDocumentPath, "tdf100033_2.odt"); + load("tdf100033_2.odt"); // Test document have three different frames anchored to different paragraphs -> import all frames uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -996,7 +994,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100033_2) CPPUNIT_TEST_FIXTURE(Test, testI61225) { - load(mpTestDocumentPath, "i61225.sxw"); + load("i61225.sxw"); // Part of ooo61225-1.sxw from crashtesting. // This never returned. @@ -1005,7 +1003,7 @@ CPPUNIT_TEST_FIXTURE(Test, testI61225) CPPUNIT_TEST_FIXTURE(Test, testTdf109080_loext_ns) { - load(mpTestDocumentPath, "tdf109080_loext_ns.odt"); + load("tdf109080_loext_ns.odt"); // Test we can import and CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header"), @@ -1021,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109080_loext_ns) CPPUNIT_TEST_FIXTURE(Test, testTdf109080_style_ns) { - load(mpTestDocumentPath, "tdf109080_style_ns.odt"); + load("tdf109080_style_ns.odt"); // Test we can import and // (produced by LibreOffice 4.0 - 5.x) @@ -1038,14 +1036,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109080_style_ns) CPPUNIT_TEST_FIXTURE(Test, testTdf109228) { - load(mpTestDocumentPath, "tdf109228.odt"); + load("tdf109228.odt"); // Embedded object with no frame name was imported incorrectly, it was anchored 'to character' instead of 'as character' CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty(getShape(1), "AnchorType")); } CPPUNIT_TEST_FIXTURE(Test, testTdf94882) { - load(mpTestDocumentPath, "tdf94882.odt"); + load("tdf94882.odt"); // Get the header of the page containing our content // (done this way to skip past any blank page inserted before it // due to the page number being even) @@ -1059,7 +1057,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94882) CPPUNIT_TEST_FIXTURE(Test, testBlankBeforeFirstPage) { - load(mpTestDocumentPath, "tdf94882.odt"); + load("tdf94882.odt"); // This document starts on page 50, which is even, but it should not have a // blank page inserted before it to make it a left page @@ -1070,13 +1068,13 @@ CPPUNIT_TEST_FIXTURE(Test, testBlankBeforeFirstPage) CPPUNIT_TEST_FIXTURE(Test, testTdf115079) { - load(mpTestDocumentPath, "tdf115079.odt"); + load("tdf115079.odt"); // This document caused segfault when layouting } CPPUNIT_TEST_FIXTURE(Test, testTdf108482) { - load(mpTestDocumentPath, "tdf108482.odt"); + load("tdf108482.odt"); CPPUNIT_ASSERT_EQUAL_MESSAGE("The table on second page must have two rows", OUString("2"), parseDump("count(/root/page[2]/body/tab/row)") ); @@ -1092,7 +1090,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108482) CPPUNIT_TEST_FIXTURE(Test, testTdf116195) { - load(mpTestDocumentPath, "tdf116195.odt"); + load("tdf116195.odt"); // The image was set to zero height due to a regression CPPUNIT_ASSERT_EQUAL( sal_Int32(12960), parseDump("/root/page/anchored/fly/notxt/infos/bounds", "height").toInt32() @@ -1101,13 +1099,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116195) CPPUNIT_TEST_FIXTURE(Test, testTdf120677) { - load(mpTestDocumentPath, "tdf120677.fodt"); + load("tdf120677.fodt"); // The document used to hang the layout, consuming memory until OOM } CPPUNIT_TEST_FIXTURE(Test, testTdf123829) { - load(mpTestDocumentPath, "tdf123829.odt"); + load("tdf123829.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -1118,7 +1116,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123829) CPPUNIT_TEST_FIXTURE(Test, testTdf113289) { - load(mpTestDocumentPath, "tdf113289.odt"); + load("tdf113289.odt"); uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); CPPUNIT_ASSERT_EQUAL(static_cast(style::FootnoteLineStyle::SOLID), getProperty(aPageStyle, "FootnoteLineStyle")); @@ -1126,7 +1124,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113289) CPPUNIT_TEST_FIXTURE(Test, testTdf123968) { - load(mpTestDocumentPath, "tdf123968.odt"); + load("tdf123968.odt"); // The test doc is special in that it starts with a table and it also has a header. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -1144,7 +1142,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123968) CPPUNIT_TEST_FIXTURE(Test, testTdf133459) { - load(mpTestDocumentPath, "tdf133459.odt"); + load("tdf133459.odt"); // Test that the number format was correctly imported, and used by both fields. uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFields(xTextFieldsSupplier->getTextFields()->createEnumeration()); @@ -1172,13 +1170,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133459) CPPUNIT_TEST_FIXTURE(Test, testTdf134971) { - load(mpTestDocumentPath, "tdf134971a.odt"); + load("tdf134971a.odt"); // now insert 2nd file somewhere - insertDocumentFromURL should // _not_ touch pool defaults uno::Sequence aPropertyValues = comphelper::InitPropertySequence( { - {"Name", uno::Any( - m_directories.getURLFromSrc(mpTestDocumentPath) + "tdf134971b.odt")}, + {"Name", uno::Any(createFileURL(u"tdf134971b.odt"))}, {"Filter", uno::Any(OUString("writer8"))}, }); dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues); @@ -1203,7 +1200,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf151375) uno::Reference xCursor(xText->createTextCursorByRange(xText->getStart()), uno::UNO_QUERY); // Without the fix in place, this test would have crashed here - xCursor->insertDocumentFromURL(m_directories.getURLFromSrc(mpTestDocumentPath) + "tdf151375.ott", {}); + xCursor->insertDocumentFromURL(createFileURL(u"tdf151375.ott"), {}); uno::Reference const xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference const xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -1217,8 +1214,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138879) uno::Sequence aPropertyValues = comphelper::InitPropertySequence( { - {"Name", uno::Any( - m_directories.getURLFromSrc(mpTestDocumentPath) + "tdf138879.odt")}, + {"Name", uno::Any(createFileURL(u"tdf138879.odt"))}, {"Filter", uno::Any(OUString("writer8"))}, }); dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues); @@ -1245,7 +1241,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat) uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xCursor(xText->createTextCursorByRange(xText->getStart()), uno::UNO_QUERY); - xCursor->insertDocumentFromURL(m_directories.getURLFromSrc(mpTestDocumentPath) + "paste-first-para-direct-format.odt", {}); + xCursor->insertDocumentFromURL(createFileURL(u"paste-first-para-direct-format.odt"), {}); // Without the accompanying fix in place, this test would have failed with: // - Expected: 3 (center) @@ -1259,7 +1255,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat) CPPUNIT_TEST_FIXTURE(Test, testVerticallyMergedCellBorder) { // Given a document with two cells, vertically merged, when loading the document: - SwDoc* pDoc = createSwDoc(mpTestDocumentPath, "vmerge-cell-border.odt"); + SwDoc* pDoc = createSwDoc("vmerge-cell-border.odt"); // Then make sure that the first cell has a right border while the second has no right border: SwDocShell* pDocShell = pDoc->GetDocShell(); @@ -1290,7 +1286,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVerticallyMergedCellBorder) CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexFirstPage) { - load(mpTestDocumentPath, "PageAnchorZIndexFirstPage.fodt"); + load("PageAnchorZIndexFirstPage.fodt"); CPPUNIT_ASSERT_EQUAL_MESSAGE("Image1 index not 0", sal_Int32(0), getProperty(getShapeByName(u"Image1"), "ZOrder")); @@ -1304,7 +1300,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexFirstPage) CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexSecondPage) { - load(mpTestDocumentPath, "PageAnchorZIndexSecondPage.fodt"); + load("PageAnchorZIndexSecondPage.fodt"); CPPUNIT_ASSERT_EQUAL_MESSAGE("Image1 index not 0", sal_Int32(0), getProperty(getShapeByName(u"Image1"), "ZOrder")); @@ -1318,7 +1314,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexSecondPage) CPPUNIT_TEST_FIXTURE(Test, testTdf146257) { - load(mpTestDocumentPath, "tdf146257.odt"); + load("tdf146257.odt"); // First list should contain no labels { @@ -1350,22 +1346,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146257) CPPUNIT_TEST_FIXTURE(Test, testTdf146597) { - load(mpTestDocumentPath, "tdf146597.odt"); + load("tdf146597.odt"); // This was crashed before. } // just care that it doesn't crash/assert CPPUNIT_TEST_FIXTURE(Test, testForcepoint101) { - load(mpTestDocumentPath, "forcepoint101.fodt"); + load("forcepoint101.fodt"); } // just care that it doesn't crash/assert CPPUNIT_TEST_FIXTURE(Test, testForcepoint108) { //load would assert because it fails to load entirely, like testMathMalformedXml - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "forcepoint108.fodt"; - mxComponent = mxDesktop->loadComponentFromURL(aURL, "_default", 0, {}); + mxComponent = mxDesktop->loadComponentFromURL(createFileURL(u"forcepoint108.fodt"), "_default", 0, {}); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 6eca75bf9087..dc5ee0a72783 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -1123,7 +1123,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95777, "tdf95777.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf94374) { - load(mpTestDocumentPath, "hello.docx"); + load("hello.docx"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 86fa7ea808a1..cad9de74fa73 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -35,12 +35,10 @@ using namespace com::sun::star; -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {} + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} }; DECLARE_OOXMLEXPORT_TEST(Tdf130907, "tdf130907.docx") @@ -75,11 +73,11 @@ DECLARE_OOXMLEXPORT_TEST(Tdf130907, "tdf130907.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf128197) { - load(mpTestDocumentPath, "128197_compat14.docx"); + load("128197_compat14.docx"); xmlDocUniquePtr pLayout14 = parseLayoutDump(); sal_Int32 nHeight14 = getXPath(pLayout14, "//page[1]/body/txt[1]/infos/bounds", "height").toInt32(); - load(mpTestDocumentPath, "128197_compat15.docx"); + load("128197_compat15.docx"); xmlDocUniquePtr pLayout15 = parseLayoutDump(); sal_Int32 nHeight15 = getXPath(pLayout15, "//page[1]/body/txt[1]/infos/bounds", "height").toInt32(); @@ -794,11 +792,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyleConfNested) assertXPath(pXmlDoc, "//w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders/w:top", "val", "nil"); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTdf133771) +CPPUNIT_TEST_FIXTURE(Test, testTdf133771) { // Create the doc model. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf133771.odt"; - loadURL(aURL, nullptr, /*pPassword*/ "test"); + load("tdf133771.odt", /*pPassword*/ "test"); CPPUNIT_ASSERT_EQUAL(OUString("Password Protected"), getParagraph(1)->getString()); @@ -812,7 +809,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTdf133771) assertXPathContent(pXmlDoc, "//w:body/w:p/w:r/w:t", "Password Protected"); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testZeroLineSpacing) +CPPUNIT_TEST_FIXTURE(Test, testZeroLineSpacing) { // Create the doc model. loadURL("private:factory/swriter", nullptr); @@ -836,7 +833,7 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testZeroLineSpacing) assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing", "line", "0"); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testSemiTransparentText) +CPPUNIT_TEST_FIXTURE(Test, testSemiTransparentText) { // Create an in-memory empty document. loadURL("private:factory/swriter", nullptr); @@ -867,19 +864,19 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testSemiTransparentText) CPPUNIT_ASSERT_EQUAL(nTransparence, nActual); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTdf147485) +CPPUNIT_TEST_FIXTURE(Test, testTdf147485) { // Before the fix this was impossible. - load(DATA_DIRECTORY, "Tdf147485.docx"); + load("Tdf147485.docx"); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTdf149546) +CPPUNIT_TEST_FIXTURE(Test, testTdf149546) { // Before the fix this was impossible. - load(DATA_DIRECTORY, "tdf149546.docx"); + load("tdf149546.docx"); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testUserField) +CPPUNIT_TEST_FIXTURE(Test, testUserField) { // Create an in-memory empty document with a user field. loadURL("private:factory/swriter", nullptr); @@ -913,11 +910,10 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testUserField) assertXPath(pXmlDoc, "//w:docVars/w:docVar", "val", "bar"); } -CPPUNIT_TEST_FIXTURE(SwModelTestBase, testHighlightEdit_numbering) +CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering) { // Create the doc model. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf135774_numberingCRProps.docx"; - loadURL(aURL, nullptr); + load("tdf135774_numberingCRProps.docx"); // This only affects when saving as w:highlight - which is not the default since 7.0. SvtFilterOptions& rOpt = SvtFilterOptions::Get(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index d7c0c5404677..ef493826439c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -21,12 +21,10 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {} + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} }; CPPUNIT_TEST_FIXTURE(Test, testTdf123621) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 3ae35e8fac4a..7d276d15bfd9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -31,12 +31,10 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {} + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} virtual std::unique_ptr preTest(const char* filename) override { @@ -151,7 +149,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134219ContourWrap_glow_rotate) getProperty(getShape(1), "BottomMargin"), 1); }; // Given a document with a shape with contour wrap, that has glow effect and rotation. - load(mpTestDocumentPath, "tdf143219ContourWrap_glow_rotate.docx"); + load("tdf143219ContourWrap_glow_rotate.docx"); // Error was, that the margins, which were added on import to approximate Word's rendering of // contour wrap, contained the effect extent for rotation. But LibreOffice extents the wrap @@ -177,7 +175,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134219ContourWrap_stroke_shadow) getProperty(getShape(1), "BottomMargin"), 1); }; // Given a document with a shape with contour wrap, that has a fat stroke and large shadow. - load(mpTestDocumentPath, "tdf143219ContourWrap_stroke_shadow.docx"); + load("tdf143219ContourWrap_stroke_shadow.docx"); // Error was, that the margins, which were added on import to approximate Word's rendering of // contour wrap, were not removed on export and so used twice on reload. @@ -641,7 +639,7 @@ DECLARE_OOXMLEXPORT_TEST(testShapeHyperlink, "hyperlinkshape.docx") CPPUNIT_TEST_FIXTURE(Test, testTextframeHyperlink) { // Make sure hyperlink is imported correctly - load(mpTestDocumentPath, "docxopenhyperlinkbox.docx"); + load("docxopenhyperlinkbox.docx"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); @@ -662,7 +660,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextframeHyperlink) CPPUNIT_TEST_FIXTURE(Test, testTdf146171_invalid_change_date) { - load(mpTestDocumentPath, "tdf146171.docx"); + load("tdf146171.docx"); // false alarm? during ODF roundtrip: // 'Error: "1970-01-01" does not satisfy the "dateTime" type' // disable and check only the conversion of the invalid (zeroed) change date @@ -716,7 +714,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEffectExtentLineWidth) // Given a document with a shape that has a non-zero line width and effect extent: // When loading the document: - load(mpTestDocumentPath, "effect-extent-line-width.docx"); + load("effect-extent-line-width.docx"); // Then make sure that the line width is not taken twice (once as part of the margin, and then // also as the line width): // Without the accompanying fix in place, this test would have failed with: @@ -731,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEffectExtentLineWidth) CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) { // Given a document with RTL gutter: - load(mpTestDocumentPath, "rtl-gutter.docx"); + load("rtl-gutter.docx"); uno::Reference xStandard(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); CPPUNIT_ASSERT(getProperty(xStandard, "RtlGutter")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 37566c4b3e70..93bd2183404d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -38,12 +38,10 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {} + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} }; DECLARE_OOXMLEXPORT_TEST(testTdf135164_cancelledNumbering, "tdf135164_cancelledNumbering.docx") @@ -213,7 +211,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135906) CPPUNIT_TEST_FIXTURE(Test, TestTdf146802) { - load(DATA_DIRECTORY, "tdf146802.docx"); + load("tdf146802.docx"); // First check if the load failed, as before the fix. CPPUNIT_ASSERT(mxComponent); @@ -989,7 +987,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148455_2, "tdf148455_2.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW) { - load(DATA_DIRECTORY, "tdf147978_enhancedPath_commandABVW.odt"); + load("tdf147978_enhancedPath_commandABVW.odt"); CPPUNIT_ASSERT(mxComponent); save("Office Open XML Text"); mxComponent->dispose(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index d95ce2fac87e..805caa65b08e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -32,12 +32,10 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {} + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} }; CPPUNIT_TEST_FIXTURE(Test, testTdf150197_predefinedNumbering) @@ -83,7 +81,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf147646, "tdf147646_mergedCellNumbering.docx") CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) { // Given a docx document with a shape with vert="mongolianVert". - load(DATA_DIRECTORY, "tdf149551_mongolianVert.docx"); + load("tdf149551_mongolianVert.docx"); // The shape is imported as custom shape with attached frame. // Without fix the shape itself had WritingMode = 0 = LR_TB, @@ -121,7 +119,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberPortionFormatFromODT) { // Given a document with a single paragraph, direct formatting asks 24pt font size for the // numbering and the text portion: - load(DATA_DIRECTORY, "number-portion-format.odt"); + load("number-portion-format.odt"); // When saving to DOCX: save("Office Open XML Text"); @@ -141,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150966_regularInset) { // Given a docx document with a rectangular shape with height cy="900000" (EMU), tIns="180000" // and bIns="360000", resulting in 360000EMU text area height. - load(DATA_DIRECTORY, "tdf150966_regularInset.docx"); + load("tdf150966_regularInset.docx"); // The shape is imported as custom shape with attached frame. // The insets are currently imported as margin top="4.99mm" and bottom="10mm". diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 25682f90bf11..7103bf762c28 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -796,7 +796,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_true) officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(true, batch); batch->commit(); - load(mpTestDocumentPath, "combobox-control.docx"); + load("combobox-control.docx"); verifyComboBoxExport(true); } @@ -806,7 +806,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf134043_ImportComboBoxAsDropDown_false) officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::set(false, batch); batch->commit(); - load(mpTestDocumentPath, "combobox-control.docx"); + load("combobox-control.docx"); verifyComboBoxExport(false); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index c7e48a63d4ac..cb191eed4015 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -21,12 +21,10 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlexport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {} + Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} }; DECLARE_OOXMLEXPORT_TEST(testFdo47669, "fdo47669.docx") @@ -871,8 +869,7 @@ DECLARE_OOXMLEXPORT_TEST( testSdtDatePicker, "test_sdt_datepicker.docx" ) CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag) { // Given a document with a tag: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "content-control-grab-bag.docx"; - loadURL(aURL, nullptr); + load("content-control-grab-bag.docx"); // When exporting that document back to DOCX: // Then make sure that completes without an assertion failure, which would mean not-well-formed @@ -883,8 +880,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag) CPPUNIT_TEST_FIXTURE(Test, testContentControlShape) { // Given a document with a tag: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "content-control-shape.docx"; - loadURL(aURL, nullptr); + load("content-control-shape.docx"); // When exporting that document back to DOCX: // Then make sure that completes without an assertion failure, which would mean not-well-formed @@ -895,8 +891,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlShape) CPPUNIT_TEST_FIXTURE(Test, testTdf104823) { // Test how we can roundtrip sdt plain text with databindings support - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf104823.docx"; - loadURL(aURL, nullptr); + load("tdf104823.docx"); // First paragraph: content from core properties uno::Reference xParagraph1 = getParagraph(1); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 995d7bc2e4f0..51b72ef71300 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -66,33 +66,30 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlimport/data/"; - class Test : public SwModelTestBase { public: - Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") + Test() : SwModelTestBase("/sw/qa/extras/ooxmlimport/data/", "Office Open XML Text") { } }; CPPUNIT_TEST_FIXTURE(Test, testImageHyperlink) { - load(mpTestDocumentPath, "image-hyperlink.docx"); + load("image-hyperlink.docx"); OUString URL = getProperty(getShape(1), "HyperLinkURL"); CPPUNIT_ASSERT_EQUAL(OUString("http://www.libreoffice.org/"), URL); } CPPUNIT_TEST_FIXTURE(Test, testMathMalformedXml) { - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "math-malformed_xml.docx"; - mxComponent = mxDesktop->loadComponentFromURL(aURL, "_default", 0, {}); + mxComponent = mxDesktop->loadComponentFromURL(createFileURL(u"math-malformed_xml.docx"), "_default", 0, {}); CPPUNIT_ASSERT(!mxComponent.is()); } CPPUNIT_TEST_FIXTURE(Test, testTdf103931) { - load(mpTestDocumentPath, "tdf103931.docx"); + load("tdf103931.docx"); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); // This was 2, the last (empty) section of the document was lost on import. @@ -102,7 +99,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103931) CPPUNIT_TEST_FIXTURE(Test, testN751017) { - load(mpTestDocumentPath, "n751017.docx"); + load("n751017.docx"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xMasters(xTextFieldsSupplier->getTextFieldMasters()); // Make sure we have a variable named foo. @@ -149,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN751017) CPPUNIT_TEST_FIXTURE(Test, testN757890) { - load(mpTestDocumentPath, "n757890.docx"); + load("n757890.docx"); // The w:pStyle token affected the text outside the textbox. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); @@ -170,7 +167,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN757890) CPPUNIT_TEST_FIXTURE(Test, testN751077) { - load(mpTestDocumentPath, "n751077.docx"); + load("n751077.docx"); /* xray ThisComponent.DrawPage(1).getByIndex(0).String xray ThisComponent.DrawPage(1).getByIndex(0).Anchor.PageStyleName @@ -186,7 +183,7 @@ xray ThisComponent.DrawPage(1).getByIndex(0).Anchor.PageStyleName CPPUNIT_TEST_FIXTURE(Test, testTdf129237) { - load(mpTestDocumentPath, "tdf129237.docx"); + load("tdf129237.docx"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -230,7 +227,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129237) CPPUNIT_TEST_FIXTURE(Test, testTdf134572) { - load(mpTestDocumentPath, "tdf134572.docx"); + load("tdf134572.docx"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -259,7 +256,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134572) CPPUNIT_TEST_FIXTURE(Test, testTdf128076) { - load(mpTestDocumentPath, "tdf128076.docx"); + load("tdf128076.docx"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); @@ -276,7 +273,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128076) CPPUNIT_TEST_FIXTURE(Test, testfdo90720) { - load(mpTestDocumentPath, "testfdo90720.docx"); + load("testfdo90720.docx"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); @@ -289,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo90720) CPPUNIT_TEST_FIXTURE(Test, testN760764) { - load(mpTestDocumentPath, "n760764.docx"); + load("n760764.docx"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); @@ -307,7 +304,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN760764) CPPUNIT_TEST_FIXTURE(Test, testN764745) { - load(mpTestDocumentPath, "n764745-alignment.docx"); + load("n764745-alignment.docx"); /* shape = ThisComponent.DrawPage.getByIndex(0) xray shape.AnchorType @@ -336,14 +333,14 @@ xray ThisComponent.StyleFamilies.PageStyles.Default.Width CPPUNIT_TEST_FIXTURE(Test, testTdf115719b) { - load(mpTestDocumentPath, "tdf115719b.docx"); + load("tdf115719b.docx"); // This was 0, 4th (last) paragraph had no increased spacing. CPPUNIT_ASSERT(getProperty(getParagraph(4), "ParaTopMargin") > 0); } CPPUNIT_TEST_FIXTURE(Test, testN766477) { - load(mpTestDocumentPath, "n766477.docx"); + load("n766477.docx"); /* * The problem was that the checkbox was not checked. * @@ -367,7 +364,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN766477) CPPUNIT_TEST_FIXTURE(Test, testTdf130804) { - load(mpTestDocumentPath, "tdf130804.docx"); + load("tdf130804.docx"); OUString flyHeight = parseDump("/root/page/body/txt[1]/infos/bounds", "height"); OUString txtHeight = parseDump("/root/page/body/txt[1]/anchored/fly/infos/bounds", "height"); @@ -381,7 +378,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130804) CPPUNIT_TEST_FIXTURE(Test, testN758883) { - load(mpTestDocumentPath, "n758883.docx"); + load("n758883.docx"); /* * The problem was that direct formatting of the paragraph was not applied * to the numbering. This is easier to test using a layout dump. @@ -462,7 +459,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN758883) CPPUNIT_TEST_FIXTURE(Test, testTdf74367_MarginsZeroed) { - load(mpTestDocumentPath, "tdf74367_MarginsZeroed.docx"); + load("tdf74367_MarginsZeroed.docx"); // Do not import page borders with 'None' style, or else it will change the page margins. uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); sal_Int32 nValue = 0; @@ -478,7 +475,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf74367_MarginsZeroed) CPPUNIT_TEST_FIXTURE(Test, testBnc773061) { - load(mpTestDocumentPath, "bnc773061.docx"); + load("bnc773061.docx"); uno::Reference< text::XTextRange > paragraph = getParagraph( 1 ); uno::Reference< text::XTextRange > normal = getRun( paragraph, 1, "Normal " ); uno::Reference< text::XTextRange > raised = getRun( paragraph, 2, "Raised" ); @@ -493,7 +490,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc773061) CPPUNIT_TEST_FIXTURE(Test, testN775899) { - load(mpTestDocumentPath, "n775899.docx"); + load("n775899.docx"); /* * The problem was that a floating table wasn't imported as a frame, then it contained fake paragraphs. * @@ -518,7 +515,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN775899) CPPUNIT_TEST_FIXTURE(Test, testN777345) { - load(mpTestDocumentPath, "n777345.docx"); + load("n777345.docx"); // The problem was that v:imagedata inside v:rect was ignored. uno::Reference xSupplier(getShape(1), uno::UNO_QUERY); uno::Reference xGraphic = xSupplier->getReplacementGraphic(); @@ -533,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN777345) CPPUNIT_TEST_FIXTURE(Test, testN778140) { - load(mpTestDocumentPath, "n778140.docx"); + load("n778140.docx"); /* * The problem was that the paragraph top/bottom margins were incorrect due * to unhandled w:doNotUseHTMLParagraphAutoSpacing. @@ -544,7 +541,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN778140) CPPUNIT_TEST_FIXTURE(Test, testInk) { - load(mpTestDocumentPath, "ink.docx"); + load("ink.docx"); /* * The problem was that ~nothing was imported, except an empty CustomShape. * @@ -556,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInk) CPPUNIT_TEST_FIXTURE(Test, testN779627) { - load(mpTestDocumentPath, "n779627.docx"); + load("n779627.docx"); /* * The problem was that the table left position was based on the tableCellMar left value * even for nested tables, while it shouldn't. @@ -580,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN779627) CPPUNIT_TEST_FIXTURE(Test, testN779627b) { - load(mpTestDocumentPath, "n779627b.docx"); + load("n779627b.docx"); /* * Another problem tested with the original n779627.docx document (before removing its unnecessary * shape loading) is that the roundrect is centered vertically and horizontally. @@ -602,7 +599,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN779627b) CPPUNIT_TEST_FIXTURE(Test, testN782061) { - load(mpTestDocumentPath, "n782061.docx"); + load("n782061.docx"); /* * The problem was that the character escapement in the second run was -58. */ @@ -611,7 +608,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN782061) CPPUNIT_TEST_FIXTURE(Test, testN773061) { - load(mpTestDocumentPath, "n773061.docx"); + load("n773061.docx"); // xray ThisComponent.TextFrames(0).LeftBorderDistance uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -624,7 +621,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN773061) CPPUNIT_TEST_FIXTURE(Test, testN780645) { - load(mpTestDocumentPath, "n780645.docx"); + load("n780645.docx"); // The problem was that when the number of cells didn't match the grid, we // didn't take care of direct cell widths. uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -636,7 +633,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN780645) CPPUNIT_TEST_FIXTURE(Test, testWordArtResizing) { - load(mpTestDocumentPath, "WordArt.docx"); + load("WordArt.docx"); /* The Word-Arts and watermarks were getting resized automatically, It was as if they were getting glued to the fallback geometry(the sdrObj) and were getting bound to the font size. The test-case ensures the original height and width of the word-art is not changed while importing*/ @@ -649,7 +646,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWordArtResizing) CPPUNIT_TEST_FIXTURE(Test, testGroupshapeLine) { - load(mpTestDocumentPath, "groupshape-line.docx"); + load("groupshape-line.docx"); /* * Another fallout from n#792778, this time first the lines inside a * groupshape wasn't imported, then the fix broke the size/position of @@ -679,7 +676,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupshapeLine) CPPUNIT_TEST_FIXTURE(Test, testGroupshapeChildRotation) { - load(mpTestDocumentPath, "groupshape-child-rotation.docx"); + load("groupshape-child-rotation.docx"); // The problem was that (due to incorrect handling of rotation inside // groupshapes), the first child wasn't in the top left corner of an inline // groupshape. @@ -705,7 +702,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupshapeChildRotation) CPPUNIT_TEST_FIXTURE(Test, testTableWidth) { - load(mpTestDocumentPath, "table_width.docx"); + load("table_width.docx"); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); // Relative width wasn't recognized during import. @@ -718,7 +715,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableWidth) CPPUNIT_TEST_FIXTURE(Test, testN820788) { - load(mpTestDocumentPath, "n820788.docx"); + load("n820788.docx"); // The problem was that AutoSize was not enabled for the text frame. uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -729,7 +726,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN820788) CPPUNIT_TEST_FIXTURE(Test, testN820504) { - load(mpTestDocumentPath, "n820504.docx"); + load("n820504.docx"); uno::Reference xFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFamiliesAccess = xFamiliesSupplier->getStyleFamilies(); uno::Reference xStylesAccess(xFamiliesAccess->getByName("ParagraphStyles"), uno::UNO_QUERY); @@ -744,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN820504) CPPUNIT_TEST_FIXTURE(Test, testFdo43641) { - load(mpTestDocumentPath, "fdo43641.docx"); + load("fdo43641.docx"); uno::Reference xGroupLockedCanvas(getShape(1), uno::UNO_QUERY); uno::Reference xGroupShape(xGroupLockedCanvas->getByIndex(0), uno::UNO_QUERY); uno::Reference xLine(xGroupShape->getByIndex(1), uno::UNO_QUERY); @@ -755,7 +752,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo43641) CPPUNIT_TEST_FIXTURE(Test, testGroupshapeSdt) { - load(mpTestDocumentPath, "groupshape-sdt.docx"); + load("groupshape-sdt.docx"); // All problems here are due to the groupshape: we have a drawinglayer rectangle, not a writer textframe. uno::Reference xOuterGroupShape(getShape(1), uno::UNO_QUERY); uno::Reference xInnerGroupShape(xOuterGroupShape->getByIndex(0), uno::UNO_QUERY); @@ -778,14 +775,14 @@ static void lcl_countTextFrames(const css::uno::Reference< lang::XComponent >& x CPPUNIT_TEST_FIXTURE(Test, testBnc779620) { - load(mpTestDocumentPath, "bnc779620.docx"); + load("bnc779620.docx"); // The problem was that the floating table was imported as a non-floating one. lcl_countTextFrames( mxComponent, 1 ); } CPPUNIT_TEST_FIXTURE(Test, testTdf105127) { - load(mpTestDocumentPath, "tdf105127.docx"); + load("tdf105127.docx"); auto aPolyPolygon = getProperty(getShape(1), "PolyPolygonBezier"); // tdf#106792 These values were wrong all the time due to a missing // conversion in SvxShapePolyPolygon::getPropertyValueImpl. There was no @@ -797,7 +794,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105127) CPPUNIT_TEST_FIXTURE(Test, testTdf105143) { - load(mpTestDocumentPath, "tdf105143.docx"); + load("tdf105143.docx"); OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top"); // This was 6272, i.e. the shape was moved up (incorrect position) to be // inside the page rectangle. @@ -806,7 +803,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105143) CPPUNIT_TEST_FIXTURE(Test, testTdf105975) { - load(mpTestDocumentPath, "105975.docx"); + load("105975.docx"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xMasters(xTextFieldsSupplier->getTextFieldMasters()); // Make sure we have a variable named TEST_VAR. @@ -815,7 +812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105975) CPPUNIT_TEST_FIXTURE(Test, testfdo76583) { - load(mpTestDocumentPath, "fdo76583.docx"); + load("fdo76583.docx"); // The problem was that the floating table was imported as a non-floating one. // floating tables are imported as text frames, therefore the document should // exactly 1 text frame. @@ -824,7 +821,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo76583) CPPUNIT_TEST_FIXTURE(Test, testTdf105975formula) { - load(mpTestDocumentPath, "tdf105975.docx"); + load("tdf105975.docx"); // Make sure the field contains a formula with 10 + 15 uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -842,7 +839,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105975formula) CPPUNIT_TEST_FIXTURE(Test, testTdf133647) { - load(mpTestDocumentPath, "tdf133647.docx"); + load("tdf133647.docx"); /* Tests that argument lists, cell references, and cell ranges are translated correctly * when importing table formulae from MS Word */ uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -893,7 +890,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647) CPPUNIT_TEST_FIXTURE(Test, testTdf123386) { - load(mpTestDocumentPath, "tdf123386.docx"); + load("tdf123386.docx"); /* Tests that argument lists, cell references, and cell ranges are translated correctly * when importing table formulae from MS Word */ uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -950,7 +947,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123386) CPPUNIT_TEST_FIXTURE(Test, testTdf133647_unicode) { - load(mpTestDocumentPath, "tdf133647_unicode.docx"); + load("tdf133647_unicode.docx"); /* Tests that non-ASCII characters in formulas are preserved when importing from MS Word */ uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -977,7 +974,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647_unicode) CPPUNIT_TEST_FIXTURE(Test, testTdf123389) { - load(mpTestDocumentPath, "tdf123389.docx"); + load("tdf123389.docx"); /* Tests that argument lists, cell references, and cell ranges are translated correctly * when importing table formulae from MS Word */ uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -1001,7 +998,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123389) CPPUNIT_TEST_FIXTURE(Test, testTdf107784) { - load(mpTestDocumentPath, "tdf107784.docx"); + load("tdf107784.docx"); // Make sure the field displays the citation's title and not the identifier uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -1019,14 +1016,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107784) CPPUNIT_TEST_FIXTURE(Test, testTdf115883) { - load(mpTestDocumentPath, "tdf115883.docx"); + load("tdf115883.docx"); // Import failed due to an unhandled exception when getting the Surround // property of a not yet inserted frame. } CPPUNIT_TEST_FIXTURE(Test, testTdf75573) { - load(mpTestDocumentPath, "tdf75573_page1frame.docx"); + load("tdf75573_page1frame.docx"); // the problem was that the frame was discarded // when an unrelated, unused, odd-header was flagged as discardable lcl_countTextFrames( mxComponent, 1 ); @@ -1053,7 +1050,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf75573) CPPUNIT_TEST_FIXTURE(Test, testTdf75573_lostTable) { - load(mpTestDocumentPath, "tdf75573_lostTable.docx"); + load("tdf75573_lostTable.docx"); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE("# of tables", sal_Int32(1), xTables->getCount() ); @@ -1065,7 +1062,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf75573_lostTable) CPPUNIT_TEST_FIXTURE(Test, testTdf109316_dropCaps) { - load(mpTestDocumentPath, "tdf109316_dropCaps.docx"); + load("tdf109316_dropCaps.docx"); uno::Reference xSet(getParagraph(1), uno::UNO_QUERY); css::style::DropCapFormat aDropCap = getProperty(xSet,"DropCapFormat"); CPPUNIT_ASSERT_EQUAL( sal_Int8(2), aDropCap.Lines ); @@ -1087,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109316_dropCaps) CPPUNIT_TEST_FIXTURE(Test, lineWpsOnly) { - load(mpTestDocumentPath, "line-wps-only.docx"); + load("line-wps-only.docx"); uno::Reference xShape = getShape(1); // Check position, it was -7223 as it was set after the CustomShapeGeometry property. CPPUNIT_ASSERT_EQUAL(sal_Int32(210), xShape->getPosition().X); @@ -1095,7 +1092,7 @@ CPPUNIT_TEST_FIXTURE(Test, lineWpsOnly) CPPUNIT_TEST_FIXTURE(Test, lineRotation) { - load(mpTestDocumentPath, "line-rotation.docx"); + load("line-rotation.docx"); uno::Reference xShape = getShape(3); // This was 5096: the line was shifted towards the bottom, so the end of // the 3 different lines wasn't at the same point. @@ -1104,7 +1101,7 @@ CPPUNIT_TEST_FIXTURE(Test, lineRotation) CPPUNIT_TEST_FIXTURE(Test, textboxWpsOnly) { - load(mpTestDocumentPath, "textbox-wps-only.docx"); + load("textbox-wps-only.docx"); uno::Reference xFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("Hello world!"), xFrame->getString()); // Position wasn't horizontally centered. @@ -1127,14 +1124,14 @@ CPPUNIT_TEST_FIXTURE(Test, textboxWpsOnly) CPPUNIT_TEST_FIXTURE(Test, testGroupshapeRelsize) { - load(mpTestDocumentPath, "groupshape-relsize.docx"); + load("groupshape-relsize.docx"); // This was 43760, i.e. the height of the groupshape was larger than the page height, which is obviously incorrect. CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(9142730), getShape(1)->getSize().Height); } CPPUNIT_TEST_FIXTURE(Test, testOleAnchor) { - load(mpTestDocumentPath, "ole-anchor.docx"); + load("ole-anchor.docx"); // This was AS_CHARACTER, even if the VML style explicitly contains "position:absolute". CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty(getShape(1), "AnchorType")); // This was DYNAMIC, even if the default is THROUGH and there is no w10:wrap element in the bugdoc. @@ -1143,7 +1140,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOleAnchor) CPPUNIT_TEST_FIXTURE(Test, testTdf48658_transparentOLEheader) { - load(mpTestDocumentPath, "tdf48658_transparentOLEheader.docx"); + load("tdf48658_transparentOLEheader.docx"); // The problem was that the shape in the header was hidden in the background. // The round-tripped document was always fine (even before the fix) but the shape numbers change, so import-only test. CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), "Opaque")); @@ -1151,7 +1148,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf48658_transparentOLEheader) CPPUNIT_TEST_FIXTURE(Test, testDMLGroupShapeParaAdjust) { - load(mpTestDocumentPath, "dml-groupshape-paraadjust.docx"); + load("dml-groupshape-paraadjust.docx"); // Paragraph adjustment inside a group shape was not imported uno::Reference xGroup(getShape(1), uno::UNO_QUERY); uno::Reference xText = uno::Reference(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText(); @@ -1171,14 +1168,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDMLGroupShapeParaAdjust) CPPUNIT_TEST_FIXTURE(Test, testTdf99135) { - load(mpTestDocumentPath, "tdf99135.docx"); + load("tdf99135.docx"); // This was 0, crop was ignored on VML import. CPPUNIT_ASSERT_EQUAL(static_cast(1825), getProperty(getShape(1), "GraphicCrop").Bottom); } CPPUNIT_TEST_FIXTURE(Test, testTdf85523) { - load(mpTestDocumentPath, "tdf85523.docx"); + load("tdf85523.docx"); auto xTextField = getProperty< uno::Reference >(getRun(getParagraph(1), 7), "TextField"); auto xText = getProperty< uno::Reference >(xTextField, "TextRange"); // This was "commentX": an unexpected extra char was added at the comment end. @@ -1187,14 +1184,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf85523) CPPUNIT_TEST_FIXTURE(Test, testStrictLockedcanvas) { - load(mpTestDocumentPath, "strict-lockedcanvas.docx"); + load("strict-lockedcanvas.docx"); // locked canvas shape was missing. getShape(1); } CPPUNIT_TEST_FIXTURE(Test, testFdo75722vml) { - load(mpTestDocumentPath, "fdo75722-vml.docx"); + load("fdo75722-vml.docx"); uno::Reference xShape = getShape(1); awt::Point aPos = xShape->getPosition(); awt::Size aSize = xShape->getSize(); @@ -1209,7 +1206,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75722vml) CPPUNIT_TEST_FIXTURE(Test, testFdo75722dml) { - load(mpTestDocumentPath, "fdo75722-dml.docx"); + load("fdo75722-dml.docx"); uno::Reference xShape = getShape(1); awt::Point aPos = xShape->getPosition(); awt::Size aSize = xShape->getSize(); @@ -1225,7 +1222,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75722dml) CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumnsCompat) { - load(mpTestDocumentPath, "unbalanced-columns-compat.docx"); + load("unbalanced-columns-compat.docx"); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); // This was false, we ignored the relevant compat setting to make this non-last section unbalanced. @@ -1234,7 +1231,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumnsCompat) CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionColumns) { - load(mpTestDocumentPath, "floating-table-section-columns.docx"); + load("floating-table-section-columns.docx"); OUString tableWidth = parseDump("/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds", "width"); // table width was restricted by a column CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 ); @@ -1247,7 +1244,7 @@ static OString dateTimeToString( const util::DateTime& dt ) CPPUNIT_TEST_FIXTURE(Test, testBnc821804) { - load(mpTestDocumentPath, "bnc821804.docx"); + load("bnc821804.docx"); CPPUNIT_ASSERT_EQUAL( OUString( "TITLE" ), getRun( getParagraph( 1 ), 1 )->getString()); CPPUNIT_ASSERT(!hasProperty(getRun(getParagraph(1), 1), "RedlineType")); // Redline information (SwXRedlinePortion) are separate "runs" apparently. @@ -1378,7 +1375,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo87488) // StarView MetaFile. SvtFilterOptions::Get().SetSmartArt2Shape(true); comphelper::ScopeGuard g([] { SvtFilterOptions::Get().SetSmartArt2Shape(false); }); - load(mpTestDocumentPath, "fdo87488.docx"); + load("fdo87488.docx"); uno::Reference group(getShape(1), uno::UNO_QUERY); { uno::Reference text(group->getByIndex(1), uno::UNO_QUERY); @@ -1395,7 +1392,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo87488) CPPUNIT_TEST_FIXTURE(Test, testTdf85232) { - load(mpTestDocumentPath, "tdf85232.docx"); + load("tdf85232.docx"); uno::Reference xShapes(getShapeByName(u"Group 219"), uno::UNO_QUERY); uno::Reference xShape(xShapes->getByIndex(1), uno::UNO_QUERY); uno::Reference xShapeDescriptor = xShape; @@ -1408,7 +1405,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf85232) CPPUNIT_TEST_FIXTURE(Test, testTdf95755) { - load(mpTestDocumentPath, "tdf95755.docx"); + load("tdf95755.docx"); /* * The problem was that the width of a second table with single cell was discarded * and resulted in too wide table @@ -1424,7 +1421,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95755) CPPUNIT_TEST_FIXTURE(Test, testTdf60351) { - load(mpTestDocumentPath, "tdf60351.docx"); + load("tdf60351.docx"); // Get the first image in the document and check its contour polygon. // It should contain 6 points. Check their coordinates. uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); @@ -1452,7 +1449,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf60351) CPPUNIT_TEST_FIXTURE(Test, testTdf95970) { - load(mpTestDocumentPath, "tdf95970.docx"); + load("tdf95970.docx"); // First shape: the rotation should be -12.94 deg, it should be mirrored. // Proper color order of image on test doc (left->right): // top row: green->red @@ -1480,7 +1477,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95970) CPPUNIT_TEST_FIXTURE(Test, testTdf96674) { - load(mpTestDocumentPath, "tdf96674.docx"); + load("tdf96674.docx"); uno::Reference xShape = getShape(1); CPPUNIT_ASSERT(xShape.is()); awt::Size aActualSize(xShape->getSize()); @@ -1491,7 +1488,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96674) CPPUNIT_TEST_FIXTURE(Test, testTdf122717) { - load(mpTestDocumentPath, "tdf122717.docx"); + load("tdf122717.docx"); uno::Reference xShape = getShape(1); CPPUNIT_ASSERT(xShape.is()); awt::Size aActualSize(xShape->getSize()); @@ -1505,7 +1502,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122717) CPPUNIT_TEST_FIXTURE(Test, testTdf98882) { - load(mpTestDocumentPath, "tdf98882.docx"); + load("tdf98882.docx"); sal_Int32 nFlyHeight = parseDump("//anchored/fly/infos/bounds", "height").toInt32(); sal_Int32 nContentHeight = parseDump("//notxt/infos/bounds", "height").toInt32(); // The content height was 600, not 360, so the frame and the content height did not match. @@ -1514,14 +1511,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf98882) CPPUNIT_TEST_FIXTURE(Test, testTdf100830) { - load(mpTestDocumentPath, "tdf100830.docx"); + load("tdf100830.docx"); // FillTransparence wasn't imported, this was 0. CPPUNIT_ASSERT_EQUAL(static_cast(30), getProperty(getShape(1), "FillTransparence")); } CPPUNIT_TEST_FIXTURE(Test, testTdf103664) { - load(mpTestDocumentPath, "tdf103664.docx"); + load("tdf103664.docx"); // Wingdings symbols were displayed as rectangles uno::Reference xPara(getParagraph(1)); CPPUNIT_ASSERT_EQUAL(u'\xf020', xPara->getString()[0] ); @@ -1540,21 +1537,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103664) CPPUNIT_TEST_FIXTURE(Test, testTdf82824) { - load(mpTestDocumentPath, "tdf82824.docx"); + load("tdf82824.docx"); // This was text::TextContentAnchorType_AS_CHARACTER, wasn't handled on import for the chart. CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty(getShape(1), "AnchorType")); } CPPUNIT_TEST_FIXTURE(Test, testTdf96218) { - load(mpTestDocumentPath, "tdf96218.docx"); + load("tdf96218.docx"); // Image had a bad position because layoutInCell attribute was not ignored CPPUNIT_ASSERT(!getProperty(getShape(1), "IsFollowingTextFlow")); } CPPUNIT_TEST_FIXTURE(Test, testTdf101626) { - load(mpTestDocumentPath, "tdf101626.docx"); + load("tdf101626.docx"); // Transform soft-hyphen to hard-hyphen as list bulletChar to avoid missing symbols in export uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); @@ -1574,7 +1571,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf101626) CPPUNIT_TEST_FIXTURE(Test, testTdf106606) { - load(mpTestDocumentPath, "tdf106606.docx" ); + load("tdf106606.docx" ); auto FindGraphicBitmapPropertyInNumStyle = [&]( OUString rStyleName ) { uno::Reference xPropertySet( getStyles( "NumberingStyles" )->getByName( rStyleName ), uno::UNO_QUERY ); @@ -1598,7 +1595,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106606) CPPUNIT_TEST_FIXTURE(Test, testTdf101627) { - load(mpTestDocumentPath, "tdf101627.docx"); + load("tdf101627.docx"); // Do not shrink the textbox in the footer uno::Reference xFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xFrame->getString().startsWith( "1" ) ); @@ -1607,7 +1604,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf101627) CPPUNIT_TEST_FIXTURE(Test, testTdf133448) { - load(mpTestDocumentPath, "tdf133448.docx"); + load("tdf133448.docx"); auto xGraphic = getProperty>(getShape(1), "Graphic"); Graphic aGraphic(xGraphic); uno::Reference xGraphicDescriptor(xGraphic, uno::UNO_QUERY_THROW); @@ -1621,7 +1618,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133448) CPPUNIT_TEST_FIXTURE(Test, testTdf100072) { - load(mpTestDocumentPath, "tdf100072.docx"); + load("tdf100072.docx"); uno::Reference xShape = getShape(1); // Ensure that shape has non-zero height @@ -1664,7 +1661,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100072) CPPUNIT_TEST_FIXTURE(Test, testTdf76446) { - load(mpTestDocumentPath, "tdf76446.docx"); + load("tdf76446.docx"); uno::Reference xShape = getShape(1); sal_Int64 nRot = getProperty(xShape, "RotateAngle"); CPPUNIT_ASSERT_EQUAL(sal_Int64(3128), nRot); @@ -1672,7 +1669,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf76446) CPPUNIT_TEST_FIXTURE(Test, testTdf108350) { - load(mpTestDocumentPath, "tdf108350.docx"); + load("tdf108350.docx"); // For OOXML without explicit font information, font needs to be Calibri 11 pt uno::Reference xPara(getParagraph(1)); uno::Reference xRun(getRun(xPara, 1), uno::UNO_QUERY); @@ -1682,7 +1679,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108350) CPPUNIT_TEST_FIXTURE(Test, testTdf108408) { - load(mpTestDocumentPath, "tdf108408.docx"); + load("tdf108408.docx"); // Font size must consider units specifications; previously ignored and only used // integer part as half-pt size, i.e. 10 pt (20 half-pt) instead of 20 pt uno::Reference xPara(getParagraph(1)); @@ -1692,7 +1689,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108408) CPPUNIT_TEST_FIXTURE(Test, testTdf108806) { - load(mpTestDocumentPath, "tdf108806.docx"); + load("tdf108806.docx"); // tdf#108806:The CRLF in the text contents of XML must be converted to single spaces. CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); uno::Reference< text::XTextRange > paragraph = getParagraph(1); @@ -1703,7 +1700,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108806) CPPUNIT_TEST_FIXTURE(Test, testTdf87533_bidi) { - load(mpTestDocumentPath, "tdf87533_bidi.docx"); + load("tdf87533_bidi.docx"); // "w:bidi" (specified inside Default paragraph properties) should not be ignored static const OUStringLiteral writingMode = u"WritingMode"; //getPropertyName(PROP_WRITING_MODE); @@ -1736,7 +1733,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf87533_bidi) CPPUNIT_TEST_FIXTURE(Test, testVmlAdjustments) { - load(mpTestDocumentPath, "vml-adjustments.docx"); + load("vml-adjustments.docx"); uno::Reference xPropertySet(getShape(1), uno::UNO_QUERY); comphelper::SequenceAsHashMap aGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); uno::Sequence aAdjustmentValues = @@ -1748,7 +1745,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlAdjustments) CPPUNIT_TEST_FIXTURE(Test, testTdf108714) { - load(mpTestDocumentPath, "tdf108714.docx"); + load("tdf108714.docx"); CPPUNIT_ASSERT_EQUAL(6, getParagraphs()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Page break is absent - we lost bug-to-bug compatibility with Word", 4, getPages()); @@ -1808,7 +1805,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108714) CPPUNIT_TEST_FIXTURE(Test, testTdf136952_pgBreak3) { - load(mpTestDocumentPath, "tdf136952_pgBreak3.docx"); + load("tdf136952_pgBreak3.docx"); // The original 6 page ODT was designed to visually exaggerate the problems // of emulating LO's followed-by-page-style into MSWord's sections. // While much has been improved, there are extra pages present, which still need fixing. @@ -1823,7 +1820,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136952_pgBreak3) CPPUNIT_TEST_FIXTURE(Test, testImageLazyRead) { - load(mpTestDocumentPath, "image-lazy-read.docx"); + load("image-lazy-read.docx"); auto xGraphic = getProperty>(getShape(1), "Graphic"); Graphic aGraphic(xGraphic); // This failed, import loaded the graphic, it wasn't lazy-read. @@ -1832,7 +1829,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageLazyRead) CPPUNIT_TEST_FIXTURE(Test, testTdf108995) { - load(mpTestDocumentPath, "xml_space.docx"); + load("xml_space.docx"); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); // We need to take xml:space attribute into account uno::Reference< text::XTextRange > paragraph = getParagraph(1); @@ -1843,7 +1840,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108995) CPPUNIT_TEST_FIXTURE(Test, testGroupShapeTextHighlight) { - load(mpTestDocumentPath, "tdf131841_HighlightColorGroupedShape.docx"); + load("tdf131841_HighlightColorGroupedShape.docx"); // tdf#131841 Highlight color of text in grouped shapes was not imported. // These are the possible highlight colors in MSO Word. Check that we import them properly. diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 62ae3250af73..66c9e78f0c6d 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -52,7 +52,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143476LockedCanvas_twoShapes) // Given a lockedCanvas in a docx document with compatibility to Word version 12 (2007). // It contains two shapes. Error was, that the lockedCanvas was not imported as group at all, // and only one shape was imported and that one was scaled to lockedCanvas area. - load(mpTestDocumentPath, "tdf143476_lockedCanvas_twoShapes.docx"); + load("tdf143476_lockedCanvas_twoShapes.docx"); // The group shape corresponds to the lockedCanvas. uno::Reference xGroup(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xGroup.is()); @@ -69,7 +69,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143476LockedCanvas_position) // Given a lockedCanvas in a docx document with compatibility to Word version 12 (2007). // Tests fix for regression introduced by 3262fc5ef3bde5b158909d11ccb008161ea95519 // Error was, that the imported shape had wrong position. - load(mpTestDocumentPath, "tdf143476_lockedCanvas_position.docx"); + load("tdf143476_lockedCanvas_position.docx"); // The group shape corresponds to the lockedCanvas. uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY); // Without fix in place the test failed with position 185|947. @@ -81,7 +81,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143476LockedCanvas_image_line) { // Given a lockedCanvas in a docx document with compatibility to Word version 12 (2007). // It contains an image and a line. Error was, that both were not imported. - load(mpTestDocumentPath, "tdf143476_lockedCanvas_image_line.docx"); + load("tdf143476_lockedCanvas_image_line.docx"); CPPUNIT_ASSERT_MESSAGE("No shapes imported", getShapes() > 0); } @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143475rotatedWord2007imageInline) // Given a docx document with compatibility to Word version 12 (2007), which has a shape // rotated by 75deg. Similar to testTdf143475rotatedWord2007image but with inline anchored // shape, as in bug report. - load(mpTestDocumentPath, "tdf143475_rotatedWord2007imageInline.docx"); + load("tdf143475_rotatedWord2007imageInline.docx"); // Word 2007 does not swap width and height for rotated images as done in later versions. // This was not considered and lead to wrong distance to text on import and wrong effectExtent @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143475rotatedWord2007image) { // Given a docx document with compatibility to Word version 12 (2007), which has a shape // rotated by 75deg. - load(mpTestDocumentPath, "tdf143475_rotatedWord2007image.docx"); + load("tdf143475_rotatedWord2007image.docx"); // Word 2007 does not swap width and height for rotated images as done in later versions. // This was not considered and lead to wrong distance to text on import and wrong effectExtent @@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143475rotatedWord2007image) CPPUNIT_TEST_FIXTURE(Test, testTdf143219ContourWrapRotate) { - load(mpTestDocumentPath, "tdf143219_ContourWrap_rotate.docx"); + load("tdf143219_ContourWrap_rotate.docx"); const uno::Reference xShape = getShape(1); const uno::Reference xShapeProps(xShape, uno::UNO_QUERY_THROW); sal_Int32 nWrapDistanceLeft = -1; @@ -163,14 +163,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143219ContourWrapRotate) CPPUNIT_TEST_FIXTURE(Test, testTdf108545_embeddedDocxIcon) { - load(mpTestDocumentPath, "tdf108545_embeddedDocxIcon.docx"); + load("tdf108545_embeddedDocxIcon.docx"); uno::Reference xSupplier(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(embed::Aspects::MSOLE_ICON, xSupplier->getAspect()); } CPPUNIT_TEST_FIXTURE(Test, testTdf121203) { - load(mpTestDocumentPath, "tdf121203.docx"); + load("tdf121203.docx"); // We imported the date field uno::Reference xTextPortion(getRun(getParagraph(1), 1), uno::UNO_QUERY); OUString aPortionType; @@ -205,7 +205,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121203) CPPUNIT_TEST_FIXTURE(Test, testTdf109053) { - load(mpTestDocumentPath, "tdf109053.docx"); + load("tdf109053.docx"); // Table was imported into a text frame which led to a one page document // Originally the table takes two pages, so Writer should import it accordingly. CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -213,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109053) CPPUNIT_TEST_FIXTURE(Test, testTdf121664) { - load(mpTestDocumentPath, "tdf121664.docx"); + load("tdf121664.docx"); uno::Reference xLineNumbering(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xLineNumbering.is()); // Without the accompanying fix in place, numbering did not restart on the @@ -224,7 +224,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121664) CPPUNIT_TEST_FIXTURE(Test, testTdf108849) { - load(mpTestDocumentPath, "tdf108849.docx"); + load("tdf108849.docx"); // sectPr element that is child element of body must be the last child. However, Word accepts it // in wrong places, and we should do the same (bug-to-bug compatibility) without creating extra sections. CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); @@ -234,7 +234,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108849) CPPUNIT_TEST_FIXTURE(Test, testTdf97038) { - load(mpTestDocumentPath, "tdf97038.docx"); + load("tdf97038.docx"); // Without the accompanying fix in place, this test would have failed, as the importer lost the // fLayoutInCell shape property for wrap-though shapes. CPPUNIT_ASSERT(getProperty(getShapeByName(u"Kep2"), "IsFollowingTextFlow")); @@ -242,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97038) CPPUNIT_TEST_FIXTURE(Test, testTdf114212) { - load(mpTestDocumentPath, "tdf114212.docx"); + load("tdf114212.docx"); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1428 // - Actual : 387 @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114212) CPPUNIT_TEST_FIXTURE(Test, testTdf109524) { - load(mpTestDocumentPath, "tdf109524.docx"); + load("tdf109524.docx"); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -267,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109524) CPPUNIT_TEST_FIXTURE(Test, testTdf120547) { - load(mpTestDocumentPath, "tdf120547.docx"); + load("tdf120547.docx"); uno::Reference xGroupShape = getShape(1); uno::Reference xGroup(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast(3), xGroup->getCount()); @@ -318,7 +318,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120547) CPPUNIT_TEST_FIXTURE(Test, testTdf118693) { - load(mpTestDocumentPath, "tdf118693.docx"); + load("tdf118693.docx"); uno::Reference xGroupShape = getShape(1); uno::Reference xGroup(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast(2), xGroup->getCount()); @@ -357,7 +357,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118693) CPPUNIT_TEST_FIXTURE(Test, testGroupShapeFontName) { - load(mpTestDocumentPath, "groupshape-fontname.docx"); + load("groupshape-fontname.docx"); // Font names inside a group shape were not imported uno::Reference xGroup(getShape(1), uno::UNO_QUERY); uno::Reference xText @@ -376,7 +376,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupShapeFontName) CPPUNIT_TEST_FIXTURE(Test, testTdf124600) { - load(mpTestDocumentPath, "tdf124600.docx"); + load("tdf124600.docx"); // uno::Reference xShape = getShape(1); // Without the accompanying fix in place, this test would have failed with: // - Expected: 0 @@ -403,7 +403,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124600) CPPUNIT_TEST_FIXTURE(Test, testTdf120548) { - load(mpTestDocumentPath, "tdf120548.docx"); + load("tdf120548.docx"); // Without the accompanying fix in place, this test would have failed with 'Expected: 00ff0000; // Actual: ffffffff', i.e. the numbering portion was black, not red. CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), @@ -412,7 +412,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120548) CPPUNIT_TEST_FIXTURE(Test, test120551) { - load(mpTestDocumentPath, "tdf120551.docx"); + load("tdf120551.docx"); auto nHoriOrientPosition = getProperty(getShape(1), "HoriOrientPosition"); // Without the accompanying fix in place, this test would have failed with // 'Expected: 430, Actual : -2542'. @@ -423,7 +423,7 @@ CPPUNIT_TEST_FIXTURE(Test, test120551) CPPUNIT_TEST_FIXTURE(Test, testTdf111550) { - load(mpTestDocumentPath, "tdf111550.docx"); + load("tdf111550.docx"); // The test document has following ill-formed structure: // // @@ -490,7 +490,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf111550) CPPUNIT_TEST_FIXTURE(Test, testTdf117843) { - load(mpTestDocumentPath, "tdf117843.docx"); + load("tdf117843.docx"); uno::Reference xPageStyles = getStyles("PageStyles"); uno::Reference xPageStyle(xPageStyles->getByName("Standard"), uno::UNO_QUERY); uno::Reference xHeaderText @@ -504,7 +504,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf117843) // related tdf#124754 CPPUNIT_TEST_FIXTURE(Test, testTdf43017) { - load(mpTestDocumentPath, "tdf43017.docx"); + load("tdf43017.docx"); uno::Reference xParagraph = getParagraph(1); uno::Reference xText = getRun(xParagraph, 2, "kick the bucket"); @@ -515,7 +515,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf43017) CPPUNIT_TEST_FIXTURE(Test, testTdf127778) { - load(mpTestDocumentPath, "tdf127778.docx"); + load("tdf127778.docx"); xmlDocUniquePtr pLayout = parseLayoutDump(); // Without the accompanying fix in place, this test would have failed with: // equality assertion failed @@ -528,7 +528,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127778) // related tdf#43017 CPPUNIT_TEST_FIXTURE(Test, testTdf124754) { - load(mpTestDocumentPath, "tdf124754.docx"); + load("tdf124754.docx"); uno::Reference textbox(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(1, getParagraphs(textbox)); @@ -542,7 +542,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124754) CPPUNIT_TEST_FIXTURE(Test, testTextCopy) { - load(mpTestDocumentPath, "text-copy.docx"); + load("text-copy.docx"); // The document has a header on the second page that is copied as part of the import process. // The header has a single paragraph: make sure shapes anchored to it are not lost. // Note that the single paragraph itself has no text portions. @@ -570,7 +570,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTextCopy) CPPUNIT_TEST_FIXTURE(Test, testTdf112443) { - load(mpTestDocumentPath, "tdf112443.docx"); + load("tdf112443.docx"); // the position of the flying text frame should be off page // 30624 below its anchor SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -591,13 +591,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112443) // and as result only one page should be generated. CPPUNIT_TEST_FIXTURE(Test, testTdf113182) { - load(mpTestDocumentPath, "tdf113182.docx"); + load("tdf113182.docx"); CPPUNIT_ASSERT_EQUAL(1, getPages()); } CPPUNIT_TEST_FIXTURE(Test, testBtlrFrameVml) { - load(mpTestDocumentPath, "btlr-frame-vml.docx"); + load("btlr-frame-vml.docx"); uno::Reference xTextFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xTextFrame.is()); @@ -609,7 +609,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBtlrFrameVml) CPPUNIT_TEST_FIXTURE(Test, testTdf124398) { - load(mpTestDocumentPath, "tdf124398.docx"); + load("tdf124398.docx"); uno::Reference xGroup(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT(xGroup.is()); // Without the accompanying fix in place, this test would have failed with 'Expected: 2; Actual: @@ -622,7 +622,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124398) CPPUNIT_TEST_FIXTURE(Test, testTdf104167) { - load(mpTestDocumentPath, "tdf104167.docx"); + load("tdf104167.docx"); // Make sure that heading 1 paragraphs start on a new page. uno::Any xStyle = getStyles("ParagraphStyles")->getByName("Heading 1"); // Without the accompanying fix in place, this test would have failed with: @@ -635,7 +635,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104167) CPPUNIT_TEST_FIXTURE(Test, testTdf113946) { - load(mpTestDocumentPath, "tdf113946.docx"); + load("tdf113946.docx"); OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top"); // tdf#106792 Checked loading of tdf113946.docx. Before the change, the expected // value of this test was "1696". Opening the file shows a single short line anchored @@ -647,7 +647,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113946) CPPUNIT_TEST_FIXTURE(Test, testTdf121804) { - load(mpTestDocumentPath, "tdf121804.docx"); + load("tdf121804.docx"); uno::Reference xGroup(getShape(1), uno::UNO_QUERY); uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); uno::Reference xFirstPara = getParagraphOfText(1, xShape->getText()); @@ -666,14 +666,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121804) CPPUNIT_TEST_FIXTURE(Test, testTdf114217) { - load(mpTestDocumentPath, "tdf114217.docx"); + load("tdf114217.docx"); // This was 1, multi-page table was imported as a floating one. CPPUNIT_ASSERT_EQUAL(0, getShapes()); } CPPUNIT_TEST_FIXTURE(Test, testTdf119200) { - load(mpTestDocumentPath, "tdf119200.docx"); + load("tdf119200.docx"); auto xPara = getParagraph(1); // Check that we import MathType functional symbols as symbols, not functions with missing args CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2208 } {}"), getFormula(getRun(xPara, 1))); @@ -687,7 +687,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119200) CPPUNIT_TEST_FIXTURE(Test, testTdf115094) { - load(mpTestDocumentPath, "tdf115094.docx"); + load("tdf115094.docx"); // anchor of graphic has to be the text in the text frame // xray ThisComponent.DrawPage(1).Anchor.Text uno::Reference xShape(getShape(2), uno::UNO_QUERY); @@ -705,7 +705,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094) CPPUNIT_TEST_FIXTURE(Test, testTdf115094v2) { - load(mpTestDocumentPath, "tdf115094v2.docx"); + load("tdf115094v2.docx"); // layoutInCell="1" combined with CPPUNIT_ASSERT(getProperty(getShapeByName(u"Grafik 18"), "IsFollowingTextFlow")); @@ -714,7 +714,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094v2) CPPUNIT_TEST_FIXTURE(Test, testTdf122224) { - load(mpTestDocumentPath, "tdf122224.docx"); + load("tdf122224.docx"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -726,7 +726,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122224) CPPUNIT_TEST_FIXTURE(Test, testTdf121440) { - load(mpTestDocumentPath, "tdf121440.docx"); + load("tdf121440.docx"); // Insert some text in front of footnote SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -743,7 +743,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121440) CPPUNIT_TEST_FIXTURE(Test, testTdf124670) { - load(mpTestDocumentPath, "tdf124670.docx"); + load("tdf124670.docx"); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); // We need to take xml:space attribute into account, even in w:document element uno::Reference paragraph = getParagraph(1); @@ -754,7 +754,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124670) CPPUNIT_TEST_FIXTURE(Test, testTdf126114) { - load(mpTestDocumentPath, "tdf126114.docx"); + load("tdf126114.docx"); // The problem was that after the drop-down form field, also the placeholder string // was imported as text. Beside the duplication of the field, it also caused a crash. // the word is from replacement of the drop-down field in ModelToViewHelper @@ -763,7 +763,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126114) CPPUNIT_TEST_FIXTURE(Test, testTdf127825) { - load(mpTestDocumentPath, "tdf127825.docx"); + load("tdf127825.docx"); // The document has a shape with Japanese-style text in it. The shape has relative size and also // has automatic height. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -788,7 +788,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127825) CPPUNIT_TEST_FIXTURE(Test, testTdf103345) { - load(mpTestDocumentPath, "numbering-circle.docx"); + load("numbering-circle.docx"); uno::Reference xPropertySet( getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference xLevels( @@ -808,7 +808,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103345) CPPUNIT_TEST_FIXTURE(Test, testTdf125038) { - load(mpTestDocumentPath, "tdf125038.docx"); + load("tdf125038.docx"); OUString aActual = getParagraph(1)->getString(); // Without the accompanying fix in place, this test would have failed with: // - Expected: phone:... @@ -819,7 +819,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125038) CPPUNIT_TEST_FIXTURE(Test, testTdf125038b) { - load(mpTestDocumentPath, "tdf125038b.docx"); + load("tdf125038b.docx"); // Load a document with an IF field, where the IF field command contains a paragraph break. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParagraphAccess(xTextDocument->getText(), @@ -844,7 +844,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125038b) CPPUNIT_TEST_FIXTURE(Test, testTdf125038c) { - load(mpTestDocumentPath, "tdf125038c.docx"); + load("tdf125038c.docx"); OUString aActual = getParagraph(1)->getString(); // Without the accompanying fix in place, this test would have failed with: // - Expected: email: test@test.test @@ -855,19 +855,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125038c) CPPUNIT_TEST_FIXTURE(Test, testTdf130214) { - load(mpTestDocumentPath, "tdf130214.docx"); + load("tdf130214.docx"); // Currently this file imports with errors because of tdf#126435; it must not segfault on load } CPPUNIT_TEST_FIXTURE(Test, testTdf129659) { - load(mpTestDocumentPath, "tdf129659.docx"); + load("tdf129659.docx"); // don't crash on footnote with page break } CPPUNIT_TEST_FIXTURE(Test, testTdf129912) { - load(mpTestDocumentPath, "tdf129912.docx"); + load("tdf129912.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); @@ -901,7 +901,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129912) CPPUNIT_TEST_FIXTURE(Test, testTdf126426) { - load(mpTestDocumentPath, "tdf126426.docx"); + load("tdf126426.docx"); uno::Reference xGroup(getShape(1), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroup->getCount()); @@ -937,7 +937,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126426) CPPUNIT_TEST_FIXTURE(Test, testTdf119039) { - load(mpTestDocumentPath, "tdf119039_bad_embedded_compound.docx"); + load("tdf119039_bad_embedded_compound.docx"); // Should not crash/hang because of problematic embedded compound } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index dc5b3c0fb87c..49dd8b811a7a 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -1018,7 +1018,7 @@ DECLARE_RTFEXPORT_TEST(testTdf80708, "tdf80708.rtf") CPPUNIT_TEST_FIXTURE(Test, testHyperlinkWithoutURL) { - load(mpTestDocumentPath, "tdf90421.fodt"); + load("tdf90421.fodt"); // Change the hyperlink, so its URL is empty. uno::Reference xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString())); diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 38d3550436da..8a13cb4374d5 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -575,7 +575,7 @@ DECLARE_RTFEXPORT_TEST(testFdo55493, "fdo55493.rtf") CPPUNIT_TEST_FIXTURE(Test, testCopyPastePageStyle) { - load(mpTestDocumentPath, "copypaste-pagestyle.rtf"); + load("copypaste-pagestyle.rtf"); // The problem was that RTF import during copy&paste did not ignore page styles. // Once we have more copy&paste tests, makes sense to refactor this to some helper method. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); @@ -591,7 +591,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCopyPastePageStyle) CPPUNIT_TEST_FIXTURE(Test, testCopyPasteFootnote) { - load(mpTestDocumentPath, "copypaste-footnote.rtf"); + load("copypaste-footnote.rtf"); // The RTF import did not handle the case when the position wasn't the main document XText, but something different, e.g. a footnote. uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFootnotes = xFootnotesSupplier->getFootnotes(); @@ -603,7 +603,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCopyPasteFootnote) CPPUNIT_TEST_FIXTURE(Test, testFdo63428) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); // Pasting content that contained an annotation caused a crash. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -629,7 +629,7 @@ DECLARE_RTFEXPORT_TEST(testFdo69384, "fdo69384-paste.rtf") CPPUNIT_TEST_FIXTURE(Test, testFdo69384Inserted) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); @@ -644,7 +644,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69384Inserted) CPPUNIT_TEST_FIXTURE(Test, testFdo61193) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); // Pasting content that contained a footnote caused a crash. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -654,7 +654,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo61193) CPPUNIT_TEST_FIXTURE(Test, testTdf108123) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); // This crashed, the shape push/pop and table manager stack went out of // sync -> we tried to de-reference an empty stack. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 2cb6b29c5251..6297966bae1b 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -432,7 +432,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) }; // Given a document with RTL gutter, when loading it: - load(mpTestDocumentPath, "rtl-gutter.rtf"); + load("rtl-gutter.rtf"); // Then make sure the section's gutter is still RTL: // Without the accompanying fix in place, this test would have failed as \rtlgutter was missing. verify(); @@ -493,7 +493,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder) CPPUNIT_TEST_FIXTURE(Test, testTdf127806) { - load(mpTestDocumentPath, "tdf127806.rtf"); + load("tdf127806.rtf"); CPPUNIT_ASSERT_EQUAL(2, getShapes()); CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), getShape(1)->getShapeType()); diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index cc595cf1fc03..62175994c4a6 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -338,7 +338,7 @@ DECLARE_RTFEXPORT_TEST(testCjklist34, "cjklist34.rtf") CPPUNIT_TEST_FIXTURE(Test, testTabStopFillChars) { - load(mpTestDocumentPath, "tab-stop-fill-chars.rtf"); + load("tab-stop-fill-chars.rtf"); // tlmdot auto aTabstops = getProperty>(getParagraph(1), "ParaTabStops"); CPPUNIT_ASSERT(aTabstops.hasElements()); @@ -517,7 +517,7 @@ DECLARE_RTFEXPORT_TEST(testTdf136587_noStyleName, "tdf136587_noStyleName.rtf") CPPUNIT_TEST_FIXTURE(Test, testPageBorder) { - load(mpTestDocumentPath, "page-border.rtf"); + load("page-border.rtf"); uno::Reference xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); auto aTopBorder = getProperty(xPageStyle, "TopBorder"); @@ -547,7 +547,7 @@ DECLARE_RTFEXPORT_TEST(testTbrlPage, "tbrl-page.rtf") CPPUNIT_TEST_FIXTURE(Test, testTdf126309) { - load(mpTestDocumentPath, "tdf126309.rtf"); + load("tdf126309.rtf"); // Without the accompanying fix in place, this test would have failed, as // the paragraph was aligned to left, not right. CPPUNIT_ASSERT_EQUAL( @@ -586,7 +586,7 @@ DECLARE_RTFEXPORT_TEST(testTdf116358, "tdf116358.rtf") CPPUNIT_TEST_FIXTURE(Test, testGutterLeft) { - load(mpTestDocumentPath, "gutter-left.rtf"); + load("gutter-left.rtf"); reload(mpFilter, "gutter-left.rtf"); uno::Reference xPageStyle; getStyles("PageStyles")->getByName("Standard") >>= xPageStyle; @@ -601,7 +601,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterLeft) CPPUNIT_TEST_FIXTURE(Test, testGutterTop) { - load(mpTestDocumentPath, "gutter-top.rtf"); + load("gutter-top.rtf"); reload(mpFilter, "gutter-left.rtf"); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xSettings( @@ -637,7 +637,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) // Given a document with a clearing break: // When loading that file: - load(mpTestDocumentPath, "clearing-break.rtf"); + load("clearing-break.rtf"); // Then make sure that the clear property of the break is not ignored: verify(); reload(mpFilter, "clearing-break.rtf"); diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 6c3d6c6c8471..3f870784dacb 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -111,7 +111,7 @@ DECLARE_RTFEXPORT_TEST(testFdo64671, "fdo64671.rtf") CPPUNIT_TEST_FIXTURE(Test, testFdo62044) { - load(mpTestDocumentPath, "fdo62044.rtf"); + load("fdo62044.rtf"); // The problem was that RTF import during copy&paste did not ignore existing paragraph styles. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -180,7 +180,7 @@ DECLARE_RTFEXPORT_TEST(testParaBottomMargin, "para-bottom-margin.rtf") CPPUNIT_TEST_FIXTURE(Test, testParaStyleBottomMargin2) { - load(mpTestDocumentPath, "para-style-bottom-margin-2.rtf"); + load("para-style-bottom-margin-2.rtf"); uno::Reference xPropertySet( getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(353), getProperty(xPropertySet, "ParaBottomMargin")); @@ -819,7 +819,7 @@ DECLARE_RTFEXPORT_TEST(testTdf91074, "tdf91074.rtf") CPPUNIT_TEST_FIXTURE(Test, testTdf90260Nopar) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); @@ -993,7 +993,7 @@ DECLARE_RTFEXPORT_TEST(testTdf87034, "tdf87034.rtf") CPPUNIT_TEST_FIXTURE(Test, testClassificatonPasteLevels) { - load(mpTestDocumentPath, "classification-confidential.rtf"); + load("classification-confidential.rtf"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 86a26ca0fa1d..3a7700ee26e1 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -69,7 +69,7 @@ protected: CPPUNIT_TEST_FIXTURE(Test, testN695479) { - load(mpTestDocumentPath, "n695479.rtf"); + load("n695479.rtf"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -119,14 +119,14 @@ CPPUNIT_TEST_FIXTURE(Test, testN695479) CPPUNIT_TEST_FIXTURE(Test, testTdf117246) { - load(mpTestDocumentPath, "tdf117246.rtf"); + load("tdf117246.rtf"); // This was 2, all but the last \page was lost. CPPUNIT_ASSERT_EQUAL(3, getPages()); } CPPUNIT_TEST_FIXTURE(Test, testTdf108943) { - load(mpTestDocumentPath, "tdf108943.rtf"); + load("tdf108943.rtf"); uno::Reference xPropertySet( getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference xLevels( @@ -148,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108943) CPPUNIT_TEST_FIXTURE(Test, testFdo46662) { - load(mpTestDocumentPath, "fdo46662.rtf"); + load("fdo46662.rtf"); OUString listStyle; @@ -200,7 +200,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo46662) CPPUNIT_TEST_FIXTURE(Test, testTdf115715) { - load(mpTestDocumentPath, "tdf115715.rtf"); + load("tdf115715.rtf"); // This was 0, second paragraph was shifted to the right, it had the same // horizontal position as the 3rd paragraph. CPPUNIT_ASSERT_EQUAL(static_cast(-1270), @@ -209,14 +209,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115715) CPPUNIT_TEST_FIXTURE(Test, testTdf81943) { - load(mpTestDocumentPath, "tdf81943.rtf"); + load("tdf81943.rtf"); // The shape wasn't in background. CPPUNIT_ASSERT_EQUAL(false, getProperty(getShape(1), "Opaque")); } CPPUNIT_TEST_FIXTURE(Test, testTdf115155) { - load(mpTestDocumentPath, "tdf115155.rtf"); + load("tdf115155.rtf"); auto xLevels = getProperty>(getParagraph(2), "NumberingRules"); // 1st level @@ -227,7 +227,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115155) CPPUNIT_TEST_FIXTURE(Test, testTdf108951) { - load(mpTestDocumentPath, "tdf108951.rtf"); + load("tdf108951.rtf"); // This test is import-only, as we assert the list ID, which is OK to // re-order on export, but then this test would not pass anymore. @@ -238,7 +238,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108951) CPPUNIT_TEST_FIXTURE(Test, testFdo47036) { - load(mpTestDocumentPath, "fdo47036.rtf"); + load("fdo47036.rtf"); int nShapes = getShapes(); CPPUNIT_ASSERT_EQUAL(3, nShapes); @@ -261,7 +261,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47036) CPPUNIT_TEST_FIXTURE(Test, testFdo45182) { - load(mpTestDocumentPath, "fdo45182.rtf"); + load("fdo45182.rtf"); uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFootnotes = xFootnotesSupplier->getFootnotes(); uno::Reference xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); @@ -272,7 +272,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45182) CPPUNIT_TEST_FIXTURE(Test, testFdo85812) { - load(mpTestDocumentPath, "fdo85812.rtf"); + load("fdo85812.rtf"); lang::Locale locale( getProperty(getRun(getParagraph(1), 1, "This "), "CharLocale")); // the \lang inside the group was applied to CJK not Western @@ -336,7 +336,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo85812) CPPUNIT_TEST_FIXTURE(Test, testFdo49692) { - load(mpTestDocumentPath, "fdo49692.rtf"); + load("fdo49692.rtf"); uno::Reference xPropertySet( getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference xLevels( @@ -357,7 +357,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49692) CPPUNIT_TEST_FIXTURE(Test, testFdo45190) { - load(mpTestDocumentPath, "fdo45190.rtf"); + load("fdo45190.rtf"); // inherited \fi should be reset CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(getParagraph(1), "ParaFirstLineIndent")); @@ -369,7 +369,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45190) CPPUNIT_TEST_FIXTURE(Test, testTdf59699) { - load(mpTestDocumentPath, "tdf59699.rtf"); + load("tdf59699.rtf"); // This resulted in a lang.IndexOutOfBoundsException: the referenced graphic data wasn't imported. uno::Reference xImage(getShape(1), uno::UNO_QUERY); auto xGraphic = getProperty>(xImage, "Graphic"); @@ -378,7 +378,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf59699) CPPUNIT_TEST_FIXTURE(Test, testFdo52066) { - load(mpTestDocumentPath, "fdo52066.rtf"); + load("fdo52066.rtf"); /* * The problem was that the height of the shape was too big. * @@ -390,7 +390,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo52066) CPPUNIT_TEST_FIXTURE(Test, testTdf112211_2) { - load(mpTestDocumentPath, "tdf112211-2.rtf"); + load("tdf112211-2.rtf"); // Spacing between the bullet and the actual text was too large. // This is now around 269, large old value was 629. int nWidth = parseDump("/root/page/body/txt[2]/Text[@nType='PortionType::TabLeft']", "nWidth") @@ -400,7 +400,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112211_2) CPPUNIT_TEST_FIXTURE(Test, testTdf122430) { - load(mpTestDocumentPath, "tdf122430.rtf"); + load("tdf122430.rtf"); // Without the accompanying fix in place, this test would have failed with // 'Expected: 18, Actual : 12', i.e. the font was smaller than expected. CPPUNIT_ASSERT_EQUAL(18.0f, getProperty(getRun(getParagraph(1), 2), "CharHeight")); @@ -408,7 +408,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122430) CPPUNIT_TEST_FIXTURE(Test, testFdo49892) { - load(mpTestDocumentPath, "fdo49892.rtf"); + load("fdo49892.rtf"); int nShapes = getShapes(); CPPUNIT_ASSERT_EQUAL(5, nShapes); for (int i = 0; i < nShapes; ++i) @@ -432,7 +432,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49892) CPPUNIT_TEST_FIXTURE(Test, testFdo52052) { - load(mpTestDocumentPath, "fdo52052.rtf"); + load("fdo52052.rtf"); // Make sure the textframe containing the text "third" appears on the 3rd page. CPPUNIT_ASSERT_EQUAL(OUString("third"), parseDump("/root/page[3]/body/txt/anchored/fly/txt/text()")); @@ -440,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo52052) CPPUNIT_TEST_FIXTURE(Test, testInk) { - load(mpTestDocumentPath, "ink.rtf"); + load("ink.rtf"); /* * The problem was that the second segment had wrong command count and wrap type. * @@ -473,7 +473,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInk) CPPUNIT_TEST_FIXTURE(Test, testFdo79319) { - load(mpTestDocumentPath, "fdo79319.rtf"); + load("fdo79319.rtf"); // the thin horizontal rule was imported as a big fat rectangle uno::Reference xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty(xShape, "RelativeWidth")); @@ -487,7 +487,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo79319) CPPUNIT_TEST_FIXTURE(Test, testFdo48442) { - load(mpTestDocumentPath, "fdo48442.rtf"); + load("fdo48442.rtf"); // The problem was that \pvmrg is the default in RTF, but not in Writer. uno::Reference xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48442) CPPUNIT_TEST_FIXTURE(Test, testFdo55525) { - load(mpTestDocumentPath, "fdo55525.rtf"); + load("fdo55525.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo55525) CPPUNIT_TEST_FIXTURE(Test, testFdo57708) { - load(mpTestDocumentPath, "fdo57708.rtf"); + load("fdo57708.rtf"); // There were two issues: the doc was of 2 pages and the picture was missing. CPPUNIT_ASSERT_EQUAL(1, getPages()); // Two objects: a picture and a textframe. @@ -521,7 +521,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo57708) CPPUNIT_TEST_FIXTURE(Test, testFdo45183) { - load(mpTestDocumentPath, "fdo45183.rtf"); + load("fdo45183.rtf"); // Was text::WrapTextMode_PARALLEL, i.e. shpfblwtxt didn't send the shape below text. CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty(getShape(1), "Surround")); @@ -535,7 +535,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45183) CPPUNIT_TEST_FIXTURE(Test, testFdo59953) { - load(mpTestDocumentPath, "fdo59953.rtf"); + load("fdo59953.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -549,7 +549,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo59953) CPPUNIT_TEST_FIXTURE(Test, testTdf84684) { - load(mpTestDocumentPath, "tdf84684.rtf"); + load("tdf84684.rtf"); // The ZOrder of the two children of the group shape were swapped. uno::Reference xGroup(getShape(1), uno::UNO_QUERY); uno::Reference xChild1(xGroup->getByIndex(0), uno::UNO_QUERY); @@ -562,7 +562,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf84684) CPPUNIT_TEST_FIXTURE(Test, testFdo81944) { - load(mpTestDocumentPath, "fdo81944.rtf"); + load("fdo81944.rtf"); // font properties in style were not imported uno::Reference xPropertySet( getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY); @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81944) CPPUNIT_TEST_FIXTURE(Test, testSbkodd) { - load(mpTestDocumentPath, "sbkodd.rtf"); + load("sbkodd.rtf"); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); @@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSbkodd) CPPUNIT_TEST_FIXTURE(Test, testSbkeven) { - load(mpTestDocumentPath, "sbkeven.rtf"); + load("sbkeven.rtf"); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); @@ -605,7 +605,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSbkeven) CPPUNIT_TEST_FIXTURE(Test, testPoshPosv) { - load(mpTestDocumentPath, "posh-posv.rtf"); + load("posh-posv.rtf"); CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty(getShape(1), "HoriOrient")); CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, @@ -615,7 +615,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPoshPosv) CPPUNIT_TEST_FIXTURE(Test, testPoshLeftRight) { - load(mpTestDocumentPath, "posh-leftright.rtf"); + load("posh-leftright.rtf"); CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::RIGHT, getProperty(getShape(1), "HoriOrient")); CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT, @@ -624,7 +624,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPoshLeftRight) CPPUNIT_TEST_FIXTURE(Test, testTdf96326) { - load(mpTestDocumentPath, "tdf96326.rtf"); + load("tdf96326.rtf"); // Make sure this is not checked. auto xFormField = getProperty>(getRun(getParagraph(1), 2), "Bookmark"); @@ -641,7 +641,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96326) CPPUNIT_TEST_FIXTURE(Test, testN823655) { - load(mpTestDocumentPath, "n823655.rtf"); + load("n823655.rtf"); uno::Sequence aProps = getProperty>(getShape(1), "CustomShapeGeometry"); uno::Sequence aPathProps; @@ -665,7 +665,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN823655) CPPUNIT_TEST_FIXTURE(Test, testN823675) { - load(mpTestDocumentPath, "n823675.rtf"); + load("n823675.rtf"); uno::Reference xPropertySet( getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference xLevels( @@ -687,7 +687,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN823675) CPPUNIT_TEST_FIXTURE(Test, testGroupshape) { - load(mpTestDocumentPath, "groupshape.rtf"); + load("groupshape.rtf"); // There should be a single groupshape with 2 children. CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xGroupshape(getShape(1), uno::UNO_QUERY); @@ -696,7 +696,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupshape) CPPUNIT_TEST_FIXTURE(Test, testGroupshape_notext) { - load(mpTestDocumentPath, "groupshape-notext.rtf"); + load("groupshape-notext.rtf"); // There should be a single groupshape with 2 children. CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xGroupshape(getShape(1), uno::UNO_QUERY); @@ -705,7 +705,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupshape_notext) CPPUNIT_TEST_FIXTURE(Test, testFdo81033) { - load(mpTestDocumentPath, "fdo81033.rtf"); + load("fdo81033.rtf"); // Number of tabstops in the paragraph should be 2, was 3. uno::Sequence tabs( getProperty>(getParagraph(1), "ParaTabStops")); @@ -720,7 +720,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81033) CPPUNIT_TEST_FIXTURE(Test, testTdf116269) { - load(mpTestDocumentPath, "tdf116269.rtf"); + load("tdf116269.rtf"); // This was 2540, implicit 0 left margin was ignored on import (inherited // value from list definition is repeated if it's not 0). CPPUNIT_ASSERT_EQUAL(static_cast(0), @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116269) CPPUNIT_TEST_FIXTURE(Test, testTdf116265) { - load(mpTestDocumentPath, "tdf116265.rtf"); + load("tdf116265.rtf"); // This was -635, \fi as direct formatting has to be ignored due to // matching \fi in list definition (and with invalid level numbers). CPPUNIT_ASSERT_EQUAL(static_cast(0), @@ -738,7 +738,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116265) CPPUNIT_TEST_FIXTURE(Test, testFdo66565) { - load(mpTestDocumentPath, "fdo66565.rtf"); + load("fdo66565.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -752,7 +752,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo66565) CPPUNIT_TEST_FIXTURE(Test, testFdo67365) { - load(mpTestDocumentPath, "fdo67365.rtf"); + load("fdo67365.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -773,7 +773,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo67365) CPPUNIT_TEST_FIXTURE(Test, testFdo47440) { - load(mpTestDocumentPath, "fdo47440.rtf"); + load("fdo47440.rtf"); // Vertical and horizontal orientation of the picture wasn't imported (was text::RelOrientation::FRAME). CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(getShape(1), "HoriOrientRelation")); @@ -783,7 +783,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo47440) CPPUNIT_TEST_FIXTURE(Test, testFdo53556) { - load(mpTestDocumentPath, "fdo53556.rtf"); + load("fdo53556.rtf"); // This was drawing::FillStyle_SOLID, which resulted in being non-transparent, hiding text which would be visible. CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty(getShape(3), "FillStyle")); @@ -796,14 +796,14 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo53556) CPPUNIT_TEST_FIXTURE(Test, testGroupshapeRotation) { - load(mpTestDocumentPath, "groupshape-rotation.rtf"); + load("groupshape-rotation.rtf"); // Rotation on groupshapes wasn't handled correctly, RotateAngle was 4500. CPPUNIT_ASSERT_EQUAL(sal_Int32(315 * 100), getProperty(getShape(1), "RotateAngle")); } CPPUNIT_TEST_FIXTURE(Test, testTdf115153) { - load(mpTestDocumentPath, "tdf115153.rtf"); + load("tdf115153.rtf"); auto const xShape(getShape(1)); CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::NONE, getProperty(xShape, "HoriOrient")); CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, @@ -818,7 +818,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115153) CPPUNIT_TEST_FIXTURE(Test, testFdo68291) { - load(mpTestDocumentPath, "fdo68291.odt"); + load("fdo68291.odt"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); @@ -840,13 +840,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105511) auto batch = comphelper::ConfigurationChanges::create(); DefaultLocale::set("ru-RU", batch); batch->commit(); - load(mpTestDocumentPath, "tdf105511.rtf"); + load("tdf105511.rtf"); getParagraph(1, u"\u0418\u043C\u044F"); } CPPUNIT_TEST_FIXTURE(Test, testContSectionPageBreak) { - load(mpTestDocumentPath, "cont-section-pagebreak.rtf"); + load("cont-section-pagebreak.rtf"); uno::Reference xParaSecond = getParagraph(2); CPPUNIT_ASSERT_EQUAL(OUString("SECOND"), xParaSecond->getString()); CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, @@ -873,7 +873,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContSectionPageBreak) CPPUNIT_TEST_FIXTURE(Test, testBackground) { - load(mpTestDocumentPath, "background.rtf"); + load("background.rtf"); // The first shape wasn't in the foreground. CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), "Opaque")); CPPUNIT_ASSERT_EQUAL(false, getProperty(getShape(2), "Opaque")); @@ -881,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBackground) CPPUNIT_TEST_FIXTURE(Test, testFdo74823) { - load(mpTestDocumentPath, "fdo74823.rtf"); + load("fdo74823.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -895,7 +895,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74823) CPPUNIT_TEST_FIXTURE(Test, testFdo74599) { - load(mpTestDocumentPath, "fdo74599.rtf"); + load("fdo74599.rtf"); uno::Reference xPropertySet( getStyles("ParagraphStyles")->getByName("Heading 3"), uno::UNO_QUERY); // Writer default styles weren't disabled, so the color was gray, not default (black). @@ -905,7 +905,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74599) CPPUNIT_TEST_FIXTURE(Test, testColumnBreak) { - load(mpTestDocumentPath, "column-break.rtf"); + load("column-break.rtf"); // Column break at the very start of the document was ignored. CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty(getParagraph(2), "BreakType")); @@ -913,7 +913,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnBreak) CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumnsCompat) { - load(mpTestDocumentPath, "unbalanced-columns-compat.rtf"); + load("unbalanced-columns-compat.rtf"); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); @@ -924,7 +924,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumnsCompat) CPPUNIT_TEST_FIXTURE(Test, testOleInline) { - load(mpTestDocumentPath, "ole-inline.rtf"); + load("ole-inline.rtf"); // Problem was that inline shape had at-page anchor. CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty(getShape(1), "AnchorType")); @@ -932,7 +932,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOleInline) CPPUNIT_TEST_FIXTURE(Test, testTdf128611) { - load(mpTestDocumentPath, "tdf128611.rtf"); + load("tdf128611.rtf"); auto aPolyPolySequence = getProperty>>(getShape(1), "PolyPolygon"); CPPUNIT_ASSERT(aPolyPolySequence.hasElements()); @@ -951,7 +951,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128611) CPPUNIT_TEST_FIXTURE(Test, testFdo80742) { - load(mpTestDocumentPath, "fdo80742.rtf"); + load("fdo80742.rtf"); uno::Reference xPropertySet( getStyles("ParagraphStyles")->getByName("Heading 2"), uno::UNO_QUERY); // This was 0, outline level was body text. @@ -960,7 +960,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80742) CPPUNIT_TEST_FIXTURE(Test, testBehindDoc) { - load(mpTestDocumentPath, "behind-doc.rtf"); + load("behind-doc.rtf"); // The problem was that "behind doc" didn't result in the shape being in the background, only in being wrapped as "through". uno::Reference xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, @@ -971,7 +971,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBehindDoc) CPPUNIT_TEST_FIXTURE(Test, testFdo82114) { - load(mpTestDocumentPath, "fdo82114.rtf"); + load("fdo82114.rtf"); uno::Reference xHeaderText = getProperty>( getStyles("PageStyles")->getByName("Converted1"), "HeaderText"); OUString aActual = xHeaderText->getString(); @@ -981,7 +981,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82114) CPPUNIT_TEST_FIXTURE(Test, testFdo44984) { - load(mpTestDocumentPath, "fdo44984.rtf"); + load("fdo44984.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -995,7 +995,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44984) CPPUNIT_TEST_FIXTURE(Test, testFdo82071) { - load(mpTestDocumentPath, "fdo82071.rtf"); + load("fdo82071.rtf"); // The problem was that in TOC, chapter names were underlined, but they should not be. uno::Reference xRun = getRun(getParagraph(1), 1); // Make sure we test the right text portion. @@ -1006,7 +1006,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82071) CPPUNIT_TEST_FIXTURE(Test, testFdo85179) { - load(mpTestDocumentPath, "fdo85179.rtf"); + load("fdo85179.rtf"); // This was 0, border around the picture was ignored on import. // 360: EMU -> MM100 CPPUNIT_ASSERT_EQUAL(sal_uInt32(50800 / 360), @@ -1029,8 +1029,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat) uno::Reference xText = xTextDocument->getText(); uno::Reference xCursor( xText->createTextCursorByRange(xText->getStart()), uno::UNO_QUERY); - xCursor->insertDocumentFromURL( - m_directories.getURLFromSrc(mpTestDocumentPath) + "paste-first-para-direct-format.rtf", {}); + xCursor->insertDocumentFromURL(createFileURL(u"paste-first-para-direct-format.rtf"), {}); // Without the accompanying fix in place, this test would have failed with: // - Expected: 3 (center) @@ -1043,7 +1042,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat) CPPUNIT_TEST_FIXTURE(Test, testFdo82512) { - load(mpTestDocumentPath, "fdo82512.rtf"); + load("fdo82512.rtf"); // This was style::BreakType_NONE, column break was before the 3rd paragraph, not before the 2nd one. CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty(getParagraph(2), "BreakType")); @@ -1051,7 +1050,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82512) CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumns) { - load(mpTestDocumentPath, "unbalanced-columns.rtf"); + load("unbalanced-columns.rtf"); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); @@ -1062,7 +1061,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumns) CPPUNIT_TEST_FIXTURE(Test, testTdf126173) { - load(mpTestDocumentPath, "tdf126173.rtf"); + load("tdf126173.rtf"); // Without the accompanying fix in place, this test would have failed, as the TextFrame was lost // on import. CPPUNIT_ASSERT(getShape(1).is()); @@ -1070,7 +1069,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126173) CPPUNIT_TEST_FIXTURE(Test, testFdo84685) { - load(mpTestDocumentPath, "fdo84685.rtf"); + load("fdo84685.rtf"); // index mark was not imported uno::Reference xMark( getProperty>(getRun(getParagraph(1), 1), @@ -1089,7 +1088,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo84685) // This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 ). CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext1) { - load(mpTestDocumentPath, "cp950listleveltext1.rtf"); + load("cp950listleveltext1.rtf"); // suffix with Chinese only ( most common case generated by MSO2010 TC) // This is a dot that is generally used as suffix of Chinese list number static constexpr OUStringLiteral aExpectedNumbering = u"\u4e00\u3001"; @@ -1102,7 +1101,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext1) // This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 ). CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext2) { - load(mpTestDocumentPath, "cp950listleveltext2.rtf"); + load("cp950listleveltext2.rtf"); // Prefix and suffix with Chinese only ( tweaked from default in MSO2010 TC) static constexpr OUStringLiteral aExpectedNumbering = u"\u524d\u7f6e\u7532\u3001\u5f8c\u7f6e"; @@ -1114,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext2) // This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 ) CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext3) { - load(mpTestDocumentPath, "cp950listleveltext3.rtf"); + load("cp950listleveltext3.rtf"); // Numbering is a mix Chinese and English ( tweaked from default in MSO2010 TC) static constexpr OUStringLiteral aExpectedNumbering = u"\u524da\u7f6eb\u7532\u3001" "c\u5f8cd\u7f6ee"; @@ -1126,7 +1125,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext3) CPPUNIT_TEST_FIXTURE(Test, testChtOutlineNumberingRtf) { - load(mpTestDocumentPath, "chtoutline.rtf"); + load("chtoutline.rtf"); static constexpr OUStringLiteral aExpectedNumbering = u"\u7b2c 1 \u7ae0"; @@ -1137,7 +1136,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChtOutlineNumberingRtf) CPPUNIT_TEST_FIXTURE(Test, testTdf90046) { - load(mpTestDocumentPath, "tdf90046.rtf"); + load("tdf90046.rtf"); // this was crashing on importing the footnote uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFootnotes = xFootnotesSupplier->getFootnotes(); @@ -1147,7 +1146,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf90046) CPPUNIT_TEST_FIXTURE(Test, testFdo49893) { - load(mpTestDocumentPath, "fdo49893.rtf"); + load("fdo49893.rtf"); // Image from shape was not loaded, invalid size of image after load uno::Reference xShape = getShape(2); CPPUNIT_ASSERT(xShape.is()); @@ -1157,7 +1156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49893) CPPUNIT_TEST_FIXTURE(Test, testFdo49893_3) { - load(mpTestDocumentPath, "fdo49893-3.rtf"); + load("fdo49893-3.rtf"); // No artifacts (black lines in left top corner) as shape #3 are expected CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -1168,7 +1167,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49893_3) CPPUNIT_TEST_FIXTURE(Test, testWrapDistance) { - load(mpTestDocumentPath, "wrap-distance.rtf"); + load("wrap-distance.rtf"); // Custom shape, handled directly in RTFSdrImport. uno::Reference xShape = getShape(1); CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), xShape->getShapeType()); @@ -1195,7 +1194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapDistance) CPPUNIT_TEST_FIXTURE(Test, testTdf90260Par) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); @@ -1205,7 +1204,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf90260Par) CPPUNIT_TEST_FIXTURE(Test, testTdf119599) { - load(mpTestDocumentPath, "tdf119599.rtf"); + load("tdf119599.rtf"); uno::Reference xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); // This was beans::PropertyState_DIRECT_VALUE, changing the font size in // the style had no effect on the rendering result. @@ -1214,7 +1213,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119599) CPPUNIT_TEST_FIXTURE(Test, testTdf90315) { - load(mpTestDocumentPath, "tdf90315.rtf"); + load("tdf90315.rtf"); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); @@ -1227,14 +1226,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf90315) CPPUNIT_TEST_FIXTURE(Test, testTdf59454) { - load(mpTestDocumentPath, "tdf59454.rtf"); + load("tdf59454.rtf"); // This was 1, section break was ignored right before a table. CPPUNIT_ASSERT_EQUAL(2, getPages()); } CPPUNIT_TEST_FIXTURE(Test, testTdf96308Tabpos) { - load(mpTestDocumentPath, "tdf96308-tabpos.rtf"); + load("tdf96308-tabpos.rtf"); // Get the tab stops of the second para in the B1 cell of the first table in the document. uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), @@ -1252,7 +1251,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96308Tabpos) CPPUNIT_TEST_FIXTURE(Test, testLndscpsxn) { - load(mpTestDocumentPath, "lndscpsxn.rtf"); + load("lndscpsxn.rtf"); // Check landscape flag. CPPUNIT_ASSERT_EQUAL(4, getPages()); @@ -1292,7 +1291,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLndscpsxn) CPPUNIT_TEST_FIXTURE(Test, testTdf99498) { - load(mpTestDocumentPath, "tdf99498.rtf"); + load("tdf99498.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -1304,7 +1303,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99498) CPPUNIT_TEST_FIXTURE(Test, testClassificatonPaste) { - load(mpTestDocumentPath, "hello.rtf"); + load("hello.rtf"); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xEnd = xText->getEnd(); @@ -1321,7 +1320,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClassificatonPaste) CPPUNIT_TEST_FIXTURE(Test, testTdf90097) { - load(mpTestDocumentPath, "tdf90097.rtf"); + load("tdf90097.rtf"); // Get the second child of the group shape. uno::Reference xGroup(getShape(1), uno::UNO_QUERY); uno::Reference xShape(xGroup->getByIndex(0), uno::UNO_QUERY); @@ -1335,7 +1334,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf90097) CPPUNIT_TEST_FIXTURE(Test, testTdf91684) { - load(mpTestDocumentPath, "tdf91684.rtf"); + load("tdf91684.rtf"); // Scaling of the group shape children were incorrect, this was 3203. // (Unit was assumed to be twips, but it was relative coordinates.) CPPUNIT_ASSERT_EQUAL(static_cast(1337), getShape(1)->getSize().Height); @@ -1343,7 +1342,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf91684) CPPUNIT_TEST_FIXTURE(Test, testFlip) { - load(mpTestDocumentPath, "flip.rtf"); + load("flip.rtf"); comphelper::SequenceAsHashMap aMap = getProperty>( getShapeByName(u"h-and-v"), "CustomShapeGeometry"); // This resulted in a uno::RuntimeException, as MirroredX wasn't set at all, so could not extract void to boolean. @@ -1368,7 +1367,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFlip) CPPUNIT_TEST_FIXTURE(Test, testTdf78506) { - load(mpTestDocumentPath, "tdf78506.rtf"); + load("tdf78506.rtf"); uno::Reference xPropertySet( getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference xLevels( @@ -1388,7 +1387,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78506) CPPUNIT_TEST_FIXTURE(Test, testTdf117403) { - load(mpTestDocumentPath, "tdf117403.rtf"); + load("tdf117403.rtf"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -1403,7 +1402,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf117403) CPPUNIT_TEST_FIXTURE(Test, testImportHeaderFooter) { - load(mpTestDocumentPath, "tdf108055.rtf"); + load("tdf108055.rtf"); // The RTF import sometimes added Header and Footer multiple Times // as well as added the Header to the document body. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); @@ -1458,7 +1457,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImportHeaderFooter) CPPUNIT_TEST_FIXTURE(Test, testTdf108947) { - load(mpTestDocumentPath, "tdf108947.rtf"); + load("tdf108947.rtf"); //Check if Headers/Footers contain what they should in this document uno::Reference xHeaderTextRight = getProperty>( getStyles("PageStyles")->getByName("Default Page Style"), "HeaderTextRight"); @@ -1477,7 +1476,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108947) CPPUNIT_TEST_FIXTURE(Test, testWatermark) { - load(mpTestDocumentPath, "watermark.rtf"); + load("watermark.rtf"); Size aExpectedSize(14965, 7482); uno::Reference xShape = getShape(1); awt::Size aActualSize(xShape->getSize()); @@ -1488,7 +1487,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermark) CPPUNIT_TEST_FIXTURE(Test, testTdf104016) { - load(mpTestDocumentPath, "tdf104016.rtf"); + load("tdf104016.rtf"); uno::Reference xParagraph(getParagraph(1), uno::UNO_QUERY); // This was beans::PropertyState_DIRECT_VALUE, leading to lack of // inheritance from numbering. @@ -1498,7 +1497,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104016) CPPUNIT_TEST_FIXTURE(Test, testTdf115242) { - load(mpTestDocumentPath, "tdf115242.rtf"); + load("tdf115242.rtf"); // This was 0, overridden left margin was lost by too aggressive style // deduplication. CPPUNIT_ASSERT_EQUAL(static_cast(2787), @@ -1507,7 +1506,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115242) CPPUNIT_TEST_FIXTURE(Test, testDefaultValues) { - load(mpTestDocumentPath, "default-values.rtf"); + load("default-values.rtf"); // tdf#105910: control words without values must be treated as having default values, // instead of being silently ignored @@ -1638,7 +1637,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDefaultValues) CPPUNIT_TEST_FIXTURE(Test, testParaStyleBottomMargin) { - load(mpTestDocumentPath, "para-style-bottom-margin.rtf"); + load("para-style-bottom-margin.rtf"); uno::Reference xPropertySet( getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(353), getProperty(xPropertySet, "ParaBottomMargin")); diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 5cb98bc928c7..1e8e3b64070b 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -71,8 +71,6 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/tiledrendering/data/"; - static std::ostream& operator<<(std::ostream& os, ViewShellId id) { os << static_cast(id); @@ -116,7 +114,8 @@ protected: }; SwTiledRenderingTest::SwTiledRenderingTest() - : m_bFound(true), + : SwModelTestBase("/sw/qa/extras/tiledrendering/data/"), + m_bFound(true), m_nSelectionBeforeSearchResult(0), m_nSelectionAfterSearchResult(0), m_nInvalidations(0), @@ -164,7 +163,7 @@ SwXTextDocument* SwTiledRenderingTest::createDoc(const char* pName) if (!pName) loadURL("private:factory/swriter", nullptr); else - load(DATA_DIRECTORY, pName); + load(pName); SwXTextDocument* pTextDocument = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDocument); diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx index 2b388d9b6175..f64647a2d830 100644 --- a/sw/qa/extras/txtimport/txtimport.cxx +++ b/sw/qa/extras/txtimport/txtimport.cxx @@ -49,7 +49,7 @@ public: CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf112191) { - load(mpTestDocumentPath, "bullets.odt"); + load("bullets.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -79,7 +79,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf112191) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withoutbom) { - load(mpTestDocumentPath, "UTF8WITHOUTBOM.txt"); + load("UTF8WITHOUTBOM.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -92,7 +92,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withoutbom) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withbom) { - load(mpTestDocumentPath, "UTF8WITHBOM.txt"); + load("UTF8WITHBOM.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -105,7 +105,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withbom) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithoutbom) { - load(mpTestDocumentPath, "UTF16LEWITHOUTBOM.txt"); + load("UTF16LEWITHOUTBOM.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithoutbom) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithbom) { - load(mpTestDocumentPath, "UTF16LEWITHBOM.txt"); + load("UTF16LEWITHBOM.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithbom) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf92161_gb18030) { - load(mpTestDocumentPath, "GB18030.txt"); + load("GB18030.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -144,7 +144,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf92161_gb18030) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithoutbom) { - load(mpTestDocumentPath, "UTF16BEWITHOUTBOM.txt"); + load("UTF16BEWITHOUTBOM.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithoutbom) CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithbom) { - load(mpTestDocumentPath, "UTF16BEWITHBOM.txt"); + load("UTF16BEWITHBOM.txt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); diff --git a/sw/qa/extras/uiwriter/data/floating_table/small_floating_table.odt b/sw/qa/extras/uiwriter/data/floating_table/small_floating_table.odt deleted file mode 100644 index 6b77569f2583..000000000000 Binary files a/sw/qa/extras/uiwriter/data/floating_table/small_floating_table.odt and /dev/null differ diff --git a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.doc b/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.doc deleted file mode 100644 index e5247f1598c2..000000000000 Binary files a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.doc and /dev/null differ diff --git a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.docx b/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.docx deleted file mode 100644 index cef1f7bf685d..000000000000 Binary files a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.docx and /dev/null differ diff --git a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.odt b/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.odt deleted file mode 100644 index eb2534ba4c52..000000000000 Binary files a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_floating_table.odt and /dev/null differ diff --git a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_small_floating_table.docx b/sw/qa/extras/uiwriter/data/floating_table/unfloatable_small_floating_table.docx deleted file mode 100644 index d51056af1177..000000000000 Binary files a/sw/qa/extras/uiwriter/data/floating_table/unfloatable_small_floating_table.docx and /dev/null differ diff --git a/sw/qa/extras/uiwriter/data/small_floating_table.odt b/sw/qa/extras/uiwriter/data/small_floating_table.odt new file mode 100644 index 000000000000..6b77569f2583 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/small_floating_table.odt differ diff --git a/sw/qa/extras/uiwriter/data/unfloatable_floating_table.doc b/sw/qa/extras/uiwriter/data/unfloatable_floating_table.doc new file mode 100644 index 000000000000..e5247f1598c2 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/unfloatable_floating_table.doc differ diff --git a/sw/qa/extras/uiwriter/data/unfloatable_floating_table.docx b/sw/qa/extras/uiwriter/data/unfloatable_floating_table.docx new file mode 100644 index 000000000000..cef1f7bf685d Binary files /dev/null and b/sw/qa/extras/uiwriter/data/unfloatable_floating_table.docx differ diff --git a/sw/qa/extras/uiwriter/data/unfloatable_floating_table.odt b/sw/qa/extras/uiwriter/data/unfloatable_floating_table.odt new file mode 100644 index 000000000000..eb2534ba4c52 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/unfloatable_floating_table.odt differ diff --git a/sw/qa/extras/uiwriter/data/unfloatable_small_floating_table.docx b/sw/qa/extras/uiwriter/data/unfloatable_small_floating_table.docx new file mode 100644 index 000000000000..d51056af1177 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/unfloatable_small_floating_table.docx differ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index a147f2f9a0c7..18693af898ba 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -63,8 +63,6 @@ namespace { -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; - void lcl_selectCharacters(SwPaM& rPaM, sal_Int32 first, sal_Int32 end) { rPaM.GetPoint()->nContent.Assign(rPaM.GetPointContentNode(), first); @@ -76,6 +74,10 @@ void lcl_selectCharacters(SwPaM& rPaM, sal_Int32 first, sal_Int32 end) class SwUiWriterTest : public SwModelTestBase { public: + SwUiWriterTest() : + SwModelTestBase("/sw/qa/extras/uiwriter/data/") + {} + std::unique_ptr readDOCXAutotext( std::u16string_view sFileName, bool bEmpty = false); void testRedlineFrame(char const*const file); @@ -88,7 +90,7 @@ std::unique_ptr SwUiWriterTest::readDOCXAutotext(std::u16string_vi OUString rURL = tmp.GetURL(); CPPUNIT_ASSERT_EQUAL( osl::FileBase::E_None, - osl::File::copy(m_directories.getURLFromSrc(DATA_DIRECTORY) + sFileName, rURL)); + osl::File::copy(createFileURL(sFileName), rURL)); SfxMedium aSrcMed(rURL, StreamMode::STD_READ); SwDoc* pDoc = createSwDoc(); @@ -105,7 +107,7 @@ std::unique_ptr SwUiWriterTest::readDOCXAutotext(std::u16string_vi void SwUiWriterTest::testRedlineFrame(char const*const file) { - SwDoc * pDoc(createSwDoc(DATA_DIRECTORY, file)); + SwDoc * pDoc(createSwDoc(file)); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // there is exactly one frame @@ -199,7 +201,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testRedlineFrameAtPara2ndParagraph) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testThreadedException) { - SvFileStream aFileStream(m_directories.getURLFromSrc(DATA_DIRECTORY) + "threadedException.fodt", StreamMode::READ); + SvFileStream aFileStream(createFileURL(u"threadedException.fodt"), StreamMode::READ); //threaded reading only kicks in if there is sufficient buffer to make it worthwhile, so read //from a SvFileStream to ensure that @@ -277,9 +279,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testInsertFileInInputFieldException) xBody->insertTextContent(xCursor, xContent, false); xCursor->goLeft(1, false); // try to insert some random file - OUString const url(m_directories.getURLFromSrc(DATA_DIRECTORY) + "fdo75110.odt"); // inserting even asserts in debug builds - document model goes invalid with input field split across 2 nodes - CPPUNIT_ASSERT_THROW(xInsertable->insertDocumentFromURL(url, {}), uno::RuntimeException); + CPPUNIT_ASSERT_THROW(xInsertable->insertDocumentFromURL(createFileURL(u"fdo75110.odt"), {}), uno::RuntimeException); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf67238) @@ -465,7 +466,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf135978) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo75110) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "fdo75110.odt"); + SwDoc* pDoc = createSwDoc("fdo75110.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SelAll(); @@ -478,7 +479,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo75110) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo75898) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "fdo75898.odt"); + SwDoc* pDoc = createSwDoc("fdo75898.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SelAll(); pWrtShell->InsertRow(1, true); @@ -517,7 +518,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testReplaceBackward) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo69893) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "fdo69893.odt"); + SwDoc* pDoc = createSwDoc("fdo69893.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SelAll(); // A1 is empty -> selects the whole table. @@ -531,7 +532,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo69893) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo70807) { - createSwDoc(DATA_DIRECTORY, "fdo70807.odt"); + createSwDoc("fdo70807.odt"); uno::Reference xStylesIter(getStyles("PageStyles"), uno::UNO_QUERY); @@ -699,7 +700,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testDOCXAutoTextGallery) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testWatermarkDOCX) { - SwDoc* const pDoc = createSwDoc(DATA_DIRECTORY, "watermark.docx"); + SwDoc* const pDoc = createSwDoc("watermark.docx"); SwDocShell* pDocShell = pDoc->GetDocShell(); const SfxWatermarkItem* pWatermark; SfxItemState eState = pDocShell->GetViewShell()->GetViewFrame()->GetDispatcher()->QueryState(SID_WATERMARK, pWatermark); @@ -727,7 +728,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testWatermarkPosition) int aPages = aPagesInDocument + aAdditionalPagesCount[i]; // Empty document with one Page Break - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "watermark-position.odt"); + SwDoc* pDoc = createSwDoc("watermark-position.odt"); SwEditShell* pEditShell = pDoc->GetEditShell(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xModel = pDoc->GetDocShell()->GetBaseModel(); @@ -862,7 +863,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf98512) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxSelect) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "shape-textbox.odt"); + SwDoc* pDoc = createSwDoc("shape-textbox.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(1); @@ -880,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxSelect) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxDelete) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "shape-textbox.odt"); + SwDoc* pDoc = createSwDoc("shape-textbox.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(0); @@ -897,7 +898,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxDelete) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testAnchorChangeSelection) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "test_anchor_as_character.odt"); + SwDoc* pDoc = createSwDoc("test_anchor_as_character.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(0); @@ -916,7 +917,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testAnchorChangeSelection) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCp1000071) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "cp1000071.odt"); + SwDoc* pDoc = createSwDoc("cp1000071.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); const SwRedlineTable& rTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); @@ -955,7 +956,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCp1000071) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxVertadjust) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "shape-textbox-vertadjust.odt"); + SwDoc* pDoc = createSwDoc("shape-textbox-vertadjust.odt"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(1); SwFrameFormat* pFormat = static_cast(pObject->GetUserCall())->GetFormat(); @@ -965,7 +966,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxVertadjust) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxAutosize) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "shape-textbox-autosize.odt"); + SwDoc* pDoc = createSwDoc("shape-textbox-autosize.odt"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); // 0-1 is the first UI-visible shape+textbox. SdrObject* pFirst = pPage->GetObj(0); @@ -983,7 +984,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testShapeTextboxAutosize) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo82191) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "fdo82191.odt"); + SwDoc* pDoc = createSwDoc("fdo82191.odt"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); // Make sure we have a single draw shape. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), SwTextBoxHelper::getCount(pPage)); @@ -1004,7 +1005,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCommentedWord) { // This word is commented. <- string in document // 123456789 <- character positions - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "commented-word.odt"); + SwDoc* pDoc = createSwDoc("commented-word.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Move the cursor into the second word. pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 5, /*bBasicCall=*/false); @@ -1026,7 +1027,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCommentedWord) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTextFieldGetAnchorGetTextInFooter) { - createSwDoc(DATA_DIRECTORY, "textfield-getanchor-gettext-in-footer.odt"); + createSwDoc("textfield-getanchor-gettext-in-footer.odt"); uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); @@ -1135,7 +1136,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testChineseConversionSimplifiedToTraditiona CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo85554) { // Load the document, it contains one shape with a textbox. - createSwDoc(DATA_DIRECTORY, "fdo85554.odt"); + createSwDoc("fdo85554.odt"); // Add a second shape to the document. uno::Reference xFactory(mxComponent, uno::UNO_QUERY); @@ -1155,10 +1156,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo85554) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testMergeDoc) { - SwDoc* const pDoc1(createSwDoc(DATA_DIRECTORY, "merge-change1.odt")); + SwDoc* const pDoc1(createSwDoc("merge-change1.odt")); auto xDoc2Component(loadFromDesktop( - m_directories.getURLFromSrc(DATA_DIRECTORY) + "merge-change2.odt", + createFileURL(u"merge-change2.odt"), "com.sun.star.text.TextDocument")); auto pxDoc2Document( dynamic_cast(xDoc2Component.get())); @@ -1186,7 +1187,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testMergeDoc) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCreatePortions) { - createSwDoc(DATA_DIRECTORY, "uno-cycle.odt"); + createSwDoc("uno-cycle.odt"); uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xText(xBookmarksSupplier->getBookmarks()->getByName("Mark"), uno::UNO_QUERY); uno::Reference xTextCursor(xText->getAnchor(), uno::UNO_QUERY); @@ -1360,7 +1361,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf137532) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo87448) { - createSwDoc(DATA_DIRECTORY, "fdo87448.odt"); + createSwDoc("fdo87448.odt"); // Save the first shape to a metafile. uno::Reference xGraphicExporter = drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext()); @@ -1443,7 +1444,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf68183) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCp1000115) { - createSwDoc(DATA_DIRECTORY, "cp1000115.fodt"); + createSwDoc("cp1000115.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; @@ -1483,7 +1484,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf63214) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf90003) { - createSwDoc(DATA_DIRECTORY, "tdf90003.odt"); + createSwDoc("tdf90003.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); // This was 1: an unexpected fly portion was created, resulting in too diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 0611bed15155..239aa71ac3ad 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -39,17 +39,15 @@ #include #include -namespace -{ -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; -constexpr OUStringLiteral FLOATING_TABLE_DATA_DIRECTORY - = u"/sw/qa/extras/uiwriter/data/floating_table/"; -} // namespace - /// Second set of tests asserting the behavior of Writer user interface shells. class SwUiWriterTest2 : public SwModelTestBase { public: + SwUiWriterTest2() + : SwModelTestBase("/sw/qa/extras/uiwriter/data/") + { + } + virtual std::unique_ptr preTest(const char* filename) override { m_aSavedSettings = Application::GetSettings(); @@ -71,7 +69,7 @@ protected: CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf47471_paraStyleBackground) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf47471_paraStyleBackground.odt"); + SwDoc* pDoc = createSwDoc("tdf47471_paraStyleBackground.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(OUString("00Background"), @@ -104,7 +102,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf47471_paraStyleBackground) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf117923.docx"); + SwDoc* pDoc = createSwDoc("tdf117923.docx"); // Ensure that all text portions are calculated before testing. SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); @@ -154,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534) { // Copy the first paragraph of the document. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf101534.fodt"); + SwDoc* pDoc = createSwDoc("tdf101534.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->EndPara(/*bSelect=*/true); rtl::Reference pTransfer = new SwTransferable(*pWrtShell); @@ -269,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineInHiddenSection) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineSplitContentNode) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "try2.fodt"); + SwDoc* pDoc = createSwDoc("try2.fodt"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwViewOption aViewOptions(*pWrtShell->GetViewOptions()); @@ -413,7 +411,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136704) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf134250) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134250.fodt"); + SwDoc* pDoc = createSwDoc("tdf134250.fodt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), @@ -483,7 +481,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf134250) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf134436) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134436.fodt"); + SwDoc* pDoc = createSwDoc("tdf134436.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -563,7 +561,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf134436) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf134252) { - createSwDoc(DATA_DIRECTORY, "tdf134252.fodt"); + createSwDoc("tdf134252.fodt"); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( @@ -625,7 +623,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf134252) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136452) { - SwDoc* const pDoc(createSwDoc(DATA_DIRECTORY, "tdf136452.fodt")); + SwDoc* const pDoc(createSwDoc("tdf136452.fodt")); SwNodeOffset const nNodes(pDoc->GetNodes().Count()); @@ -671,7 +669,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136452) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136453) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf136453.fodt"); + SwDoc* pDoc = createSwDoc("tdf136453.fodt"); SwWrtShell* const pWrtShell(pDoc->GetDocShell()->GetWrtShell()); SwNodeOffset const nNodes(pDoc->GetNodes().Count()); @@ -798,7 +796,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137245) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf132236) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132236.odt"); + SwDoc* pDoc = createSwDoc("tdf132236.odt"); // select everything and delete SwWrtShell* const pWrtShell(pDoc->GetDocShell()->GetWrtShell()); @@ -1200,7 +1198,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf39721) // FIXME: disabled on Windows because of a not reproducible problem (not related to the patch) #if !defined(_WIN32) // check move down with redlining - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39721.fodt"); + SwDoc* pDoc = createSwDoc("tdf39721.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); //turn on red-lining and show changes @@ -1253,7 +1251,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf145066_bad_paragraph_deletion) { // check move down with redlining: jumping over a deleted paragraph // resulted bad deletion of the not deleted adjacent paragraph in Show Changes mode - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39721.fodt"); + SwDoc* pDoc = createSwDoc("tdf39721.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -1292,7 +1290,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf145311_move_over_empty_paragraphs) { // check move up/down with redlining: jumping over an empty paragraph // resulted bad insertion of the empty paragraph in Show Changes mode - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf145311.fodt"); + SwDoc* pDoc = createSwDoc("tdf145311.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -1325,7 +1323,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf145311_move_over_empty_paragraphs) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); @@ -1354,7 +1352,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819_keep_numbering_with_Undo) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819b.odt"); + SwDoc* pDoc = createSwDoc("tdf54819b.odt"); // heading CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), @@ -1438,7 +1436,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571_keep_numbering_with_Undo) { // as the previous test, but with partial paragraph deletion: // all deleted paragraphs get the formatting of the first (the partially deleted) one - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819b.odt"); + SwDoc* pDoc = createSwDoc("tdf54819b.odt"); // heading CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), @@ -1540,7 +1538,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571_keep_numbering_with_Reject) { // as the previous test, but with partial paragraph deletion: // all deleted paragraphs get the formatting of the first (the partially deleted) one - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819b.odt"); + SwDoc* pDoc = createSwDoc("tdf54819b.odt"); // heading CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), @@ -1836,7 +1834,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf64242_optimizeTable.odt"); + SwDoc* pDoc = createSwDoc("tdf64242_optimizeTable.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1877,7 +1875,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf45525) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf45525.odt"); + SwDoc* pDoc = createSwDoc("tdf45525.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1910,7 +1908,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf45525) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126784_distributeSelectedColumns) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126784_distributeSelectedColumns.odt"); + SwDoc* pDoc = createSwDoc("tdf126784_distributeSelectedColumns.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1937,7 +1935,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126784_distributeSelectedColumns) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf144317) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf144317.odt"); + SwDoc* pDoc = createSwDoc("tdf144317.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1967,7 +1965,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf144317) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf108687_tabstop) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf108687_tabstop.odt"); + SwDoc* pDoc = createSwDoc("tdf108687_tabstop.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwNodeOffset nStartIndex = pWrtShell->GetCursor()->GetPointNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(9), nStartIndex); @@ -1984,7 +1982,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf108687_tabstop) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); @@ -2017,7 +2015,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf144058) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf144058.fodt"); + SwDoc* pDoc = createSwDoc("tdf144058.fodt"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); @@ -2053,7 +2051,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf144058) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147507) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf147507.fodt"); + SwDoc* pDoc = createSwDoc("tdf147507.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2073,7 +2071,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147507) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119019) { // check handling of overlapping redlines - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf119019.docx"); + SwDoc* pDoc = createSwDoc("tdf119019.docx"); CPPUNIT_ASSERT_EQUAL(OUString("Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus."), getParagraph(2)->getString()); @@ -2104,7 +2102,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119019) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119824) { // check handling of overlapping redlines with Redo - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf119019.docx"); + SwDoc* pDoc = createSwDoc("tdf119019.docx"); CPPUNIT_ASSERT_EQUAL(OUString("Pellentesque habitant morbi tristique senectus " "et netus et malesuada fames ac turpis egestas. " @@ -2164,7 +2162,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119824) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf105413) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105413.fodt"); + SwDoc* pDoc = createSwDoc("tdf105413.fodt"); // all paragraphs have got Standard paragraph style for (int i = 1; i < 4; ++i) @@ -2202,7 +2200,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf105413) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "num-parent-style.docx"); + SwDoc* pDoc = createSwDoc("num-parent-style.docx"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 2"), getProperty(getParagraph(2), "ParaStyleName")); @@ -2277,7 +2275,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817_round_trip) { - createSwDoc(DATA_DIRECTORY, "tdf76817.fodt"); + createSwDoc("tdf76817.fodt"); // save it to DOCX reload("Office Open XML Text", "tdf76817.docx"); @@ -2360,7 +2358,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817_round_trip) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817_custom_outline) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf76817.docx"); + SwDoc* pDoc = createSwDoc("tdf76817.docx"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); @@ -2412,7 +2410,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf76817_custom_outline) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf123102) { - createSwDoc(DATA_DIRECTORY, "tdf123102.odt"); + createSwDoc("tdf123102.odt"); // insert a new row after a vertically merged cell dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {}); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -2425,7 +2423,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf123102) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButtonSmallTable) { // The floating table in the test document is too small, so we don't provide an unfloat button - SwDoc* pDoc = createSwDoc(FLOATING_TABLE_DATA_DIRECTORY, "small_floating_table.odt"); + SwDoc* pDoc = createSwDoc("small_floating_table.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2460,7 +2458,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButton) OString sTestFileName = OUStringToOString(aTestFile, RTL_TEXTENCODING_UTF8); OString sFailureMessage = OString::Concat("Failure in the test file: ") + sTestFileName; - SwDoc* pDoc = createSwDoc(FLOATING_TABLE_DATA_DIRECTORY, sTestFileName.getStr()); + SwDoc* pDoc = createSwDoc(sTestFileName.getStr()); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_MESSAGE(sFailureMessage.getStr(), pWrtShell); @@ -2495,7 +2493,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButton) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButtonReadOnlyMode) { // In read only mode we don't show the unfloat button even if we have a multipage floating table - SwDoc* pDoc = createSwDoc(FLOATING_TABLE_DATA_DIRECTORY, "unfloatable_floating_table.odt"); + SwDoc* pDoc = createSwDoc("unfloatable_floating_table.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); pWrtShell->SetReadonlyOption(true); @@ -2531,7 +2529,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloating) OString sFailureMessage = OString::Concat("Failure in the test file: ") + sTestFileName; // Test what happens when pushing the unfloat button - SwDoc* pDoc = createSwDoc(FLOATING_TABLE_DATA_DIRECTORY, "unfloatable_floating_table.docx"); + SwDoc* pDoc = createSwDoc("unfloatable_floating_table.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_MESSAGE(sFailureMessage.getStr(), pWrtShell); @@ -2602,7 +2600,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRTLparaStyle_LocaleArabic) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122893) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105413.fodt"); + SwDoc* pDoc = createSwDoc("tdf105413.fodt"); // all paragraphs are left-aligned with preset single line spacing for (int i = 1; i < 4; ++i) @@ -2643,7 +2641,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122893) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122901) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105413.fodt"); + SwDoc* pDoc = createSwDoc("tdf105413.fodt"); // all paragraphs with zero borders for (int i = 1; i < 4; ++i) @@ -2681,7 +2679,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122901) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122942) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf122942.odt"); + SwDoc* pDoc = createSwDoc("tdf122942.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Do the moral equivalent of mouse button down, move and up. @@ -2720,7 +2718,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122942) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf132160) { - createSwDoc(DATA_DIRECTORY, "tdf132160.odt"); + createSwDoc("tdf132160.odt"); // this would crash due to delete redline starting with ToX dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {}); @@ -2735,7 +2733,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf132160) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137526) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132160.odt"); + SwDoc* pDoc = createSwDoc("tdf132160.odt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -2759,7 +2757,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137526) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137684) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132160.odt"); + SwDoc* pDoc = createSwDoc("tdf132160.odt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -2788,7 +2786,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137684) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137503) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132160.odt"); + SwDoc* pDoc = createSwDoc("tdf132160.odt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -2846,7 +2844,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf138605) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf138135) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132160.odt"); + SwDoc* pDoc = createSwDoc("tdf132160.odt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -2876,7 +2874,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf138135) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf52391) { - createSwDoc(DATA_DIRECTORY, "tdf52391.fodt"); + createSwDoc("tdf52391.fodt"); dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {}); @@ -2889,7 +2887,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf52391) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137771) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132160.odt"); + SwDoc* pDoc = createSwDoc("tdf132160.odt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -2934,7 +2932,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137771) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf142130.fodt"); + SwDoc* pDoc = createSwDoc("tdf142130.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2974,7 +2972,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf142196.fodt"); + SwDoc* pDoc = createSwDoc("tdf142196.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -3018,7 +3016,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142700) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf142700.fodt"); + SwDoc* pDoc = createSwDoc("tdf142700.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -3062,7 +3060,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142700) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139120) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); // switch on "Show changes in margin" mode @@ -3115,7 +3113,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139120) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testJoinParaChangesInMargin) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -3152,7 +3150,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testJoinParaChangesInMargin) CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140757) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); // switch on "Show changes in margin" mode dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); @@ -3207,7 +3205,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testConditionalHiddenSectionIssue) if (!pPDFium) return; - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HiddenSection.odt"); + SwDoc* pDoc = createSwDoc("HiddenSection.odt"); // Check section conditional hidden status - all should be hidden (IsCondHidden == true) for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 5590abefc6e1..3c615d7ea538 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -29,19 +29,19 @@ #include #include -namespace -{ -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; -} // namespace - /// Third set of tests asserting the behavior of Writer user interface shells. class SwUiWriterTest3 : public SwModelTestBase { +public: + SwUiWriterTest3() + : SwModelTestBase("/sw/qa/extras/uiwriter/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145731) { - createSwDoc(DATA_DIRECTORY, "tdf145731.odt"); + createSwDoc("tdf145731.odt"); CPPUNIT_ASSERT_EQUAL(9, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145731) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147199) { - createSwDoc(DATA_DIRECTORY, "tdf147199.docx"); + createSwDoc("tdf147199.docx"); CPPUNIT_ASSERT_EQUAL(7, getShapes()); @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147199) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139843) { - createSwDoc(DATA_DIRECTORY, "tdf139843.odt"); + createSwDoc("tdf139843.odt"); int nPages = getPages(); @@ -128,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139843) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146848) { // Reuse existing document - createSwDoc(DATA_DIRECTORY, "tdf77014.odt"); + createSwDoc("tdf77014.odt"); dispatchCommand(mxComponent, ".uno:SelectAll", {}); Scheduler::ProcessEventsToIdle(); @@ -159,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146848) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf149507) { - createSwDoc(DATA_DIRECTORY, "tdf149507.docx"); + createSwDoc("tdf149507.docx"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -195,7 +195,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf149507) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145321) { - createSwDoc(DATA_DIRECTORY, "tdf145321.odt"); + createSwDoc("tdf145321.odt"); CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(3, getPages()); @@ -219,7 +219,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145321) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testVariableFieldTableRowSplitHeader) { - SwDoc* const pDoc = createSwDoc(DATA_DIRECTORY, "variable-field-table-row-split-header.fodt"); + SwDoc* const pDoc = createSwDoc("variable-field-table-row-split-header.fodt"); // finish layout Scheduler::ProcessEventsToIdle(); @@ -390,7 +390,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testVariableFieldTableRowSplitHeader) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126) { - createSwDoc(DATA_DIRECTORY, "tdf147126.docx"); + createSwDoc("tdf147126.docx"); CPPUNIT_ASSERT(mxComponent); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -514,7 +514,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148868) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf148868.odt"); + SwDoc* pDoc = createSwDoc("tdf148868.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -533,7 +533,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148868) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129382.docx"); + SwDoc* pDoc = createSwDoc("tdf129382.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(8, getShapes()); @@ -563,7 +563,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135662) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf135662.odt"); + SwDoc* pDoc = createSwDoc("tdf135662.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -586,7 +586,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135662) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134227) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134227.docx"); + SwDoc* pDoc = createSwDoc("tdf134227.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(4, getShapes()); @@ -614,7 +614,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134227) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139638) { - createSwDoc(DATA_DIRECTORY, "tdf139638.odt"); + createSwDoc("tdf139638.odt"); uno::Reference xIndexSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexes = xIndexSupplier->getDocumentIndexes(); @@ -627,7 +627,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139638) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135412) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf135412.docx"); + SwDoc* pDoc = createSwDoc("tdf135412.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(4, getShapes()); @@ -661,7 +661,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135412) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf138482) { - createSwDoc(DATA_DIRECTORY, "tdf138482.docx"); + createSwDoc("tdf138482.docx"); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -680,7 +680,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf138482) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134965) { - createSwDoc(DATA_DIRECTORY, "tdf134965.odt"); + createSwDoc("tdf134965.odt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -709,7 +709,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128375) { for (sal_Int32 i = 0; i < 2; ++i) { - createSwDoc(DATA_DIRECTORY, "tdf128375.docx"); + createSwDoc("tdf128375.docx"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128375) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135061) { - createSwDoc(DATA_DIRECTORY, "tdf135061.odt"); + createSwDoc("tdf135061.odt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -765,7 +765,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135061) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132911.odt"); + SwDoc* pDoc = createSwDoc("tdf132911.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf61154) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf61154.fodt"); + SwDoc* pDoc = createSwDoc("tdf61154.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoNextTOXBase(); @@ -865,7 +865,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124904) { // don't show deletions in referenced text, // (except if the full text is deleted) - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124904.fodt"); + SwDoc* pDoc = createSwDoc("tdf124904.fodt"); // show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -893,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124904) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf100691) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf100691.fodt"); + SwDoc* pDoc = createSwDoc("tdf100691.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoNextTOXBase(); @@ -912,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf100691) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134404) { - createSwDoc(DATA_DIRECTORY, "tdf134404.odt"); + createSwDoc("tdf134404.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -940,7 +940,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134404) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf112342) { - createSwDoc(DATA_DIRECTORY, "tdf112342.docx"); + createSwDoc("tdf112342.docx"); //Get the last para uno::Reference xPara = getParagraph(3); @@ -957,7 +957,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf112342) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132321) { - createSwDoc(DATA_DIRECTORY, "tdf132321.odt"); + createSwDoc("tdf132321.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -976,7 +976,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132321) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135056) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf135056.odt"); + SwDoc* pDoc = createSwDoc("tdf135056.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pWrtShell->GetTOXCount()); @@ -996,7 +996,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135056) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132597) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132597.odt"); + SwDoc* pDoc = createSwDoc("tdf132597.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getShapes()); @@ -1024,7 +1024,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132597) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139737) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf139737.fodt"); + SwDoc* pDoc = createSwDoc("tdf139737.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xModel(mxComponent, uno::UNO_QUERY); @@ -1152,7 +1152,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147206) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf144840) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf144840.odt"); + SwDoc* pDoc = createSwDoc("tdf144840.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -1192,7 +1192,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf144840) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf131963) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf131963.docx"); + SwDoc* pDoc = createSwDoc("tdf131963.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(11, getPages()); @@ -1217,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf131963) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132596) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132596.docx"); + SwDoc* pDoc = createSwDoc("tdf132596.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -1243,7 +1243,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132596) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126626.docx"); + SwDoc* pDoc = createSwDoc("tdf126626.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -1272,7 +1272,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133967) { - createSwDoc(DATA_DIRECTORY, "tdf133967.odt"); + createSwDoc("tdf133967.odt"); CPPUNIT_ASSERT_EQUAL(6, getPages()); @@ -1298,7 +1298,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133967) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132187) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132187.odt"); + SwDoc* pDoc = createSwDoc("tdf132187.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -1326,7 +1326,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132187) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130094) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130094.fodt"); + SwDoc* pDoc = createSwDoc("tdf130094.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(OUString("First"), getParagraph(1)->getString()); @@ -1371,7 +1371,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130094) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135733) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf135733.odt"); + SwDoc* pDoc = createSwDoc("tdf135733.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1418,7 +1418,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135733) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128739.docx"); + SwDoc* pDoc = createSwDoc("tdf128739.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(OUString("Fehler: Verweis nicht gefunden"), getParagraph(1)->getString()); @@ -1441,7 +1441,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124722) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124722.rtf"); + SwDoc* pDoc = createSwDoc("tdf124722.rtf"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(22, getPages()); @@ -1463,7 +1463,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124722) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "udindex3.odt"); + SwDoc* pDoc = createSwDoc("udindex3.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwView& rView(*pDoc->GetDocShell()->GetView()); @@ -1583,7 +1583,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261) { - createSwDoc(DATA_DIRECTORY, "tdf125261.odt"); + createSwDoc("tdf125261.odt"); CPPUNIT_ASSERT_EQUAL(OUString("https://www.example.com/"), getProperty(getRun(getParagraph(1), 1), "HyperLinkURL")); @@ -1599,7 +1599,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141175) { - createSwDoc(DATA_DIRECTORY, "tdf141175.odt"); + createSwDoc("tdf141175.odt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -1629,7 +1629,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141175) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133990) { - createSwDoc(DATA_DIRECTORY, "tdf133990.odt"); + createSwDoc("tdf133990.odt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -1653,7 +1653,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133990) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126504) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126504.odt"); + SwDoc* pDoc = createSwDoc("tdf126504.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1701,7 +1701,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126504) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133982) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf133982.docx"); + SwDoc* pDoc = createSwDoc("tdf133982.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1726,7 +1726,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133982) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134253) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134253.odt"); + SwDoc* pDoc = createSwDoc("tdf134253.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1760,7 +1760,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, TestAsCharTextBox) // tdf#140158 Remove horizontal positioning of As_char textboxes, because // the anchor moving does the same for it. - createSwDoc(DATA_DIRECTORY, "AsCharTxBxTest.docx"); + createSwDoc("AsCharTxBxTest.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); // Add 3x tab to the doc @@ -1807,7 +1807,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, TestAsCharTextBox) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf140975) { // Load the bugdoc - createSwDoc(DATA_DIRECTORY, "tdf140975.docx"); + createSwDoc("tdf140975.docx"); // Set the Anchor of the shape to As_Char dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {}); @@ -1834,7 +1834,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf140975) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636) { - createSwDoc(DATA_DIRECTORY, "tdf76636.doc"); + createSwDoc("tdf76636.doc"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1872,7 +1872,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636_2) { - createSwDoc(DATA_DIRECTORY, "tdf76636.doc"); + createSwDoc("tdf76636.doc"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1907,7 +1907,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636_2) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf140828) { - createSwDoc(DATA_DIRECTORY, "tdf140828.docx"); + createSwDoc("tdf140828.docx"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xShp = getShape(1); @@ -1937,7 +1937,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf140828) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132725) { - createSwDoc(DATA_DIRECTORY, "tdf132725.odt"); + createSwDoc("tdf132725.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(OUString("AA"), getParagraph(1)->getString()); @@ -1978,7 +1978,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132725) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126340) { - createSwDoc(DATA_DIRECTORY, "tdf126340.odt"); + createSwDoc("tdf126340.odt"); dispatchCommand(mxComponent, ".uno:GoDown", {}); // without the fix, it crashes @@ -1990,7 +1990,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126340) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124397) { - createSwDoc(DATA_DIRECTORY, "tdf124397.docx"); + createSwDoc("tdf124397.docx"); uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), @@ -2008,7 +2008,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124397) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf108124) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf108124.odt"); + SwDoc* pDoc = createSwDoc("tdf108124.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextGraphicObjectsSupplier(mxComponent, @@ -2055,7 +2055,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf107975) { // This test also covers tdf#117185 tdf#110442 - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf107975.odt"); + SwDoc* pDoc = createSwDoc("tdf107975.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -2137,7 +2137,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf107975) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134021) { - createSwDoc(DATA_DIRECTORY, "tdf134021.docx"); + createSwDoc("tdf134021.docx"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -2162,7 +2162,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134021) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf136778) { - createSwDoc(DATA_DIRECTORY, "tdf136778.docx"); + createSwDoc("tdf136778.docx"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -2187,7 +2187,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf136778) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf123285) { - createSwDoc(DATA_DIRECTORY, "tdf123285.odt"); + createSwDoc("tdf123285.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT_EQUAL(true, @@ -2210,7 +2210,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf123285) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130746) { - createSwDoc(DATA_DIRECTORY, "tdf130746.odt"); + createSwDoc("tdf130746.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2245,7 +2245,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130746) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129805) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129805.docx"); + SwDoc* pDoc = createSwDoc("tdf129805.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(OUString("x"), getParagraph(1)->getString()); @@ -2262,7 +2262,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129805) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130685) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130685.odt"); + SwDoc* pDoc = createSwDoc("tdf130685.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -2296,7 +2296,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130685) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132944) { - createSwDoc(DATA_DIRECTORY, "tdf132944.odt"); + createSwDoc("tdf132944.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -2314,7 +2314,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132944) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf104649) { - createSwDoc(DATA_DIRECTORY, "tdf104649.docx"); + createSwDoc("tdf104649.docx"); CPPUNIT_ASSERT_EQUAL(OUString("Test"), getParagraph(1)->getString()); @@ -2332,7 +2332,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf104649) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134931) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134931.odt"); + SwDoc* pDoc = createSwDoc("tdf134931.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2368,7 +2368,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134931) CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130680) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130680.odt"); + SwDoc* pDoc = createSwDoc("tdf130680.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index d75018981659..5c20cf6c9d9b 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -52,8 +52,6 @@ namespace { -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; - void lcl_selectCharacters(SwPaM& rPaM, sal_Int32 first, sal_Int32 end) { rPaM.GetPoint()->nContent.Assign(rPaM.GetPointContentNode(), first); @@ -65,12 +63,17 @@ void lcl_selectCharacters(SwPaM& rPaM, sal_Int32 first, sal_Int32 end) class SwUiWriterTest4 : public SwModelTestBase { public: + SwUiWriterTest4() + : SwModelTestBase("/sw/qa/extras/uiwriter/data/") + { + } + void mergeDocs(const char* aDestDoc, const char* aInsertDoc); }; void SwUiWriterTest4::mergeDocs(const char* aDestDoc, const char* aInsertDoc) { - createSwDoc(DATA_DIRECTORY, aDestDoc); + createSwDoc(aDestDoc); // set a page cursor into the end of the document uno::Reference xModel(mxComponent, uno::UNO_QUERY); @@ -82,8 +85,7 @@ void SwUiWriterTest4::mergeDocs(const char* aDestDoc, const char* aInsertDoc) // insert the same document at current cursor position { - const OUString insertFileid - = m_directories.getURLFromSrc(DATA_DIRECTORY) + OUString::createFromAscii(aInsertDoc); + const OUString insertFileid = createFileURL(OUString::createFromAscii(aInsertDoc)); uno::Sequence aPropertyValues( comphelper::InitPropertySequence({ { "Name", uno::Any(insertFileid) } })); dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues); @@ -121,7 +123,7 @@ static OUString lcl_translitTest(SwDoc& rDoc, const SwPaM& rPaM, Transliteration CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf146449) { - load(DATA_DIRECTORY, "tdf146449.odt"); + load("tdf146449.odt"); auto pDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pDoc); @@ -475,7 +477,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf148148) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96943) { // Enable hide whitespace mode. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf96943.odt"); + SwDoc* pDoc = createSwDoc("tdf96943.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwViewOption aViewOptions(*pWrtShell->GetViewOptions()); aViewOptions.SetHideWhitespaceMode(true); @@ -642,7 +644,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96479) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testBookmarkCollapsed) { // load document - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "collapsed_bookmark.odt"); + SwDoc* pDoc = createSwDoc("collapsed_bookmark.odt"); CPPUNIT_ASSERT(pDoc); // save original document @@ -865,7 +867,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNew) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNewAfterReload) { // load document - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "collapsed_bookmark.odt"); + SwDoc* pDoc = createSwDoc("collapsed_bookmark.odt"); CPPUNIT_ASSERT(pDoc); // write "abc" to area marked with "testBookmark" bookmark @@ -930,7 +932,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96961) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf88453) { - createSwDoc(DATA_DIRECTORY, "tdf88453.odt"); + createSwDoc("tdf88453.odt"); calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 0: the table does not fit the first page, but it wasn't split @@ -940,7 +942,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf88453) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf88453Table) { - createSwDoc(DATA_DIRECTORY, "tdf88453-table.odt"); + createSwDoc("tdf88453-table.odt"); calcLayout(); // This was 2: layout could not split the large outer table in the document // into 3 pages. @@ -1005,7 +1007,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testSmallCaps) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf98987) { - createSwDoc(DATA_DIRECTORY, "tdf98987.docx"); + createSwDoc("tdf98987.docx"); calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/SdrObject", "name", @@ -1031,7 +1033,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf98987) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf99004) { - createSwDoc(DATA_DIRECTORY, "tdf99004.docx"); + createSwDoc("tdf99004.docx"); calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nTextbox1Top @@ -1051,7 +1053,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf99004) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf84695) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf84695.odt"); + SwDoc* pDoc = createSwDoc("tdf84695.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(1); @@ -1076,7 +1078,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf84695) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf84695NormalChar) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf84695.odt"); + SwDoc* pDoc = createSwDoc("tdf84695.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(1); @@ -1100,7 +1102,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf84695NormalChar) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf84695Tab) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf84695-tab.odt"); + SwDoc* pDoc = createSwDoc("tdf84695-tab.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(0); @@ -1340,7 +1342,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRedlineViewAuthor) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf91292) { - createSwDoc(DATA_DIRECTORY, "tdf91292_paraBackground.docx"); + createSwDoc("tdf91292_paraBackground.docx"); uno::Reference xPropertySet(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE("Solid background color", drawing::FillStyle_SOLID, getProperty(xPropertySet, "FillStyle")); @@ -1360,7 +1362,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf91292) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf78727) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf78727.docx"); + SwDoc* pDoc = createSwDoc("tdf78727.docx"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); // This was 1: make sure we don't loose the TextBox anchored inside the // table that is moved inside a text frame. @@ -1451,7 +1453,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf95699) // Open the document with single FORMCHECKBOX field, select all and copy to clipboard // then check that clipboard contains the FORMCHECKBOX in text body. // Previously that failed. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf95699.odt"); + SwDoc* pDoc = createSwDoc("tdf95699.odt"); IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); SwDoc aClipboard; @@ -1471,7 +1473,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104032) // Open the document with FORMCHECKBOX field, select it and copy to clipboard // Go to end of document and paste it, then undo // Previously that asserted in debug build. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf104032.odt"); + SwDoc* pDoc = createSwDoc("tdf104032.odt"); sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); SwDoc aClipboard; SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -1485,7 +1487,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104032) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104440) { - createSwDoc(DATA_DIRECTORY, "tdf104440.odt"); + createSwDoc("tdf104440.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//page[2]/body/txt/anchored"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; @@ -1498,7 +1500,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104440) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104425) { - createSwDoc(DATA_DIRECTORY, "tdf104425.odt"); + createSwDoc("tdf104425.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // The document contains one top-level 1-cell table with minimum row height set to 70 cm, // and the cell contents does not exceed the minimum row height. @@ -1518,7 +1520,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104425) // accepting change tracking gets stuck on change CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104814) { - SwDoc* const pDoc1(createSwDoc(DATA_DIRECTORY, "tdf104814.docx")); + SwDoc* const pDoc1(createSwDoc("tdf104814.docx")); SwEditShell* const pEditShell(pDoc1->GetEditShell()); @@ -1530,7 +1532,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104814) // crash at redo of accepting table change tracking imported from DOCX CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRedlineRedoCrash) { - SwDoc* const pDoc(createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx")); + SwDoc* const pDoc(createSwDoc("TC-table-del-add.docx")); sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); // accept all redlines, Undo and accept all redlines again @@ -1546,7 +1548,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRedlineRedoCrash) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx"); + SwDoc* pDoc = createSwDoc("TC-table-del-add.docx"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -1618,7 +1620,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx"); + SwDoc* pDoc = createSwDoc("TC-table-del-add.docx"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -1677,7 +1679,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf147182_AcceptAllChangesInTableSelection) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx"); + SwDoc* pDoc = createSwDoc("TC-table-del-add.docx"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -1731,7 +1733,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf147182_AcceptAllChangesInTableSelec CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf66405) { // Imported formula should have zero margins - createSwDoc(DATA_DIRECTORY, "tdf66405.docx"); + createSwDoc("tdf66405.docx"); uno::Reference xEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xEmbeddedObjects @@ -1766,7 +1768,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf66405) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf35021_tabOverMarginDemo) { #if HAVE_MORE_FONTS - createSwDoc(DATA_DIRECTORY, "tdf35021_tabOverMarginDemo.doc"); + createSwDoc("tdf35021_tabOverMarginDemo.doc"); calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Tabs should go past the margin @ ~3381 @@ -1790,7 +1792,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf35021_tabOverMarginDemo) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf106701_tabOverMarginAutotab) { - createSwDoc(DATA_DIRECTORY, "tdf106701_tabOverMarginAutotab.doc"); + createSwDoc("tdf106701_tabOverMarginAutotab.doc"); calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // The right margin is ~3378 @@ -1803,7 +1805,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf106701_tabOverMarginAutotab) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104492) { - createSwDoc(DATA_DIRECTORY, "tdf104492.docx"); + createSwDoc("tdf104492.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // The document should split table over 3 pages. assertXPath(pXmlDoc, "//page", 3); @@ -1815,7 +1817,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107025) // they are cluttered because of negative value or // break into multiple lines because of overflow. // The test document uses DFKAI-SB shipped with Windows. - createSwDoc(DATA_DIRECTORY, "tdf107025.odt"); + createSwDoc("tdf107025.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Verify the number of characters in each line. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), @@ -1839,7 +1841,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107025) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107362) { - createSwDoc(DATA_DIRECTORY, "tdf107362.odt"); + createSwDoc("tdf107362.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nHeight = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]", "nHeight").toInt32(); @@ -1859,7 +1861,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107362) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf105417) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105417.odt"); + SwDoc* pDoc = createSwDoc("tdf105417.odt"); CPPUNIT_ASSERT(pDoc); SwView* pView = pDoc->GetDocShell()->GetView(); CPPUNIT_ASSERT(pView); @@ -1883,7 +1885,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf105417) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf105625) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105625.fodt"); + SwDoc* pDoc = createSwDoc("tdf105625.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Ensure correct initial setting std::shared_ptr batch( @@ -1917,7 +1919,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protected) { // Similar to testTdf105625 except this is in a protected section, // so read-only is already true when fieldmarks are considered. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125151_protected.fodt"); + SwDoc* pDoc = createSwDoc("tdf125151_protected.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Ensure correct initial setting std::shared_ptr batch( @@ -1935,7 +1937,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protected) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protectedB) { // Similar to testTdf105625 except this is protected with the Protect_Form compat setting - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125151_protectedB.fodt"); + SwDoc* pDoc = createSwDoc("tdf125151_protectedB.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Ensure correct initial setting std::shared_ptr batch( @@ -1951,7 +1953,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protectedB) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf106736) { - createSwDoc(DATA_DIRECTORY, "tdf106736-grid.odt"); + createSwDoc("tdf106736-grid.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nWidth = getXPath(pXmlDoc, "(//Text[@nType='PortionType::TabLeft'])[1]", "nWidth").toInt32(); @@ -1963,7 +1965,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf106736) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testMsWordCompTrailingBlanks) { // The option is true in settings.xml - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "MsWordCompTrailingBlanksTrue.odt"); + SwDoc* pDoc = createSwDoc("MsWordCompTrailingBlanksTrue.odt"); CPPUNIT_ASSERT_EQUAL(true, pDoc->getIDocumentSettingAccess().get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS)); calcLayout(); @@ -1975,7 +1977,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testMsWordCompTrailingBlanks) CPPUNIT_ASSERT_EQUAL(OUString(), parseDump("/root/page/body/txt[3]/Text[5]", "nWidth")); // The option is false in settings.xml - pDoc = createSwDoc(DATA_DIRECTORY, "MsWordCompTrailingBlanksFalse.odt"); + pDoc = createSwDoc("MsWordCompTrailingBlanksFalse.odt"); CPPUNIT_ASSERT_EQUAL(false, pDoc->getIDocumentSettingAccess().get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS)); calcLayout(); @@ -1991,7 +1993,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testMsWordCompTrailingBlanks) DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS)); // The option should be true if a .docx, .doc or .rtf document is opened - pDoc = createSwDoc(DATA_DIRECTORY, "MsWordCompTrailingBlanks.docx"); + pDoc = createSwDoc("MsWordCompTrailingBlanks.docx"); CPPUNIT_ASSERT_EQUAL(true, pDoc->getIDocumentSettingAccess().get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS)); } @@ -2042,7 +2044,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf58604) #ifdef _WIN32 // Allow linebreak character follows hanging punctuation immediately instead of // breaking at the start of the next line. - createSwDoc(DATA_DIRECTORY, "tdf58604.odt"); + createSwDoc("tdf58604.odt"); CPPUNIT_ASSERT_EQUAL( OUString("PortionType::Break"), parseDump("(/root/page/body/txt/LineBreak[1]/preceding::Text)[last()]", "nType")); @@ -2090,7 +2092,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf72942) CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf114306) { - createSwDoc(DATA_DIRECTORY, "fdo114306.odt"); + createSwDoc("fdo114306.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // There are 2 long paragraphs in cell A1. @@ -2105,7 +2107,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf114306_2) { // tdf#114306 fix unexpected page break in row-spanned table // load regression document without writer crash - createSwDoc(DATA_DIRECTORY, "fdo114306_2.odt"); + createSwDoc("fdo114306_2.odt"); // correct number of pages CPPUNIT_ASSERT_EQUAL(4, getPages()); diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx index 1e93a764cc25..3aaedff5f662 100644 --- a/sw/qa/extras/uiwriter/uiwriter5.cxx +++ b/sw/qa/extras/uiwriter/uiwriter5.cxx @@ -53,15 +53,15 @@ #include #include -namespace -{ -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; -} // namespace - /// Second set of tests asserting the behavior of Writer user interface shells. class SwUiWriterTest5 : public SwModelTestBase { public: + SwUiWriterTest5() + : SwModelTestBase("/sw/qa/extras/uiwriter/data/") + { + } + virtual std::unique_ptr preTest(const char* filename) override { m_aSavedSettings = Application::GetSettings(); @@ -83,7 +83,7 @@ protected: CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf139127) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf139127.fodt"); + SwDoc* pDoc = createSwDoc("tdf139127.fodt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); // switch on "Show changes in margin" mode @@ -175,7 +175,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf138479) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf138666) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39721.fodt"); + SwDoc* pDoc = createSwDoc("tdf39721.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf138666) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf140982) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115815.odt"); + SwDoc* pDoc = createSwDoc("tdf115815.odt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -276,7 +276,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf140982) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf126206) { - createSwDoc(DATA_DIRECTORY, "tdf126206.docx"); + createSwDoc("tdf126206.docx"); // normal text (it was bold) auto xText = getParagraph(1)->getText(); @@ -304,7 +304,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf126206) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf50447) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126206.docx"); + SwDoc* pDoc = createSwDoc("tdf126206.docx"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -348,7 +348,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf50447) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143918) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126206.docx"); + SwDoc* pDoc = createSwDoc("tdf126206.docx"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -393,7 +393,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143918) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143938) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf54819.fodt"); + SwDoc* pDoc = createSwDoc("tdf54819.fodt"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -459,7 +459,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143938) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143939) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf126206.docx"); + SwDoc* pDoc = createSwDoc("tdf126206.docx"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -504,7 +504,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143939) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf50447_keep_hints) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf50447.fodt"); + SwDoc* pDoc = createSwDoc("tdf50447.fodt"); // first paragraph (_Lorem_ /ipsum/) @@ -657,7 +657,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf50447_keep_hints) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf144272) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf50447.fodt"); + SwDoc* pDoc = createSwDoc("tdf50447.fodt"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -891,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testMixedFormFieldInsertion) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf147723) { - SwDoc* const pDoc = createSwDoc(DATA_DIRECTORY, "tdf147723.docx"); + SwDoc* const pDoc = createSwDoc("tdf147723.docx"); IDocumentMarkAccess& rIDMA(*pDoc->getIDocumentMarkAccess()); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), rIDMA.getAllMarksCount()); @@ -912,7 +912,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf147723) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf147006) { - SwDoc* const pDoc = createSwDoc(DATA_DIRECTORY, "tdf147006.rtf"); + SwDoc* const pDoc = createSwDoc("tdf147006.rtf"); IDocumentMarkAccess& rIDMA(*pDoc->getIDocumentMarkAccess()); CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_FRM)); @@ -947,7 +947,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf147006) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDocxAttributeTableExport) { - createSwDoc(DATA_DIRECTORY, "floating-table-position.docx"); + createSwDoc("floating-table-position.docx"); // get the table frame, set new values and dismiss the references { @@ -982,7 +982,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDocxAttributeTableExport) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf118699_redline_numbering) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118699.docx"); + SwDoc* pDoc = createSwDoc("tdf118699.docx"); IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess()); rIDRA.AcceptAllRedline(true); @@ -999,7 +999,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf118699_redline_numbering) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125881_redline_list_level) { - createSwDoc(DATA_DIRECTORY, "tdf125881.docx"); + createSwDoc("tdf125881.docx"); uno::Reference xProps(getParagraph(8), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("deleted paragraph: erroneous numbering", @@ -1016,7 +1016,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125881_redline_list_level) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125916_redline_restart_numbering) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125916.docx"); + SwDoc* pDoc = createSwDoc("tdf125916.docx"); // moveFrom/moveTo are imported as separated redlines from fixing tdf#145718. // Accept the first inline moveFrom redline before accepting the remaining ones @@ -1036,7 +1036,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125916_redline_restart_numbering) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125310) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125310.fodt"); + SwDoc* pDoc = createSwDoc("tdf125310.fodt"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); @@ -1071,7 +1071,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125310) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125310b) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125310b.fodt"); + SwDoc* pDoc = createSwDoc("tdf125310b.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(OUString("Standard"), @@ -1101,7 +1101,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125310b) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf120336) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf120336.docx"); + SwDoc* pDoc = createSwDoc("tdf120336.docx"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -1123,7 +1123,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf120336) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf106843) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf106843.docx"); + SwDoc* pDoc = createSwDoc("tdf106843.docx"); // try to turn off red-lining dispatchCommand(mxComponent, ".uno:TrackChanges", {}); @@ -1136,7 +1136,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf106843) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testImageComment) { // Load a document with an as-char image in it. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "image-comment.odt"); + SwDoc* pDoc = createSwDoc("image-comment.odt"); SwView* pView = pDoc->GetDocShell()->GetView(); // Test document has "beforeafter", remove the content before the image. @@ -1234,7 +1234,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testImageComment) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testImageCommentAtChar) { // Load a document with an at-char image in it. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "image-comment-at-char.odt"); + SwDoc* pDoc = createSwDoc("image-comment-at-char.odt"); SwView* pView = pDoc->GetDocShell()->GetView(); // Select the image. @@ -1303,7 +1303,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testImageCommentAtChar) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTrackImageDeletion) { // load a document with an image anchored to paragraph in it - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "image.odt"); + SwDoc* pDoc = createSwDoc("image.odt"); SwView* pView = pDoc->GetDocShell()->GetView(); // select the image @@ -1347,9 +1347,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTrackImageInsertion) IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); // Insert an image with change tracking - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ole2.png"; uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", aImageURL), + comphelper::makePropertyValue("FileName", createFileURL(u"ole2.png")), }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); @@ -1360,7 +1359,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTrackImageInsertion) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf120338) { - createSwDoc(DATA_DIRECTORY, "tdf120338.docx"); + createSwDoc("tdf120338.docx"); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(getParagraph(2), "ParaAdjust")); // right @@ -1410,7 +1409,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf120338) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf120338_multiple_paragraph_join) { - createSwDoc(DATA_DIRECTORY, "redline-para-join.docx"); + createSwDoc("redline-para-join.docx"); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); @@ -1433,7 +1432,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf120338_multiple_paragraph_join) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testShapePageMove) { // Load a document with 2 pages, shape on the first page. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "shape-page-move.odt"); + SwDoc* pDoc = createSwDoc("shape-page-move.odt"); SwView* pView = pDoc->GetDocShell()->GetView(); // Make sure that the 2nd page is below the 1st one. pView->SetViewLayout(/*nColumns=*/1, /*bBookMode=*/false); @@ -1665,7 +1664,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testOleSaveWhileEdit) comphelper::LibreOfficeKit::setActive(); // Load a document with a Draw doc in it. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "ole-save-while-edit.odt"); + SwDoc* pDoc = createSwDoc("ole-save-while-edit.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoObj(/*bNext=*/true, GotoObjFlags::Any); @@ -1695,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testOleSaveWhileEdit) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf105330) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105330.odt"); + SwDoc* pDoc = createSwDoc("tdf105330.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Down(/*bSelect=*/false); @@ -1717,7 +1716,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf105330) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf118311) { - createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + createSwDoc("tdf118311.fodt"); // Jump to the first cell, selecting its content uno::Sequence aSearch(comphelper::InitPropertySequence({ @@ -1746,7 +1745,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion) // load a 1-row table, and delete the row with enabled change tracking: // now the row is not deleted silently, but keeps the deleted cell contents, // and only accepting all of them will result the deletion of the table row. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -1857,7 +1856,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150976) { // load a 1-row table, and delete the row with track changes - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "select-row.fodt"); + SwDoc* pDoc = createSwDoc("select-row.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -1901,7 +1900,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150976) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf151657) { // load a 1-row table, and delete the row with hidden track changes - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "select-row.fodt"); + SwDoc* pDoc = createSwDoc("select-row.fodt"); // turn on red-lining and hide changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On); @@ -1944,7 +1943,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf151657) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testSelectRowWithNestedTable) { // load a 1-row table, and select the row - createSwDoc(DATA_DIRECTORY, "select-row.fodt"); + createSwDoc("select-row.fodt"); // check table xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -1971,7 +1970,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testSelectRowWithNestedTable) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf47979_row) { // load a 2-row table, and select row 2 by clicking before it - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "select-column.fodt"); + SwDoc* pDoc = createSwDoc("select-column.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2005,7 +2004,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf47979_row) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf47979_column) { // load a 2-row table, and select column B by clicking before them - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "select-column.fodt"); + SwDoc* pDoc = createSwDoc("select-column.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2043,7 +2042,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport) // load a 1-row table, and delete the row with enabled change tracking: // now the row is not deleted silently, but keeps the deleted cell contents, // and only accepting all of them will result the deletion of the table row. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2096,7 +2095,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport) // load a 1-row table, and delete the row with enabled change tracking: // now the row is not deleted silently, but keeps the deleted cell contents, // and only accepting all of them will result the deletion of the table row. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2149,7 +2148,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineDOCXTableInsertion) { // load a 3-row table inserted with change tracking by text to table conversion - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-converttotable.docx"); + SwDoc* pDoc = createSwDoc("TC-table-converttotable.docx"); // check table count (1) uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2173,7 +2172,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineDOCXTableMoveToFrame) { // load a table with tracked drag & drop: Table1 is the moveFrom, // Table2 is the moveTo - and framed - table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-DnD-move.docx"); + SwDoc* pDoc = createSwDoc("TC-table-DnD-move.docx"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), @@ -2201,7 +2200,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineDOCXTableMoveToFrame) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143215) { // load a table with tracked insertion of an empty row - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-rowadd.docx"); + SwDoc* pDoc = createSwDoc("TC-table-rowadd.docx"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTextTablesSupplier->getTextTables(), @@ -2235,7 +2234,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143215) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150666) { // load a table with tracked insertion of an empty row - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-rowadd.docx"); + SwDoc* pDoc = createSwDoc("TC-table-rowadd.docx"); // check table count uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2274,7 +2273,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150666) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150666_regression) { // load a table with tracked insertion of an empty row - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-rowadd.docx"); + SwDoc* pDoc = createSwDoc("TC-table-rowadd.docx"); // check table count uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2304,7 +2303,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf144748) { // load a table with an empty row, and an empty line before the table // (to allow the easy selection of the full text with the table) - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf144748.fodt"); + SwDoc* pDoc = createSwDoc("tdf144748.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2347,7 +2346,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf144748) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf128335) { // Load the bugdoc, which has 3 textboxes. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128335.odt"); + SwDoc* pDoc = createSwDoc("tdf128335.odt"); // Select the 3rd textbox. SwView* pView = pDoc->GetDocShell()->GetView(); @@ -2385,7 +2384,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject) // load a 1-row table, and delete the row with enabled change tracking: // now the row is not deleted silently, but keeps the deleted cell contents, // and only accepting all of them will result the deletion of the table row. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2458,7 +2457,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowInsertionWithReject) { // load a 1-row table, and insert a row with enabled change tracking - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2503,7 +2502,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowInsertionWithReject) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX) { // load a 1-row table, and insert a row with enabled change tracking - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2556,7 +2555,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testPasteTrackedTableRow) { // load a 1-row table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2603,7 +2602,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testPasteTrackedTableRow) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testPasteTrackedTableRowInHideChangesMode) { // load a 1-row table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt"); + SwDoc* pDoc = createSwDoc("tdf118311.fodt"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On); @@ -2650,7 +2649,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf146966) { // load a 4-row table, select more than 1 row and copy them // to check insertion of unnecessary empty rows - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf144748.fodt"); + SwDoc* pDoc = createSwDoc("tdf144748.fodt"); // check table row count uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2685,7 +2684,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf146966) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145091) { // load a deleted table, reject them, and delete only its text and export to DOCX - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf145091.docx"); + SwDoc* pDoc = createSwDoc("tdf145091.docx"); // turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete @@ -2735,7 +2734,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145091) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf128603) { // Load the bugdoc, which has 3 textboxes. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128603.odt"); + SwDoc* pDoc = createSwDoc("tdf128603.odt"); // Select the 3rd textbox. SwView* pView = pDoc->GetDocShell()->GetView(); @@ -2786,7 +2785,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testOfz18563) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143904) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143904.odt"); + SwDoc* pDoc = createSwDoc("tdf143904.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2809,7 +2808,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143904) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf90069) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf90069.docx"); + SwDoc* pDoc = createSwDoc("tdf90069.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2833,7 +2832,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf90069) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf109266) { // transliteration with redlining - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "lorem.fodt"); + SwDoc* pDoc = createSwDoc("lorem.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -2894,7 +2893,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf109266) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf129655) { - createSwDoc(DATA_DIRECTORY, "tdf129655-vtextbox.odt"); + createSwDoc("tdf129655-vtextbox.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//anchored/fly/txt[@WritingMode='Vertical']", 1); } @@ -3224,7 +3223,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145151) CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf126735) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39721.fodt"); + SwDoc* pDoc = createSwDoc("tdf39721.fodt"); //turn on red-lining and show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 77901a2ea17e..c49b5b921749 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -47,8 +47,6 @@ namespace { -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; - sal_Int32 lcl_getAttributeIDFromHints(const SwpHints& hints) { for (size_t i = 0; i < hints.Count(); ++i) @@ -77,6 +75,11 @@ void emulateTyping(SwXTextDocument& rXTextDocument, const std::u16string_view& r class SwUiWriterTest6 : public SwModelTestBase, public HtmlTestTools { +public: + SwUiWriterTest6() + : SwModelTestBase("/sw/qa/extras/uiwriter/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf116640) @@ -118,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf116640) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108524) { - createSwDoc(DATA_DIRECTORY, "tdf108524.odt"); + createSwDoc("tdf108524.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In total we expect two cells containing a section. assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2); @@ -134,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesInSectionInTable) // This is similar to testTdf108524(), but the page boundary now is not in // the middle of a multi-line paragraph: the section only contains oneliner // paragraphs instead. - createSwDoc(DATA_DIRECTORY, "lines-in-section-in-table.odt"); + createSwDoc("lines-in-section-in-table.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In total we expect two cells containing a section. assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2); @@ -149,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesMoveBackwardsInSectionInTable) { #if HAVE_MORE_FONTS // Assert that paragraph "4" is on page 1 and "5" is on page 2. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "lines-in-section-in-table.odt"); + SwDoc* pDoc = createSwDoc("lines-in-section-in-table.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 2); SwNodeOffset nPara4Node( @@ -184,7 +187,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTableInSection) { #if HAVE_MORE_FONTS // The document has a section, containing a table that spans over 2 pages. - createSwDoc(DATA_DIRECTORY, "table-in-sect.odt"); + createSwDoc("table-in-sect.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In total we expect 4 cells. assertXPath(pXmlDoc, "/root/page/body/section/tab/row/cell", 4); @@ -200,7 +203,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTableInNestedSection) #if HAVE_MORE_FONTS // The document has a nested section, containing a table that spans over 2 pages. // This crashed the layout. - createSwDoc(DATA_DIRECTORY, "rhbz739252-3.odt"); + createSwDoc("rhbz739252-3.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure the table is inside a section and spans over 2 pages. assertXPath(pXmlDoc, "//page[1]//section/tab", 1); @@ -211,7 +214,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTableInNestedSection) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112741) { #if HAVE_MORE_FONTS - createSwDoc(DATA_DIRECTORY, "tdf112741.fodt"); + createSwDoc("tdf112741.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 5 pages. assertXPath(pXmlDoc, "//page", 4); @@ -229,14 +232,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112860) // The document has a split section inside a nested table, and also a table // in the footer. // This crashed the layout. - createSwDoc(DATA_DIRECTORY, "tdf112860.fodt"); + createSwDoc("tdf112860.fodt"); #endif } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113287) { #if HAVE_MORE_FONTS - createSwDoc(DATA_DIRECTORY, "tdf113287.fodt"); + createSwDoc("tdf113287.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "//page", 2); sal_uInt32 nCellTop @@ -254,7 +257,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113445) { #if HAVE_MORE_FONTS // Force multiple-page view. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf113445.fodt"); + SwDoc* pDoc = createSwDoc("tdf113445.fodt"); SwDocShell* pDocShell = pDoc->GetDocShell(); SwView* pView = pDocShell->GetView(); pView->SetViewLayout(/*nColumns=*/2, /*bBookMode=*/false); @@ -300,7 +303,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113445) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113686) { #if HAVE_MORE_FONTS - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf113686.fodt"); + SwDoc* pDoc = createSwDoc("tdf113686.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 2); SwNodeOffset nPage1LastNode( @@ -338,7 +341,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTableInSectionInTable) // The document has a table, containing a section, containing a nested // table. // This crashed the layout. - createSwDoc(DATA_DIRECTORY, "i95698.odt"); + createSwDoc("i95698.odt"); #endif } @@ -348,14 +351,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable) // The document has a nested table, containing a multi-line section at a // page boundary. // This crashed the layout later in SwFrame::IsFootnoteAllowed(). - createSwDoc(DATA_DIRECTORY, "tdf112109.fodt"); + createSwDoc("tdf112109.fodt"); #endif } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable2) { #if HAVE_MORE_FONTS - createSwDoc(DATA_DIRECTORY, "split-section-in-nested-table.fodt"); + createSwDoc("split-section-in-nested-table.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_uInt32 nSection1 = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section", "id").toUInt32(); @@ -378,7 +381,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable2) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable3) { #if HAVE_MORE_FONTS - createSwDoc(DATA_DIRECTORY, "tdf113153.fodt"); + createSwDoc("tdf113153.fodt"); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), @@ -413,7 +416,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable3) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable4) { #if HAVE_MORE_FONTS - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf113520.fodt"); + SwDoc* pDoc = createSwDoc("tdf113520.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page", 3); SwNodeOffset nPage1LastNode( @@ -459,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112160) { #if HAVE_MORE_FONTS // Assert that the A2 cell is on page 1. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf112160.fodt"); + SwDoc* pDoc = createSwDoc("tdf112160.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); SwNodeOffset nA2CellNode(getXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/section/txt[last()]", @@ -492,12 +495,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf114536) { // This crashed in SwTextFormatter::MergeCharacterBorder() due to a // use after free. - createSwDoc(DATA_DIRECTORY, "tdf114536.odt"); + createSwDoc("tdf114536.odt"); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testParagraphOfTextRange) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "paragraph-of-text-range.odt"); + SwDoc* pDoc = createSwDoc("paragraph-of-text-range.odt"); // Enter the table. SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -520,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testParagraphOfTextRange) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf99689TableOfContents) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf99689.odt"); + SwDoc* pDoc = createSwDoc("tdf99689.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoNextTOXBase(); const SwTOXBase* pTOXBase = pWrtShell->GetCurTOX(); @@ -547,7 +550,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf99689TableOfContents) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf99689TableOfFigures) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf99689_figures.odt"); + SwDoc* pDoc = createSwDoc("tdf99689_figures.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoNextTOXBase(); const SwTOXBase* pTOXBase = pWrtShell->GetCurTOX(); @@ -572,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf99689TableOfFigures) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf99689TableOfTables) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf99689_tables.odt"); + SwDoc* pDoc = createSwDoc("tdf99689_tables.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoNextTOXBase(); const SwTOXBase* pTOXBase = pWrtShell->GetCurTOX(); @@ -601,7 +604,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf99689TableOfTables) // before usage of the Height() and GetRealHeight(). CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112448) { - createSwDoc(DATA_DIRECTORY, "tdf112448.odt"); + createSwDoc("tdf112448.odt"); // check actual number of line breaks in the paragraph xmlDocUniquePtr pXmlDoc = parseLayoutDump(); @@ -610,7 +613,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112448) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113790) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf113790.docx"); + SwDoc* pDoc = createSwDoc("tdf113790.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Create the clipboard document. SwDoc aClipboard; @@ -653,7 +656,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108048) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113481) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf113481-IVS.odt"); + SwDoc* pDoc = createSwDoc("tdf113481-IVS.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // One backspace should completely remove the CJK ideograph variation sequence @@ -698,9 +701,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf115013) { // Load and register data source - const OUString aDataSourceURI(m_directories.getURLFromSrc(DATA_DIRECTORY) - + "datasource.ods"); - OUString sDataSource = SwDBManager::LoadAndRegisterDataSource(aDataSourceURI, &aWorkDir); + OUString sDataSource + = SwDBManager::LoadAndRegisterDataSource(createFileURL(u"datasource.ods"), &aWorkDir); CPPUNIT_ASSERT(!sDataSource.isEmpty()); // Insert a new field type for the mailmerge field @@ -739,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf115065) // In the document, the tables have table style assigned // Source table (first one) has two rows; // destination (second one) has only one row - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115065.odt"); + SwDoc* pDoc = createSwDoc("tdf115065.odt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -764,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf84806_MovingMultipleTableRows) // Moving of multiple table rows. // Source table (first one) has two rows; // destination (second one) has only one row - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115065.odt"); + SwDoc* pDoc = createSwDoc("tdf115065.odt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -820,7 +822,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf147181_TrackedMovingOfMultipleTable // Tracked moving of multiple table rows. // Source table (first one) has two rows; // destination (second one) has only one row - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf115065.odt"); + SwDoc* pDoc = createSwDoc("tdf115065.odt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -977,7 +979,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testXDrawPagesSupplier) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf116403) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116403-considerborders.odt"); + SwDoc* pDoc = createSwDoc("tdf116403-considerborders.odt"); // Check that before ToX update, the tab stop position is the old one uno::Reference xParagraph = getParagraph(2, "1\t1"); auto aTabs = getProperty>(xParagraph, "ParaTabStops"); @@ -1001,7 +1003,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf116403) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testHtmlCopyImages) { // Load a document with an image. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "image.odt"); + SwDoc* pDoc = createSwDoc("image.odt"); // Trigger the copy part of HTML copy&paste. WriterRef xWrt = new SwHTMLWriter(/*rBaseURL=*/OUString()); @@ -1027,7 +1029,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testHtmlCopyImages) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf116789) { - createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + createSwDoc("tdf116789.fodt"); uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xText1; uno::Reference xText2; @@ -1048,7 +1050,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf116789) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf91801) { // Tests calculation with several user field variables without prior user fields - createSwDoc(DATA_DIRECTORY, "tdf91801.fodt"); + createSwDoc("tdf91801.fodt"); uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); uno::Reference xCell(xTable->getCellByName("A1")); CPPUNIT_ASSERT_EQUAL(555.0, xCell->getValue()); @@ -1072,7 +1074,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf51223) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testFontEmbedding) { #if HAVE_MORE_FONTS && !defined(MACOSX) - createSwDoc(DATA_DIRECTORY, "testFontEmbedding.odt"); + createSwDoc("testFontEmbedding.odt"); OString aContentBaseXpath("/office:document-content/office:font-face-decls"); OString aSettingsBaseXpath("/office:document-settings/office:settings/config:config-item-set"); @@ -1286,7 +1288,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInconsistentBookmark) { // create test document with text and bookmark { - SwDoc* pDoc(createSwDoc(DATA_DIRECTORY, "testInconsistentBookmark.ott")); + SwDoc* pDoc(createSwDoc("testInconsistentBookmark.ott")); IDocumentMarkAccess& rIDMA(*pDoc->getIDocumentMarkAccess()); SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1); SwCursor aPaM(SwPosition(aIdx), nullptr); @@ -1390,7 +1392,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf124603) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testRedlineAutoCorrect) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "redline-autocorrect.fodt"); + SwDoc* pDoc = createSwDoc("redline-autocorrect.fodt"); dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {}); @@ -1461,7 +1463,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testRedlineAutoCorrect) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testRedlineAutoCorrect2) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "redline-autocorrect2.fodt"); + SwDoc* pDoc = createSwDoc("redline-autocorrect2.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1489,7 +1491,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testRedlineAutoCorrect2) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testEmojiAutoCorrect) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "redline-autocorrect3.fodt"); + SwDoc* pDoc = createSwDoc("redline-autocorrect3.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1565,7 +1567,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf54409) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf38394) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf38394.fodt"); + SwDoc* pDoc = createSwDoc("tdf38394.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1592,7 +1594,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf59666) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf133524.fodt"); + SwDoc* pDoc = createSwDoc("tdf133524.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1650,7 +1652,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524_Romanian) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf133524_ro.fodt"); + SwDoc* pDoc = createSwDoc("tdf133524_ro.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1684,7 +1686,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524_Romanian) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf128860) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf128860.fodt"); + SwDoc* pDoc = createSwDoc("tdf128860.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1704,7 +1706,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf128860) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf123786) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf123786.fodt"); + SwDoc* pDoc = createSwDoc("tdf123786.fodt"); // On Windows, it will detect that system input language is en-US (despite "typing" e.g. Cyrillic characters), // and will change Russian into English (US); in the latter language, @@ -1733,7 +1735,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf123786) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133589) { // Hungarian test document with right-to-left paragraph setting - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf133589.fodt"); + SwDoc* pDoc = createSwDoc("tdf133589.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1844,7 +1846,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf130274) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf83260) { - SwDoc* const pDoc(createSwDoc(DATA_DIRECTORY, "tdf83260-1.odt")); + SwDoc* const pDoc(createSwDoc("tdf83260-1.odt")); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); SwXTextDocument& rXTextDocument = getSwXTextDocument(); @@ -1933,7 +1935,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf139922) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143176) { // Hungarian test document with right-to-left paragraph setting - createSwDoc(DATA_DIRECTORY, "tdf143176.fodt"); + createSwDoc("tdf143176.fodt"); // transliterate the document to Old Hungarian (note: it only works // with right-to-left text direction and Default Paragraph Style) @@ -1951,7 +1953,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143176) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInsertLongDateFormat) { // only for Hungarian, yet - createSwDoc(DATA_DIRECTORY, "tdf133524.fodt"); + createSwDoc("tdf133524.fodt"); dispatchCommand(mxComponent, ".uno:InsertDateField", {}); // Make sure that the document starts with a field now, and its expanded string value contains space const uno::Reference xField = getRun(getParagraph(1), 1); @@ -1962,7 +1964,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInsertLongDateFormat) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf129270) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129270.odt"); + SwDoc* pDoc = createSwDoc("tdf129270.odt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -1995,8 +1997,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInsertPdf) // insert the PDF into the document uno::Sequence aArgs(comphelper::InitPropertySequence( - { { "FileName", - uno::Any(m_directories.getURLFromSrc(DATA_DIRECTORY) + "hello-world.pdf") } })); + { { "FileName", uno::Any(createFileURL(u"hello-world.pdf")) } })); dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); // Save and load cycle @@ -2018,7 +2019,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143760WrapContourToOff) { // Actually, this is an ooxmlexport test. It is here because here is a ready environment // to change a shape by dispatchCommand. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143760_ContourToWrapOff.docx"); + SwDoc* pDoc = createSwDoc("tdf143760_ContourToWrapOff.docx"); CPPUNIT_ASSERT(pDoc); CPPUNIT_ASSERT_EQUAL(true, getProperty(getShape(1), "SurroundContour")); @@ -2071,7 +2072,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testHatchFill) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testNestedGroupTextBoxCopyCrash) { - createSwDoc(DATA_DIRECTORY, "tdf149550.docx"); + createSwDoc("tdf149550.docx"); dispatchCommand(mxComponent, ".uno:SelectAll", {}); Scheduler::ProcessEventsToIdle(); @@ -2094,7 +2095,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testNestedGroupTextBoxCopyCrash) CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCrashOnExit) { // Load the bugdoc with a table and a textbox shape inside. - CPPUNIT_ASSERT(createSwDoc(DATA_DIRECTORY, "tdf142715.odt")); + CPPUNIT_ASSERT(createSwDoc("tdf142715.odt")); // Get the textbox selected CPPUNIT_ASSERT_EQUAL(1, getShapes()); diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index e9c79cd2e527..b146176a1dd8 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -99,6 +99,11 @@ int CountFilesInDirectory(const OUString& rURL) class SwUiWriterTest7 : public SwModelTestBase { +public: + SwUiWriterTest7() + : SwModelTestBase(DATA_DIRECTORY) + { + } }; CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testExportToPicture) @@ -475,7 +480,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf69282WithMirror) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf78742) { //testing with service type and any .ods file - OUString path = m_directories.getURLFromSrc(DATA_DIRECTORY) + "calc-data-source.ods"; + OUString path = createFileURL(u"calc-data-source.ods"); SfxMedium aMedium(path, StreamMode::READ | StreamMode::SHARE_DENYWRITE); SfxFilterMatcher aMatcher("com.sun.star.text.TextDocument"); std::shared_ptr pFilter; @@ -492,7 +497,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf78742) //Filter should be returned with proper Name CPPUNIT_ASSERT_EQUAL(OUString("calc8"), pFilter2->GetFilterName()); //testing with service type and any .odt file - OUString path2 = m_directories.getURLFromSrc(DATA_DIRECTORY) + "fdo69893.odt"; + OUString path2 = createFileURL(u"fdo69893.odt"); SfxMedium aMedium3(path2, StreamMode::READ | StreamMode::SHARE_DENYWRITE); SfxFilterMatcher aMatcher3("com.sun.star.text.TextDocument"); std::shared_ptr pFilter3; @@ -1538,7 +1543,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf90808) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf97601) { // Instructions from the bugreport to trigger an infinite loop. - createSwDoc(DATA_DIRECTORY, "tdf97601.odt"); + createSwDoc("tdf97601.odt"); uno::Reference xEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xEmbeddedObjects @@ -1582,7 +1587,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf75137) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf83798) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf83798.odt"); + SwDoc* pDoc = createSwDoc("tdf83798.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->GotoNextTOXBase(); const SwTOXBase* pTOXBase = pWrtShell->GetCurTOX(); @@ -1779,7 +1784,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf88899) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf90362) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf90362.fodt"); + SwDoc* pDoc = createSwDoc("tdf90362.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Ensure correct initial setting std::shared_ptr batch( @@ -2022,7 +2027,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testUndoDelAsChar) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf86639) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf86639.rtf"); + SwDoc* pDoc = createSwDoc("tdf86639.rtf"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwTextFormatColl* pColl = pDoc->FindTextFormatCollByName(u"Heading"); pWrtShell->SetTextFormatColl(pColl); @@ -2034,7 +2039,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf86639) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf90883TableBoxGetCoordinates) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf90883.odt"); + SwDoc* pDoc = createSwDoc("tdf90883.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Down(true); SwSelBoxes aBoxes; @@ -2059,8 +2064,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testEmbeddedDataSource) // Load: should have a component and a data source, too. // Path with "#" must not cause issues - createSwDoc(Concat2View(DATA_DIRECTORY + OUString::Concat(u"hash%23path/")), - "embedded-data-source.odt"); + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + OUString::Concat(u"hash%23path/") + + "embedded-data-source.odt"; + loadURL(aURL, nullptr); CPPUNIT_ASSERT(xDatabaseContext->hasByName("calc-data-source")); // Data source has a table named Sheet1. @@ -2133,7 +2139,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTextTableCellNames) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testShapeAnchorUndo) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "draw-anchor-undo.odt"); + SwDoc* pDoc = createSwDoc("draw-anchor-undo.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(0); @@ -2316,7 +2322,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf94804) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testUnicodeNotationToggle) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "unicodeAltX.odt"); + SwDoc* pDoc = createSwDoc("unicodeAltX.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); OUString sOriginalDocString; OUString sDocString; @@ -2339,7 +2345,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testUnicodeNotationToggle) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf34957) { - createSwDoc(DATA_DIRECTORY, "tdf34957.odt"); + createSwDoc("tdf34957.odt"); // table with "keep with next" always started on a new page if the table was large, // regardless of whether it was already kept with the previous paragraph, // or whether the following paragraph actually fit on the same page (MAB 3.6 - 5.0) @@ -2351,7 +2357,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf34957) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf89954) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf89954.odt"); + SwDoc* pDoc = createSwDoc("tdf89954.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->EndPara(); SwXTextDocument* pXTextDocument = dynamic_cast(mxComponent.get()); @@ -2372,7 +2378,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf89954) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf89720) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf89720.odt"); + SwDoc* pDoc = createSwDoc("tdf89720.odt"); SwView* pView = pDoc->GetDocShell()->GetView(); SwPostItMgr* pPostItMgr = pView->GetPostItMgr(); for (std::unique_ptr const& pItem : *pPostItMgr) @@ -2456,7 +2462,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf138873) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf87922) { // Create an SwDrawTextInfo. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf87922.odt"); + SwDoc* pDoc = createSwDoc("tdf87922.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwScriptInfo* pScriptInfo = nullptr; // Get access to the single paragraph in the document. @@ -2546,7 +2552,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77014) // This test checks that the input field is in one piece and if the // input field has more words, it is broken up at the correct place. - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf77014.odt"); + SwDoc* pDoc = createSwDoc("tdf77014.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwTextFrame* pTextFrame @@ -2686,7 +2692,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77014) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf92648) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf92648.docx"); + SwDoc* pDoc = createSwDoc("tdf92648.docx"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); // Make sure we have ten draw shapes. // Yes, we have if the left/right pages have different header/footer, @@ -2708,7 +2714,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf92648) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf103978_backgroundTextShape) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf103978_backgroundTextShape.docx"); + SwDoc* pDoc = createSwDoc("tdf103978_backgroundTextShape.docx"); // there is only one shape. It has an attached textbox bool bShapeIsOpaque = getProperty(getShape(1), "Opaque"); @@ -2733,7 +2739,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf117225) OUString aTargetDirectory = m_directories.getURLFromWorkdir(u"/CppunitTest/sw_uiwriter7.test.user/"); OUString aTargetFile = aTargetDirectory + "tdf117225.odt"; - OUString aSourceFile = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf117225.odt"; + OUString aSourceFile = createFileURL(u"tdf117225.odt"); osl::File::copy(aSourceFile, aTargetFile); mxComponent = loadFromDesktop(aTargetFile); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); @@ -2753,7 +2759,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf117225) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149184) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "simplefooter.docx"); + SwDoc* pDoc = createSwDoc("simplefooter.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Removing the footer for all styles @@ -2776,7 +2782,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149184) CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149089) { - createSwDoc(DATA_DIRECTORY, "tdf149089.odt"); + createSwDoc("tdf149089.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nPorLen1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]", "length").toInt32(); sal_Int32 nPorLen2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]", "length").toInt32(); diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index a0d40ff5cca6..dbb1d4fda678 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -38,19 +38,19 @@ #include #include -namespace -{ -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/uiwriter/data/"; -} // namespace - /// 8th set of tests asserting the behavior of Writer user interface shells. class SwUiWriterTest8 : public SwModelTestBase { +public: + SwUiWriterTest8() + : SwModelTestBase("/sw/qa/extras/uiwriter/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf131684) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf131684.docx"); + SwDoc* pDoc = createSwDoc("tdf131684.docx"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf131684) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132420) { - createSwDoc(DATA_DIRECTORY, "tdf132420.odt"); + createSwDoc("tdf132420.odt"); CPPUNIT_ASSERT_EQUAL(12, getShapes()); @@ -111,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132420) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132744) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132744.odt"); + SwDoc* pDoc = createSwDoc("tdf132744.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // disable change tracking to cut the table @@ -142,7 +142,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132744) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146622) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx"); + SwDoc* pDoc = createSwDoc("TC-table-del-add.docx"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -196,7 +196,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146622) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146962) { // load a 2-row table, set Hide Changes mode and delete the first row with change tracking - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + SwDoc* pDoc = createSwDoc("tdf116789.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -249,7 +249,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146962) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347) { // load a 2-row table, set Hide Changes mode and delete the table with change tracking - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + SwDoc* pDoc = createSwDoc("tdf116789.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -302,7 +302,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148345) { // load a 2-row table, set Hide Changes mode and delete the first row with change tracking - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + SwDoc* pDoc = createSwDoc("tdf116789.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -358,7 +358,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391) // overwrites the row content, instead of inserting a nested table // load a 2-row table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + SwDoc* pDoc = createSwDoc("tdf116789.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148791) // test Paste as Rows Above with centered table alignment // load a 2-row table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + SwDoc* pDoc = createSwDoc("tdf116789.fodt"); CPPUNIT_ASSERT(pDoc); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -982,7 +982,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf80663) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf130805) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf130805.odt"); + SwDoc* pDoc = createSwDoc("tdf130805.odt"); const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats(); CPPUNIT_ASSERT(rFrmFormats.size() >= size_t(o3tl::make_unsigned(1))); @@ -1005,7 +1005,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf130805) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf107893) { //Open the sample doc - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf107893.odt"); + SwDoc* pDoc = createSwDoc("tdf107893.odt"); //Get the format of the shape const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats(); @@ -1060,7 +1060,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf121031) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, TestTextBoxCrashAfterLineDel) { // Open the desired file - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "txbx_crash.odt"); + SwDoc* pDoc = createSwDoc("txbx_crash.odt"); // Get the format of the shape const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats(); @@ -1084,7 +1084,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, TestTextBoxCrashAfterLineDel) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf121546) { - createSwDoc(DATA_DIRECTORY, "tdf121546.odt"); + createSwDoc("tdf121546.odt"); CPPUNIT_ASSERT_EQUAL(OUString("xxxxxxxxxxxxxxxxxxxx"), getParagraph(2)->getString()); @@ -1131,7 +1131,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf121546) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf145621) { - createSwDoc(DATA_DIRECTORY, "tdf145621.odt"); + createSwDoc("tdf145621.odt"); CPPUNIT_ASSERT_EQUAL(OUString("AAAAAA"), getParagraph(1)->getString()); @@ -1149,7 +1149,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf145621) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf134626) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134626.odt"); + SwDoc* pDoc = createSwDoc("tdf134626.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(OUString("Apple"), getParagraph(1)->getString()); @@ -1315,7 +1315,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf87199) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf39828) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39828.fodt"); + SwDoc* pDoc = createSwDoc("tdf39828.fodt"); // show changes pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::ShowDelete @@ -1346,7 +1346,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf39828) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146573) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39828.fodt"); + SwDoc* pDoc = createSwDoc("tdf39828.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // remove redlines, add a footnote, and change the value @@ -1385,7 +1385,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146573) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148849) { // load a document with a table and an empty paragraph before the table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf148849.fodt"); + SwDoc* pDoc = createSwDoc("tdf148849.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // record changes @@ -1419,7 +1419,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148849) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf150576) { // load a document with a table and an empty paragraph before the table - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf148849.fodt"); + SwDoc* pDoc = createSwDoc("tdf148849.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // record changes @@ -1571,7 +1571,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf117601) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf138130) { - createSwDoc(DATA_DIRECTORY, "tdf138130.docx"); + createSwDoc("tdf138130.docx"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xShape = getShape(1); @@ -1599,7 +1599,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf138130) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136385) { - createSwDoc(DATA_DIRECTORY, "tdf136385.odt"); + createSwDoc("tdf136385.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xShape = getShape(1); @@ -1629,7 +1629,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136385) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf145207) { - createSwDoc(DATA_DIRECTORY, "tdf145207.odt"); + createSwDoc("tdf145207.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -1649,7 +1649,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf145207) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128782) { - createSwDoc(DATA_DIRECTORY, "tdf128782.odt"); + createSwDoc("tdf128782.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -1687,7 +1687,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128782) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf135623) { - createSwDoc(DATA_DIRECTORY, "tdf135623.docx"); + createSwDoc("tdf135623.docx"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT_EQUAL(2, getShapes()); @@ -1730,7 +1730,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf135623) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133490) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf133490.odt"); + SwDoc* pDoc = createSwDoc("tdf133490.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -1821,7 +1821,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133490) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132637_protectTrackChanges) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf132637_protectTrackChanges.doc"); + SwDoc* pDoc = createSwDoc("tdf132637_protectTrackChanges.doc"); // The password should only prevent turning off track changes, not open as read-only CPPUNIT_ASSERT(!pDoc->GetDocShell()->IsReadOnly()); @@ -1829,7 +1829,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132637_protectTrackChanges) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf127652) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf127652.odt"); + SwDoc* pDoc = createSwDoc("tdf127652.odt"); SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // get a page cursor @@ -1869,7 +1869,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf127652) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, AtPageTextBoxCrash) { // Load sample file - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "AtPageTextBoxCrash.odt"); + SwDoc* pDoc = createSwDoc("AtPageTextBoxCrash.odt"); // Get the format of the shape const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats(); @@ -1901,7 +1901,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, AtPageTextBoxCrash) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf135661) { - createSwDoc(DATA_DIRECTORY, "tdf135661.odt"); + createSwDoc("tdf135661.odt"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); uno::Reference xShape(getShape(1), uno::UNO_QUERY); @@ -1928,7 +1928,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133477) { if (getDefaultDeviceBitCount() < 24) return; - createSwDoc(DATA_DIRECTORY, "tdf133477.fodt"); + createSwDoc("tdf133477.fodt"); // Save the shape to a BMP. uno::Reference xGraphicExporter @@ -1957,7 +1957,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133477) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf137964) { - SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf137964.odt"); + SwDoc* pDoc = createSwDoc("tdf137964.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -1984,7 +1984,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf137964) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf143244) { - createSwDoc(DATA_DIRECTORY, "tdf143244.odt"); + createSwDoc("tdf143244.odt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -2086,7 +2086,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf143244) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136715) { - createSwDoc(DATA_DIRECTORY, "tdf136715.odt"); + createSwDoc("tdf136715.odt"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -2176,7 +2176,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136715) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf138897) { - createSwDoc(DATA_DIRECTORY, "tdf100018-1.odt"); + createSwDoc("tdf100018-1.odt"); dispatchCommand(mxComponent, ".uno:SelectAll", {}); dispatchCommand(mxComponent, ".uno:Cut", {}); @@ -2238,7 +2238,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136740) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106) { SwWrtShell* pWrtShell - = createSwDoc(DATA_DIRECTORY, "cross_reference_demo_bmk.odt")->GetDocShell()->GetWrtShell(); + = createSwDoc("cross_reference_demo_bmk.odt")->GetDocShell()->GetWrtShell(); utl::TempFileNamed tempDir(nullptr, true); @@ -2308,7 +2308,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf103612) { - SwDoc* const pGlobalDoc = createSwDoc(DATA_DIRECTORY, "DUMMY.odm"); + SwDoc* const pGlobalDoc = createSwDoc("DUMMY.odm"); CPPUNIT_ASSERT_EQUAL( size_t(1), pGlobalDoc->getIDocumentLinksAdministration().GetLinkManager().GetLinks().size()); @@ -2377,7 +2377,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899) CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462) { - createSwDoc(DATA_DIRECTORY, "tdf151462.odt"); + createSwDoc("tdf151462.odt"); // xmlDocUniquePtr pLayout = parseLayoutDump(); dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {}); Scheduler::ProcessEventsToIdle(); diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index 2c2bd6f6f03d..c643f7a45e14 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -59,8 +59,6 @@ using namespace ::com::sun::star; namespace { -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/unowriter/data/"; - /// Listener implementation for testPasteListener. class PasteListener : public cppu::WeakImplHelper { @@ -108,7 +106,7 @@ class SwUnoWriter : public SwModelTestBase { public: SwUnoWriter() - : SwModelTestBase(DATA_DIRECTORY, "writer8") + : SwModelTestBase("/sw/qa/extras/unowriter/data/", "writer8") { } }; @@ -238,8 +236,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testGraphicDescriptorURL) xFactory->createInstance("com.sun.star.text.TextGraphicObject"), uno::UNO_QUERY); // Set a URL on it. - OUString aGraphicURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "test.jpg"; - xTextGraphic->setPropertyValue("GraphicURL", uno::Any(aGraphicURL)); + xTextGraphic->setPropertyValue("GraphicURL", uno::Any(createFileURL(u"test.jpg"))); xTextGraphic->setPropertyValue("AnchorType", uno::Any(text::TextContentAnchorType_AT_CHARACTER)); @@ -263,8 +260,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testGraphicDescriptorURLBitmap) uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xBitmaps( xFactory->createInstance("com.sun.star.drawing.BitmapTable"), uno::UNO_QUERY); - OUString aGraphicURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "test.jpg"; - xBitmaps->insertByName("test", uno::Any(aGraphicURL)); + xBitmaps->insertByName("test", uno::Any(createFileURL(u"test.jpg"))); // Create a graphic. uno::Reference xTextGraphic( @@ -312,7 +308,7 @@ static bool ensureAutoTextExistsByName(const uno::Reference xAutoTextContainer = text::AutoTextContainer::create(comphelper::getProcessComponentContext()); @@ -380,7 +376,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testXAutoTextGroup) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtStart) { // this contains a section that starts with a table - load(DATA_DIRECTORY, "tdf134250.fodt"); + load("tdf134250.fodt"); uno::Reference const xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -439,7 +435,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtStart) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtEnd) { // this contains a section that ends with a table (plus another section) - load(DATA_DIRECTORY, "tdf134252.fodt"); + load("tdf134252.fodt"); uno::Reference const xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -502,7 +498,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtEnd) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTable) { // this contains a section that ends with a table (plus another section) - load(DATA_DIRECTORY, "tdf134252_onlytable_protected.fodt"); + load("tdf134252_onlytable_protected.fodt"); uno::Reference const xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -561,7 +557,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTable) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTextRangeInTable) { - load(DATA_DIRECTORY, "bookmarkintable.fodt"); + load("bookmarkintable.fodt"); uno::Reference const xBS(mxComponent, uno::UNO_QUERY); uno::Reference const xMarks(xBS->getBookmarks()); @@ -730,7 +726,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testDeleteFlyAtCharAtStart) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSelectionInTableEnum) { - load(mpTestDocumentPath, "selection-in-table-enum.odt"); + load("selection-in-table-enum.odt"); // Select the A1 cell's text. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -764,7 +760,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSelectionInTableEnum) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSelectionInTableEnumEnd) { - load(mpTestDocumentPath, "selection-in-table-enum.odt"); + load("selection-in-table-enum.odt"); // Select from "Before" till the table end. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -803,7 +799,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSelectionInTableEnumEnd) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testRenderablePagePosition) { - load(mpTestDocumentPath, "renderable-page-position.odt"); + load("renderable-page-position.odt"); // Make sure that the document has 2 pages. uno::Reference xRenderable(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(mxComponent.is()); @@ -889,8 +885,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testPasteListener) // Test image paste. SwView& rView = pWrtShell->GetView(); - OUString aGraphicURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "test.jpg"; - rView.InsertGraphic(aGraphicURL, OUString(), /*bAsLink=*/false, + rView.InsertGraphic(createFileURL(u"test.jpg"), OUString(), /*bAsLink=*/false, &GraphicFilter::GetGraphicFilter()); // Test that the pasted image is anchored as-char. @@ -921,7 +916,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testPasteListener) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testImageCommentAtChar) { // Load a document with an at-char image in it (and a comment on the image). - load(mpTestDocumentPath, "image-comment-at-char.odt"); + load("image-comment-at-char.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -997,7 +992,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testChapterNumberingCharStyle) CPPUNIT_TEST_FIXTURE(SwUnoWriter, testViewCursorPageStyle) { // Load a document with 2 pages, but a single paragraph. - load(mpTestDocumentPath, "view-cursor-page-style.fodt"); + load("view-cursor-page-style.fodt"); uno::Reference xModel(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xModel.is()); uno::Reference xController(xModel->getCurrentController(), @@ -1077,7 +1072,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTextConvertToTableLineSpacing) // Load a document which has a table with a single cell. // The cell has both a table style and a paragraph style, with different line spacing // heights. - load(mpTestDocumentPath, "table-line-spacing.docx"); + load("table-line-spacing.docx"); uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index d7b86e0d0d14..c5cdca760473 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -1516,7 +1516,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearFramePams) CPPUNIT_TEST_FIXTURE(Test, testTdf94386) { - load(mpTestDocumentPath, "tdf94386.odt"); + load("tdf94386.odt"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index c103ac125e3f..c2efc6d41c1c 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -190,7 +190,7 @@ DECLARE_WW8EXPORT_TEST(testGutterLeft, "gutter-left.doc") CPPUNIT_TEST_FIXTURE(Test, testGutterTop) { - load(mpTestDocumentPath, "gutter-top.doc"); + load("gutter-top.doc"); reload(mpFilter, "gutter-top.doc"); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xSettings( @@ -863,7 +863,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) }; // Given a document with RTL gutter, when loading it: - load(mpTestDocumentPath, "rtl-gutter.doc"); + load("rtl-gutter.doc"); // Then make sure the section's gutter is still RTL: // Without the accompanying fix in place, this test would have failed as the SPRM was missing. verify(); @@ -1087,7 +1087,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) // Given a document with a clearing break: // When loading that file: - load(mpTestDocumentPath, "clearing-break.doc"); + load("clearing-break.doc"); // Then make sure that the clear property of the break is not ignored: verify(); reload(mpFilter, "clearing-break.doc"); diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 0687138654f1..cdf250e11a68 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -39,7 +39,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionMargins) { - load(mpTestDocumentPath, "floating-table-section-margins.doc"); + load("floating-table-section-margins.doc"); sal_Int32 pageLeft = parseDump("/root/page[2]/infos/bounds", "left").toInt32(); sal_Int32 pageWidth = parseDump("/root/page[2]/infos/bounds", "width").toInt32(); sal_Int32 tableLeft = parseDump("//tab/infos/bounds", "left").toInt32(); @@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionMargins) CPPUNIT_TEST_FIXTURE(Test, testN816593) { - load(mpTestDocumentPath, "n816593.doc"); + load("n816593.doc"); uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); // Make sure that even if we import the two tables as non-floating, we @@ -73,7 +73,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN816593) CPPUNIT_TEST_FIXTURE(Test, testBnc875715) { - load(mpTestDocumentPath, "bnc875715.doc"); + load("bnc875715.doc"); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); // Was incorrectly set as -1270. @@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc875715) CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionColumns) { - load(mpTestDocumentPath, "floating-table-section-columns.doc"); + load("floating-table-section-columns.doc"); OUString tableWidth = parseDump("/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds", "width"); // table width was restricted by a column CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 ); @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionColumns) CPPUNIT_TEST_FIXTURE(Test, testTdf124601) { - load(mpTestDocumentPath, "tdf124601.doc"); + load("tdf124601.doc"); // Without the accompanying fix in place, this test would have failed, as the importer lost the // fLayoutInCell shape property for wrap-though shapes. CPPUNIT_ASSERT(getProperty(getShapeByName(u"Grafik 18"), "IsFollowingTextFlow")); @@ -99,7 +99,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124601) CPPUNIT_TEST_FIXTURE(Test, testImageLazyRead) { - load(mpTestDocumentPath, "image-lazy-read.doc"); + load("image-lazy-read.doc"); auto xGraphic = getProperty>(getShape(1), "Graphic"); Graphic aGraphic(xGraphic); // This failed, import loaded the graphic, it wasn't lazy-read. @@ -108,7 +108,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageLazyRead) CPPUNIT_TEST_FIXTURE(Test, testImageLazyRead0size) { - load(mpTestDocumentPath, "image-lazy-read-0size.doc"); + load("image-lazy-read-0size.doc"); // Load a document with a single bitmap in it: it's declared as a WMF one, but actually a TGA // bitmap. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageLazyRead0size) CPPUNIT_TEST_FIXTURE(Test, testTdf106799) { - load(mpTestDocumentPath, "tdf106799.doc"); + load("tdf106799.doc"); // Ensure that all text portions are calculated before testing. SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -149,7 +149,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106799) CPPUNIT_TEST_FIXTURE(Test, testTdf121734) { - load(mpTestDocumentPath, "tdf121734.doc"); + load("tdf121734.doc"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); @@ -190,7 +190,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121734) CPPUNIT_TEST_FIXTURE(Test, testTdf125281) { - load(mpTestDocumentPath, "tdf125281.doc"); + load("tdf125281.doc"); #if !defined(_WIN32) // Windows fails with actual == 26171 for some reason; also lazy load isn't lazy in Windows // debug builds, reason is not known at the moment. @@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125281) CPPUNIT_TEST_FIXTURE(Test, testTdf122425_1) { - load(mpTestDocumentPath, "tdf122425_1.doc"); + load("tdf122425_1.doc"); // This is for header text in case we use a hack for fixed-height headers // (see SwWW8ImplReader::Read_HdFtTextAsHackedFrame) SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); @@ -263,7 +263,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122425_1) CPPUNIT_TEST_FIXTURE(Test, testTdf110987) { - load(mpTestDocumentPath, "tdf110987"); + load("tdf110987"); // The input document is an empty .doc, but without file name // extension. Check that it was loaded as a normal .doc document, // and not a template. @@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf110987) CPPUNIT_TEST_FIXTURE(Test, testTdf120761_zOrder) { - load(mpTestDocumentPath, "tdf120761_zOrder.dot"); + load("tdf120761_zOrder.dot"); //The blue shape was covering everything (highest zorder = 2) instead of the lowest(0) uno::Reference xShape(getShapeByName(u"Picture 2"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty(xShape, "ZOrder")); @@ -283,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120761_zOrder) CPPUNIT_TEST_FIXTURE(Test, testTdf142003) { - load(mpTestDocumentPath, "changes-in-footnote.doc"); + load("changes-in-footnote.doc"); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx index 07bed0ed9f68..1726eab7e8c8 100644 --- a/sw/qa/filter/html/html.cxx +++ b/sw/qa/filter/html/html.cxx @@ -42,7 +42,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmptyParagraph) // Given a document with 2 paragraphs, the second is empty: setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "empty-paragraph.xhtml"); + load("empty-paragraph.xhtml"); // Then make sure that the resulting document has a 2nd empty paragraph: getParagraph(1, "a"); @@ -57,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspect) // Given a document with an OLE object, width set to 100%, height is not set: setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "relative-keep-aspect.xhtml"); + load("relative-keep-aspect.xhtml"); // Then make sure that the aspect ratio of the image is kept: auto pTextDocument = dynamic_cast(mxComponent.get()); @@ -78,7 +78,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspectImage) // Given a document with an image, width set to 100%, height is not set: setImportFilterOptions("xhtmlns=reqif-xhtml"); setImportFilterName("HTML (StarWriter)"); - load(mpTestDocumentPath, "relative-keep-aspect-image.xhtml"); + load("relative-keep-aspect-image.xhtml"); // Then make sure that the aspect ratio of the image is kept: auto pTextDocument = dynamic_cast(mxComponent.get()); diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index da7d4a21c133..1279478a69f4 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -17,8 +17,6 @@ namespace { -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/filter/ww8/data/"; - /** * Covers sw/source/filter/ww8/ fixes. * @@ -30,13 +28,18 @@ constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/filter/ww8/data/"; */ class Test : public SwModelTestBase { +public: + Test() + : SwModelTestBase("/sw/qa/filter/ww8/data/") + { + } }; CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorderDocImport) { // Given a document with a border distance that is larger than the margin, when loading that // document: - createSwDoc(DATA_DIRECTORY, "negative-page-border.doc"); + createSwDoc("negative-page-border.doc"); // Then make sure we map that to a negative border distance (move border from the edge of body // frame towards the center of the page, not towards the edge of the page): diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 1c64baf4fbff..028d64ec62d8 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -99,6 +99,7 @@ private: OUString maFilterOptions; OUString maImportFilterOptions; OUString maImportFilterName; + const OUString mpTestDocumentPath; protected: css::uno::Reference< css::lang::XComponent > mxComponent; @@ -106,7 +107,6 @@ protected: rtl::Reference xInteractionHandler; xmlBufferPtr mpXmlBuffer; - const OUString mpTestDocumentPath; const char* mpFilter; sal_uInt32 mnStartTime; @@ -317,18 +317,23 @@ protected: void header(); - void load(std::u16string_view pDir, const char* pName, const char* pPassword = nullptr) + void load(const char* pName, const char* pPassword = nullptr) { - return loadURLWithComponent(m_directories.getURLFromSrc(pDir) + OUString::createFromAscii(pName), + return loadURLWithComponent(createFileURL(OUString::createFromAscii(pName)), "com.sun.star.text.TextDocument", pName, pPassword); } - void load_web(std::u16string_view pDir, const char* pName, const char* pPassword = nullptr) + void load_web(const char* pName, const char* pPassword = nullptr) { - return loadURLWithComponent(m_directories.getURLFromSrc(pDir) + OUString::createFromAscii(pName), + return loadURLWithComponent(createFileURL(OUString::createFromAscii(pName)), "com.sun.star.text.WebDocument", pName, pPassword); } + OUString createFileURL(std::u16string_view aFileName) + { + return m_directories.getSrcRootURL() + mpTestDocumentPath + "/" + aFileName; + } + void setTestInteractionHandler(const char* pPassword, std::vector& rFilterOptions); void loadURLWithComponent(OUString const& rURL, OUString const& rComponent, const char* pName, const char* pPassword); @@ -381,16 +386,14 @@ protected: * * Examples: * SwDoc* pDoc = createSwDoc(); - * SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "test.fodt"); + * SwDoc* pDoc = createSwDoc("test.fodt"); */ - SwDoc* createSwDoc( - std::u16string_view rDataDirectory = std::u16string_view(), const char* pName = nullptr); + SwDoc* createSwDoc(const char* pName = nullptr); /** * As createSwDoc except a Web Document in Browse Mode */ - SwDoc* createSwWebDoc( - std::u16string_view rDataDirectory = std::u16string_view(), const char* pName = nullptr); + SwDoc* createSwWebDoc(const char* pName = nullptr); /** * Gets SwXTextDocument from loaded component diff --git a/sw/qa/uibase/frmdlg/frmdlg.cxx b/sw/qa/uibase/frmdlg/frmdlg.cxx index 790902ce3233..b16728cf2ecc 100644 --- a/sw/qa/uibase/frmdlg/frmdlg.cxx +++ b/sw/qa/uibase/frmdlg/frmdlg.cxx @@ -13,17 +13,20 @@ #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/uibase/frmdlg/data/"; - /// Covers sw/source/uibase/frmdlg/ fixes. class SwUibaseFrmdlgTest : public SwModelTestBase { +public: + SwUibaseFrmdlgTest() + : SwModelTestBase("/sw/qa/uibase/frmdlg/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUibaseFrmdlgTest, testWrappedMathObject) { // The document includes a Math object with explicit wrapping. - load(DATA_DIRECTORY, "wrapped-math-object.docx"); + load("wrapped-math-object.docx"); uno::Reference xMath = getShape(1); // Without the accompanying fix in place, this test would have failed with: @@ -43,9 +46,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseFrmdlgTest, testAnchorTypeFromStyle) xGraphics->setPropertyValue("AnchorType", uno::Any(text::TextContentAnchorType_AS_CHARACTER)); // When inserting an image: - OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "image.png"; uno::Sequence aArgs = { - comphelper::makePropertyValue("FileName", aImageURL), + comphelper::makePropertyValue("FileName", createFileURL(u"image.png")), }; dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs); diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx index 9efe5cef360d..2f91ba4f8b38 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -35,11 +35,14 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/uibase/shells/data/"; - /// Covers sw/source/uibase/shells/ fixes. class SwUibaseShellsTest : public SwModelTestBase { +public: + SwUibaseShellsTest() + : SwModelTestBase("/sw/qa/uibase/shells/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testTdf130179) @@ -116,7 +119,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOleSavePreviewUpdate) { // Load a document with 2 charts in it. The second is down enough that you have to scroll to // trigger its rendering. Previews are missing for both. - load(DATA_DIRECTORY, "ole-save-preview-update.odt"); + load("ole-save-preview-update.odt"); // Explicitly update OLE previews, etc. dispatchCommand(mxComponent, ".uno:UpdateAll", {}); @@ -137,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOleSavePreviewUpdate) CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOlePreviewUpdate) { // Given a document with an embedded Writer object: - load(DATA_DIRECTORY, "ole-preview-update.odt"); + load("ole-preview-update.odt"); // When updating "all" (including OLE previews): dispatchCommand(mxComponent, ".uno:UpdateAll", {}); diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index 9ab34e995812..35d4d60d7974 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -29,11 +29,14 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/uibase/uiview/data/"; - /// Covers sw/source/uibase/uiview/ fixes. class SwUibaseUiviewTest : public SwModelTestBase { +public: + SwUibaseUiviewTest() + : SwModelTestBase("/sw/qa/uibase/uiview/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) @@ -42,10 +45,9 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) utl::TempFileNamed tmp; tmp.EnableKillingFile(); OUString sTempCopy = tmp.GetURL(); - CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, - osl::File::copy(m_directories.getURLFromSrc(DATA_DIRECTORY) - + "updateall-objectreplacements.odt", - sTempCopy)); + CPPUNIT_ASSERT_EQUAL( + osl::FileBase::E_None, + osl::File::copy(createFileURL(u"updateall-objectreplacements.odt"), sTempCopy)); /* BASIC code that exhibits the problem: @@ -94,8 +96,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateReplacementNosetting) { // Load a copy of the document in hidden mode. - OUString aSourceURL - = m_directories.getURLFromSrc(DATA_DIRECTORY) + "update-replacement-nosetting.odt"; + OUString aSourceURL = createFileURL(u"update-replacement-nosetting.odt"); CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, osl::File::copy(aSourceURL, maTempFile.GetURL())); mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument", { comphelper::makePropertyValue("Hidden", true) }); @@ -118,7 +119,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateReplacementNosetting) CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testKeepRatio) { // Given a document with a custom KeepRatio: - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "keep-ratio.fodt"; + OUString aURL = createFileURL(u"keep-ratio.fodt"); // When loading that document: mxComponent = loadFromDesktop(aURL); diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx index c79e1d1f79c4..0535bb27c8f4 100644 --- a/sw/qa/uibase/uno/uno.cxx +++ b/sw/qa/uibase/uno/uno.cxx @@ -21,11 +21,14 @@ #include #include -constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/uibase/uno/data/"; - /// Covers sw/source/uibase/uno/ fixes. class SwUibaseUnoTest : public SwModelTestBase { +public: + SwUibaseUnoTest() + : SwModelTestBase("/sw/qa/uibase/uno/data/") + { + } }; CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testLockControllers) @@ -45,7 +48,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testLockControllers) CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testCondFieldCachedValue) { - load(DATA_DIRECTORY, "cond-field-cached-value.docx"); + load("cond-field-cached-value.docx"); Scheduler::ProcessEventsToIdle(); // Without the accompanying fix in place, this test would have failed with: diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 65048ffbac20..b1ece8ac05fc 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -55,8 +55,8 @@ void SwModelTestBase::paste(std::u16string_view aFilename, } SwModelTestBase::SwModelTestBase(const OUString& pTestDocumentPath, const char* pFilter) - : mpXmlBuffer(nullptr) - , mpTestDocumentPath(pTestDocumentPath) + : mpTestDocumentPath(pTestDocumentPath) + , mpXmlBuffer(nullptr) , mpFilter(pFilter) , mnStartTime(0) , mbExported(false) @@ -96,7 +96,7 @@ void SwModelTestBase::executeImportTest(const char* filename, const char* pPassw maTempFile.EnableKillingFile(false); header(); std::unique_ptr const pChanges(preTest(filename)); - load(mpTestDocumentPath, filename, pPassword); + load(filename, pPassword); verify(); finish(); maTempFile.EnableKillingFile(); @@ -108,7 +108,7 @@ void SwModelTestBase::executeLoadVerifyReloadVerify(const char* filename, const maTempFile.EnableKillingFile(false); header(); std::unique_ptr const pChanges(preTest(filename)); - load(mpTestDocumentPath, filename, pPassword); + load(filename, pPassword); if (mustTestImportOf(filename)) { verify(); @@ -125,7 +125,7 @@ void SwModelTestBase::executeLoadReloadVerify(const char* filename, const char* maTempFile.EnableKillingFile(false); header(); std::unique_ptr const pChanges(preTest(filename)); - load(mpTestDocumentPath, filename, pPassword); + load(filename, pPassword); postLoad(filename); reload(mpFilter, filename, pPassword); verify(); @@ -138,7 +138,7 @@ void SwModelTestBase::executeImportExport(const char* filename, const char* pPas maTempFile.EnableKillingFile(false); header(); std::unique_ptr const pChanges(preTest(filename)); - load(mpTestDocumentPath, filename, pPassword); + load(filename, pPassword); save(OUString::createFromAscii(mpFilter)); maTempFile.EnableKillingFile(false); verify(); @@ -643,14 +643,14 @@ void SwModelTestBase::save(const OUString& aFilterName) void SwModelTestBase::loadAndSave(const char* pName) { - load(mpTestDocumentPath, pName); + load(pName); save(OUString::createFromAscii(mpFilter)); mbExported = true; } void SwModelTestBase::loadAndReload(const char* pName) { - load(mpTestDocumentPath, pName); + load(pName); reload(mpFilter, pName); } @@ -715,22 +715,22 @@ void SwModelTestBase::registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) BAD_CAST("http://www.w3.org/1999/xhtml")); } -SwDoc* SwModelTestBase::createSwDoc(std::u16string_view rDataDirectory, const char* pName) +SwDoc* SwModelTestBase::createSwDoc(const char* pName) { - if (rDataDirectory.empty() || !pName) + if (!pName) loadURL("private:factory/swriter", nullptr); else - load(rDataDirectory, pName); + load(pName); return getSwDoc(); } -SwDoc* SwModelTestBase::createSwWebDoc(std::u16string_view rDataDirectory, const char* pName) +SwDoc* SwModelTestBase::createSwWebDoc(const char* pName) { - if (rDataDirectory.empty() || !pName) + if (!pName) loadURL("private:factory/swriter/web", nullptr); else - load_web(rDataDirectory, pName); + load_web(pName); return getSwDoc(); } -- cgit v1.2.3