diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-17 19:41:07 -0400 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-18 13:53:40 +0000 |
commit | e1823627f35e4419880769fdd05acddbd0a9c25c (patch) | |
tree | fd3bed5e513954a1ad66e490ffebcb91ae7c929d | |
parent | e6006b5c91c8f6852a1b8b1b7ed1c5e7b4975a68 (diff) |
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@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 55575477f425..e6b9a66dcfb0 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 |