summaryrefslogtreecommitdiffstats
path: root/sw/qa/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/core')
-rw-r--r--sw/qa/core/layout/data/para-border-in-cell-clip.docxbin0 -> 12524 bytes
-rw-r--r--sw/qa/core/layout/layout.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/core/layout/data/para-border-in-cell-clip.docx b/sw/qa/core/layout/data/para-border-in-cell-clip.docx
new file mode 100644
index 000000000000..7c516853648c
--- /dev/null
+++ b/sw/qa/core/layout/data/para-border-in-cell-clip.docx
Binary files differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 1a83a17332c7..d982cae6fb01 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -356,6 +356,26 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMirrorMargin)
CPPUNIT_ASSERT_EQUAL(nGutterTwips, nOldRight - nNewRight);
}
+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");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // When rendering those borders:
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+
+ // Then make sure that we have clipping setup for both paragraphs inside the table cell:
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 2
+ // - Actual : 0
+ // - XPath '//clipregion/polygon' number of nodes is incorrect
+ // i.e. there was no clipping applied, leading to unexpected left/right borders.
+ assertXPath(pXmlDoc, "//clipregion/polygon", 2);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */