diff options
author | Mark Hung <marklh9@gmail.com> | 2018-05-23 11:25:05 +0800 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-06-07 17:58:30 +0200 |
commit | 50eafa86655e0e9fe5860d68c6a75b2a363b3bad (patch) | |
tree | 8a81eefccd053ca23fd450df9a847bf4e90236e7 /sw/source/core/layout/paintfrm.cxx | |
parent | e87f6c248a939c27d7023e752a16c3c278aa922b (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.
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
(cherry picked from commit 948283caae76fa5c42216d10519c86bcbffb6d1d)
Change-Id: I2505d876d20e44ded1faf760bc3b7b1d34b0fd8d
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 14 |
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( |