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.co.uk>2018-05-24 17:30:47 +0200
commite87cc12eaf53efa9b221eae7167ea15bc7896752 (patch)
tree3e08a8d37f343dc136f0f539c1ab371eb4ae79a8 /sw/source/core/layout/paintfrm.cxx
parent47d53d6929d449b0b53dc73eddf29fe9c18fb49e (diff)
tdf#106390 Intersect the table borders with upper frames.
Also removes dead code because SwTabFramePainter::Insert() is always called with a cell frame and IsTabFrame() always returns false. Change-Id: I2505d876d20e44ded1faf760bc3b7b1d34b0fd8d Reviewed-on: https://gerrit.libreoffice.org/54684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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 1d1cf069385c..cd76c222b040 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2729,10 +2729,16 @@ void SwTabFramePainter::Insert( const SwFrame& rFrame, const SvxBoxItem& rBoxIte
{
// build 4 line entries for the 4 borders:
SwRect aBorderRect = rFrame.getFrameArea();
- if ( rFrame.IsTabFrame() )
- {
- aBorderRect = rFrame.getFramePrintArea();
- aBorderRect.Pos() += rFrame.getFrameArea().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->getFrameArea());
+ if (!pUpper->IsInTab())
+ break;
+ pUpper = pUpper->GetUpper();
}
bool const bBottomAsTop(lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines(