[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - sw/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Mar 18 11:30:18 PDT 2014


 sw/source/core/layout/paintfrm.cxx |   42 +++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 15 deletions(-)

New commits:
commit 829b4cfd4dbb461f81f695b23b85da4cb0b7693a
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Mar 17 19:41:07 2014 -0400

    fdo#76195: Set the border type to NONE to ensure it won't be drawn.
    
    We can no longer rely on the width being zero for no border condition.
    
    Change-Id: I02c5c825661b4a0aa4190306e8276bdfd8bff944
    (cherry picked from commit d2eb2c5a02718b83475bc718e117eb6255cbac98)
    Reviewed-on: https://gerrit.libreoffice.org/8636
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index f155ee1..7af9380 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -107,13 +107,6 @@ using ::drawinglayer::primitive2d::BorderLinePrimitive2D;
 using ::std::pair;
 using ::std::make_pair;
 
-//subsidiary lines enabled?
-#define IS_SUBS_TABLE \
-    (pGlobalShell->GetViewOptions()->IsTable() && \
-    !pGlobalShell->GetViewOptions()->IsPagePreview()&&\
-    !pGlobalShell->GetViewOptions()->IsReadonly()&&\
-    !pGlobalShell->GetViewOptions()->IsFormView() &&\
-     SwViewOption::IsTableBoundaries())
 //other subsidiary lines enabled?
 #define IS_SUBS (!pGlobalShell->GetViewOptions()->IsPagePreview() && \
         !pGlobalShell->GetViewOptions()->IsReadonly() && \
@@ -259,6 +252,27 @@ static sal_Bool bTableHack = sal_False;
 //To optimize the expensive RetouchColor determination
 Color aGlobalRetoucheColor;
 
+namespace {
+
+bool isTableBoundariesEnabled()
+{
+    if (!pGlobalShell->GetViewOptions()->IsTable())
+        return false;
+
+    if (pGlobalShell->GetViewOptions()->IsPagePreview())
+        return false;
+
+    if (pGlobalShell->GetViewOptions()->IsReadonly())
+        return false;
+
+    if (pGlobalShell->GetViewOptions()->IsFormView())
+        return false;
+
+    return SwViewOption::IsTableBoundaries();
+}
+
+}
+
 // Set borders alignment statics.
 // adjustment for 'small' twip-to-pixel relations:
 // For 'small' twip-to-pixel relations (less then 2:1)
@@ -2491,8 +2505,10 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const
             const Color* pTmpColor = 0;
             if (0 == aStyles[ 0 ].GetWidth())
             {
-                if (IS_SUBS_TABLE && pGlobalShell->GetWin())
+                if (isTableBoundariesEnabled() && pGlobalShell->GetWin())
                     aStyles[ 0 ].Set( rCol, rCol, rCol, false, 1, 0, 0 );
+                else
+                    aStyles[0].SetType(table::BorderLineStyle::NONE);
             }
             else
                 pTmpColor = pHCColor;
@@ -4227,12 +4243,8 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
                 PaintShadow( rRect, aRect, rAttrs );
             }
 
-            if (pViewOption->IsTableBoundaries())
-            {
-                // fdo#75118 Paint border lines only when it's enabled.
-                SwTabFrmPainter aHelper(*this);
-                aHelper.PaintLines(*pGlobalShell->GetOut(), rRect);
-            }
+            SwTabFrmPainter aHelper(*this);
+            aHelper.PaintLines(*pGlobalShell->GetOut(), rRect);
         }
         // <-- collapsing
 
@@ -6343,7 +6355,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
 
 void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
 {
-    if ( IS_SUBS || IS_SUBS_TABLE || IS_SUBS_SECTION || IS_SUBS_FLYS )
+    if ( IS_SUBS || isTableBoundariesEnabled() || IS_SUBS_SECTION || IS_SUBS_FLYS )
     {
         SwRect aRect( rRect );
         // OD 18.02.2003 #104989# - Not necessary and incorrect alignment of


More information about the Libreoffice-commits mailing list