vcl/source/outdev/clipping.cxx | 3 ++- vcl/source/outdev/gradient.cxx | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-)
New commits: commit e021901b6c4f60735512c8d36b625be4f8edfd77 Author: Jan-Marek Glogowski <jan-marek.glogow...@extern.cib.de> AuthorDate: Tue Nov 26 03:38:01 2019 +0000 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Wed Nov 27 21:52:08 2019 +0100 tdf#128337 clip the metafile Gradient drawing This basically reverts the patches for tdf#125670. Instead this just checks the mpGraphics in InitClipRegion() before using it, to prevent the crash from the tdf#125670 bug report. Additionally it drops the early mbOutputClipped return, as the output device doesn't matter for the metafile drawing and the preview of the tdf#125670 bugdoc and the Impress full screen view otherwise don't show the gradients. This patch works for me in the following tested scenarios: 1. Bugdoc tdf#125670 doesn't crash 2. Bugdoc tdf#125670 draws gradients in Impress full screen 3. Correct thumbnail pictures for both bug documents With all these side effects, I have no idea, if this is finally the correct fix and doesn't break anything else... Change-Id: I8c48210d4255e50339710fc14819d15686417c9c Reviewed-on: https://gerrit.libreoffice.org/83722 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx index 416dc3be6595..1c6e4551c102 100644 --- a/vcl/source/outdev/clipping.cxx +++ b/vcl/source/outdev/clipping.cxx @@ -170,7 +170,8 @@ void OutputDevice::InitClipRegion() { if ( mbClipRegionSet ) { - mpGraphics->ResetClipRegion(); + if (mpGraphics) + mpGraphics->ResetClipRegion(); mbClipRegionSet = false; } diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index 7fc37b31c9ab..2e8406714daf 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -50,6 +50,10 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, { assert(!is_double_buffered_window()); + if (mbInitClipRegion) + InitClipRegion(); + // don't return on mbOutputClipped here, as we may need to draw the clipped metafile, even if the output is clipped + if ( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() ) { if ( mnDrawMode & ( DrawModeFlags::BlackGradient | DrawModeFlags::WhiteGradient | DrawModeFlags::SettingsGradient) ) @@ -94,20 +98,17 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, if( !mpGraphics && !AcquireGraphics() ) return; - if( mbInitClipRegion ) - InitClipRegion(); - - if (mbOutputClipped) - return; - // secure clip region Push( PushFlags::CLIPREGION ); IntersectClipRegion( aBoundRect ); + if (mbInitClipRegion) + InitClipRegion(); + // try to draw gradient natively bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient ); - if (!bDrawn) + if (!bDrawn && !mbOutputClipped) { // draw gradients without border if( mbLineColor || mbInitLineColor ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits