summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-11 10:36:15 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-12 05:47:13 -0500
commit95a6f31773e0ae03630ac301d0415361496243a4 (patch)
tree7ba0bc172a0b7aa89e27492dd7f11f69b2c41ac5
parent667943572cafa1c869597db68dd4c3c28fdaff6d (diff)
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@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/core/layout/paintfrm.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index f10d7b46d36e..55575477f425 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();
}