summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/paintfrm.cxx
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-05-23 11:25:05 +0800
committerMiklos Vajna <vmiklos@collabora.com>2018-11-15 15:43:26 +0100
commit948283caae76fa5c42216d10519c86bcbffb6d1d (patch)
tree5049cf3f5459d919a85d85ef1fc7c4a5ccd3edd8 /sw/source/core/layout/paintfrm.cxx
parent5109f63c66dc8b91e7ff4ac62ebec59ece5eb3a9 (diff)
tdf#106390 Intersect the table borders with upper frames.distro/escriba/escriba-5.2.1
Also removes dead code because SwTabFramePainter::Insert() is always called with a cell frame and IsTabFrame() always returns false. Reviewed-on: https://gerrit.libreoffice.org/54684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit e87cc12eaf53efa9b221eae7167ea15bc7896752) Conflicts: sw/qa/extras/layout/layout.cxx sw/source/core/layout/paintfrm.cxx Change-Id: I2505d876d20e44ded1faf760bc3b7b1d34b0fd8d
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r--sw/source/core/layout/paintfrm.cxx14
1 files changed, 10 insertions, 4 deletions
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(