diff options
Diffstat (limited to 'sw/qa/core/layout/layout.cxx')
-rw-r--r-- | sw/qa/core/layout/layout.cxx | 58 |
1 files changed, 29 insertions, 29 deletions
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 <IDocumentLayoutAccess.hxx> #include <rootfrm.hxx> -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<sal_Int32>(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<SwXTextDocument*>(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); std::shared_ptr<GDIMetaFile> 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<SwXTextDocument*>(mxComponent.get()); SwDocShell* pShell = pTextDoc->GetDocShell(); std::shared_ptr<GDIMetaFile> 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<SwXTextDocument*>(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<SwXTextDocument*>(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<SwXTextDocument*>(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<SwXTextDocument*>(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<SwXTextDocument*>(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<SwXTextDocument*>(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: |