vcl/inc/salgdi.hxx | 3 ++- vcl/source/gdi/salgdilayout.cxx | 8 +++++++- vcl/source/outdev/gradient.cxx | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-)
New commits: commit 0932a7a2c3b64a30f6928007a7d60a2073660f40 Author: Caolán McNamara <[email protected]> AuthorDate: Tue Dec 15 11:55:29 2020 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Dec 15 21:01:22 2020 +0100 tdf#138936 gradient missing under RTL from writer comment margins Change-Id: I57533f033f9528b7c89162967b392eb5abb4d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107702 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 6ed360105d24..4ebdcb283697 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -275,7 +275,8 @@ public: bool DrawGradient( const tools::PolyPolygon& rPolyPoly, - const Gradient& rGradient ); + const Gradient& rGradient, + const OutputDevice* pOutDev); bool DrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, SalGradient const & rGradient); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 5638cb9bb856..452b5b61dd8e 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -600,8 +600,14 @@ bool SalGraphics::DrawPolyLine( bPixelSnapHairline); } -bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) +bool SalGraphics::DrawGradient(const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, const OutputDevice* pOutDev) { + if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) + { + tools::PolyPolygon aFinal(mirror(rPolyPoly.getB2DPolyPolygon(), pOutDev)); + return drawGradient(aFinal, rGradient); + } + return drawGradient( rPolyPoly, rGradient ); } diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index f37bad807845..0312369c959a 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -107,7 +107,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, // try to draw gradient natively if (!mbOutputClipped) - bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient ); + bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient, this ); if (!bDrawn && !mbOutputClipped) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
