summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/layout/data/tdf106390.odtbin0 -> 13081 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx20
-rw-r--r--sw/source/core/layout/paintfrm.cxx14
3 files changed, 30 insertions, 4 deletions
diff --git a/sw/qa/extras/layout/data/tdf106390.odt b/sw/qa/extras/layout/data/tdf106390.odt
new file mode 100755
index 000000000000..b2adf5332e34
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf106390.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 84d1e55e5a22..2baa48dea3aa 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -19,9 +19,11 @@ class SwLayoutWriter : public SwModelTestBase
{
public:
void testUserFieldTypeLanguage();
+ void testTdf106390();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testUserFieldTypeLanguage);
+ CPPUNIT_TEST(testTdf106390);
CPPUNIT_TEST_SUITE_END();
private:
@@ -57,6 +59,24 @@ void SwLayoutWriter::testUserFieldTypeLanguage()
assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='POR_FLD']", "rText", "1,234.56");
}
+void SwLayoutWriter::testTdf106390()
+{
+ SwDoc* pDoc = createDoc("tdf106390.odt");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocPtr pXmlDoc = dumper.dumpAndParse(*xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion", "bottom").toInt32();
+
+ // No end point of line segments shall go below the bottom of the clipping area.
+ const OString sXPath = "//polyline/point[@y>" + OString::number(nBottom) + "]";
+
+ assertXPath(pXmlDoc, sXPath, 0);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b973507a21ea..3145da01039a 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2960,10 +2960,16 @@ void SwTabFramePainter::Insert( const SwFrame& rFrame, const SvxBoxItem& rBoxIte
{
// build 4 line entries for the 4 borders:
SwRect aBorderRect = rFrame.Frame();
- if ( rFrame.IsTabFrame() )
- {
- aBorderRect = rFrame.Prt();
- aBorderRect.Pos() += rFrame.Frame().Pos();
+ // Frame area of a table might be larger than the containing frame
+ // so we have to intersect the border rect with upper frames til
+ // the first frame that is not part of a table.
+ const SwLayoutFrame *pUpper = rFrame.GetUpper();
+ while(pUpper)
+ {
+ aBorderRect.Intersection(pUpper->Frame());
+ if (!pUpper->IsInTab())
+ break;
+ pUpper = pUpper->GetUpper();
}
bool const bBottomAsTop(lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines(