sw/source/core/layout/paintfrm.cxx | 42 +++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-)
New commits: commit e1823627f35e4419880769fdd05acddbd0a9c25c Author: Kohei Yoshida <kohei.yosh...@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 <mst...@redhat.com> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 5557547..e6b9a66 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -108,13 +108,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() && \ @@ -260,6 +253,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) @@ -2571,8 +2585,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; @@ -4320,12 +4336,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 @@ -6623,7 +6635,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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits