[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Mar 12 03:47:33 PDT 2014


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

New commits:
commit 95a6f31773e0ae03630ac301d0415361496243a4
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Mar 11 10:36:15 2014 -0400

    fdo#76030: Use the table boundaries view option to toggle border drawing.
    
    Unless I'm missing something, fixing the problem reported in fdo#75118 this
    way is more reliable, and certainly avoids the problem reported in fdo#76030.
    
    Change-Id: Ife524d9db12e9fa4528c2232e619bfacde367659
    (cherry picked from commit 2b9e7a0cb2492f19745f61a4829ff3802b25291f)
    Reviewed-on: https://gerrit.libreoffice.org/8533
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index f10d7b4..5557547 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2658,12 +2658,6 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const
             aPaintStart.Y() -= nTwipYCorr;
             aPaintEnd.Y()   -= nTwipYCorr;
 
-            if (::rtl::math::approxEqual(aStyles[0].Prim(), 0.0) &&
-                ::rtl::math::approxEqual(aStyles[0].Secn(), 0.0))
-            {
-                continue; // fdo#75118 do not paint zero-width lines
-            }
-
             // Here comes the painting stuff: Thank you, DR, great job!!!
             if (bHori)
             {
@@ -4309,7 +4303,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
 
 void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
 {
-    if ( pGlobalShell->GetViewOptions()->IsTable() )
+    const SwViewOption* pViewOption = pGlobalShell->GetViewOptions();
+    if (pViewOption->IsTable())
     {
         // #i29550#
         if ( IsCollapsingBorders() )
@@ -4325,9 +4320,12 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
                 PaintShadow( rRect, aRect, rAttrs );
             }
 
-            // paint lines
-            SwTabFrmPainter aHelper( *this );
-            aHelper.PaintLines( *pGlobalShell->GetOut(), rRect );
+            if (pViewOption->IsTableBoundaries())
+            {
+                // fdo#75118 Paint border lines only when it's enabled.
+                SwTabFrmPainter aHelper(*this);
+                aHelper.PaintLines(*pGlobalShell->GetOut(), rRect);
+            }
         }
         // <-- collapsing
 
@@ -4341,8 +4339,7 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
         aTabRect.Pos() += Frm().Pos();
         SwRect aTabOutRect( rRect );
         aTabOutRect.Intersection( aTabRect );
-        pGlobalShell->GetViewOptions()->
-                DrawRect( pGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY );
+        pViewOption->DrawRect( pGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY );
     }
     ((SwTabFrm*)this)->ResetComplete();
 }


More information about the Libreoffice-commits mailing list