fdo#39415: sw: fix collapsing border painting:
In a table with collapsing borders, the horizontal borders need to be
painted "below" the reference line, and not "centered" on the line like
the vertical borders.
a0486f02433703744f487e599422714d03937956 was apparently an attempt to
fix this, but unfortunately it adjusted both top and bottom borders
with the top border width, which has horrible results if the top and
bottom borders have different widths.
Change-Id: I7605eda6ef8111612ceb1ded79c0811de9ca7b25
(cherry picked from commit aa8240e80394887a4af45710de69aacacec66d25)
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 2351e02..d851cf0 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2708,6 +2708,7 @@ void SwTabFrmPainter::Insert( const SwFrm& rFrm, const SvxBoxItem& rBoxItem )
svx::frame::Style aB( rBoxItem.GetBottom() );
const SwTwips nHalfTopWidth = aT.GetWidth() / 2;
const SwTwips nHalfBottomWidth = aB.GetWidth() / 2;
aR.MirrorSelf();
aB.MirrorSelf();
@@ -2720,10 +2721,14 @@ void SwTabFrmPainter::Insert( const SwFrm& rFrm, const SvxBoxItem& rBoxItem )
aT.SetRefMode( !bVert ? svx::frame::REFMODE_BEGIN : svx::frame::REFMODE_END );
aB.SetRefMode( !bVert ? svx::frame::REFMODE_BEGIN : svx::frame::REFMODE_END );
SwLineEntry aLeft ( nLeft, nTop + nHalfTopWidth, nBottom + nHalfTopWidth, bVert ? aB : ( bR2L ? aR : aL ) );
SwLineEntry aRight ( nRight, nTop + nHalfTopWidth, nBottom + nHalfTopWidth, bVert ? aT : ( bR2L ? aL : aR ) );
SwLineEntry aTop ( nTop + nHalfTopWidth, nLeft, nRight, bVert ? aL : aT );
SwLineEntry aBottom( nBottom + nHalfTopWidth, nLeft, nRight, bVert ? aR : aB );
SwLineEntry aLeft ( nLeft, nTop + nHalfTopWidth,
nBottom + nHalfBottomWidth, bVert ? aB : ( bR2L ? aR : aL ) );
SwLineEntry aRight ( nRight, nTop + nHalfTopWidth,
nBottom + nHalfBottomWidth, bVert ? aT : ( bR2L ? aL : aR ) );
SwLineEntry aTop ( nTop + nHalfTopWidth,
nLeft, nRight, bVert ? aL : aT );
SwLineEntry aBottom( nBottom + nHalfBottomWidth,
nLeft, nRight, bVert ? aR : aB );
Insert( aLeft, false );
Insert( aRight, false );