sw/source/core/layout/paintfrm.cxx |   36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

New commits:
commit fe2a1f6bcb72b17d050355377b68e986f17cf1ff
Author: Michael Stahl <mst...@redhat.com>
Date:   Tue Apr 17 22:30:25 2012 +0200

    fdo#38635: sw: fix border corner gaps:
    
    The start and end points of the vertical and adjacent horizontal borders
    were apart by 1.5 to 3 twips, leading to small visible gaps in the corners.
    This is fixed by using lcl_AlignWidth/lcl_AlignHeight on the border widths,
    and by always computing the start/end positions from the outer edge,
    which makes the horizontal and vertical start/end points match.
    (regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)
    (cherry picked from commit b08e9f3023e9ea1ca0926334becac939ca8fdfac)
    
    Signed-off-by: Miklos Vajna <vmik...@suse.cz>

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 0a451b8..69e32ff 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4483,8 +4483,13 @@ void lcl_PaintLeftRightLine( const sal_Bool         
_bLeft,
             nExtentOE = lcl_GetExtent( pBottomBorder, NULL );
         }
 
-        basegfx::B2DPoint aStart( aRect.Left() + aRect.Width() / 2.0, 
aRect.Top() + lcl_GetLineWidth( pTopBorder ) / 2.0 );
-        basegfx::B2DPoint aEnd( aRect.Left() + aRect.Width() / 2.0, 
aRect.Bottom() - lcl_GetLineWidth( pBottomBorder ) / 2.0 );
+        double const fStartX( (_bLeft) // fdo#38635: always from outer edge
+                ? aRect.Left()  + (aRect.Width() / 2.0)
+                : aRect.Right() - (aRect.Width() / 2.0));
+        basegfx::B2DPoint const aStart(fStartX,
+            aRect.Top() + lcl_AlignHeight(lcl_GetLineWidth(pTopBorder))/2.0 );
+        basegfx::B2DPoint const aEnd(fStartX,
+            aRect.Bottom() - 
lcl_AlignHeight(lcl_GetLineWidth(pBottomBorder))/2.0 );
 
         double nLeftWidth = !_bLeft ? pLeftRightBorder->GetOutWidth() : 
pLeftRightBorder->GetInWidth( );
         double nRightWidth = !_bLeft ? pLeftRightBorder->GetInWidth() : 
pLeftRightBorder->GetOutWidth( );
@@ -4558,8 +4563,15 @@ void lcl_PaintTopBottomLine( const sal_Bool         
_bTop,
             nExtentOE = lcl_GetExtent( NULL, pRightBorder );
         }
 
-        basegfx::B2DPoint aStart( aRect.Left() + lcl_GetLineWidth( pLeftBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
-        basegfx::B2DPoint aEnd( aRect.Right() - lcl_GetLineWidth( pRightBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
+        double const fStartY( (_bTop) // fdo#38635: always from outer edge
+                ? aRect.Top()    + (aRect.Height() / 2.0)
+                : aRect.Bottom() - (aRect.Height() / 2.0));
+        basegfx::B2DPoint const aStart(
+            aRect.Left() + lcl_AlignWidth(lcl_GetLineWidth(pLeftBorder))/2.0,
+            fStartY );
+        basegfx::B2DPoint const aEnd(
+            aRect.Right() - lcl_AlignWidth(lcl_GetLineWidth(pRightBorder))/2.0,
+            fStartY );
 
         double nLeftWidth = !_bTop ? pTopBottomBorder->GetOutWidth() : 
pTopBottomBorder->GetInWidth( );
         double nRightWidth = !_bTop ? pTopBottomBorder->GetInWidth() : 
pTopBottomBorder->GetOutWidth( );
commit d53367946360483ffbc1bcd5babcfcef795507ce
Author: Michael Stahl <mst...@redhat.com>
Date:   Sun Apr 15 15:28:50 2012 +0200

    sw: create horizontal border lines with start left and end right
    
    (cherry picked from commit 1d5e263a129c56e561ce145bad9749027c583a75)
    
    Signed-off-by: Miklos Vajna <vmik...@suse.cz>

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 659606f..0a451b8 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4545,21 +4545,21 @@ void lcl_PaintTopBottomLine( const sal_Bool         
_bTop,
 
     if ( lcl_GetLineWidth( pTopBottomBorder ) > 0 )
     {
-        double nExtentIS = lcl_GetExtent( pRightBorder, NULL );
-        double nExtentIE = lcl_GetExtent( pLeftBorder, NULL );
-        double nExtentOS = lcl_GetExtent( NULL, pRightBorder );
-        double nExtentOE = lcl_GetExtent( NULL, pLeftBorder );
+        double nExtentIS = lcl_GetExtent( NULL, pLeftBorder );
+        double nExtentIE = lcl_GetExtent( NULL, pRightBorder );
+        double nExtentOS = lcl_GetExtent( pLeftBorder, NULL );
+        double nExtentOE = lcl_GetExtent( pRightBorder, NULL );
 
         if ( !_bTop )
         {
-            nExtentIS = lcl_GetExtent( NULL, pRightBorder );
-            nExtentIE = lcl_GetExtent( NULL, pLeftBorder );
-            nExtentOS = lcl_GetExtent( pRightBorder, NULL );
-            nExtentOE = lcl_GetExtent( pLeftBorder, NULL );
+            nExtentIS = lcl_GetExtent( pLeftBorder, NULL );
+            nExtentIE = lcl_GetExtent( pRightBorder, NULL );
+            nExtentOS = lcl_GetExtent( NULL, pLeftBorder );
+            nExtentOE = lcl_GetExtent( NULL, pRightBorder );
         }
 
-        basegfx::B2DPoint aStart( aRect.Right() - lcl_GetLineWidth( 
pRightBorder ) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
-        basegfx::B2DPoint aEnd( aRect.Left() + lcl_GetLineWidth( pLeftBorder ) 
/ 2.0, aRect.Top() + aRect.Height() / 2.0 );
+        basegfx::B2DPoint aStart( aRect.Left() + lcl_GetLineWidth( pLeftBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
+        basegfx::B2DPoint aEnd( aRect.Right() - lcl_GetLineWidth( pRightBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
 
         double nLeftWidth = !_bTop ? pTopBottomBorder->GetOutWidth() : 
pTopBottomBorder->GetInWidth( );
         double nRightWidth = !_bTop ? pTopBottomBorder->GetInWidth() : 
pTopBottomBorder->GetOutWidth( );
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to