diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-04 12:59:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-04 13:34:25 +0100 |
commit | 5da687891223488f46d08d705585ace1900ba0f4 (patch) | |
tree | fe1bc49fef234de547db1a655e10e76f214b903f /svx | |
parent | 2876a0f79f94cdd139cc8fa40669acde9674bf8c (diff) |
tdf#131015 crash using the pipette in Edit Contour dialog
regression from
commit 52fece12345161911da2a531213b7d5541192aad
Date: Wed Jan 15 12:43:19 2020 +0200
tweak GetBitmap methods in BitmapEx
we end up self-assigning, and with a little bit of optimisation, we can
up overwriting parts of the graphic we need to construct the new
graphic.
Change-Id: Ie7e9ce3f9a69f1fe954079873c206985b81db68a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89954
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/_contdlg.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index fe08cad1fed7..d82004f475bb 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -623,17 +623,15 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) { if ( rWnd.IsClickValid() ) { - Bitmap aMask; const Color& rColor = rWnd.GetPipetteColor(); weld::WaitObject aWaitObj(&m_rDialog); if( aGraphic.GetType() == GraphicType::Bitmap ) { - const Bitmap & rBmp( aGraphic.GetBitmapEx().GetBitmap() ); const long nTol = static_cast<long>(m_xMtfTolerance->get_value(FieldUnit::PERCENT) * 255 / 100); - aMask = rBmp.CreateMask( rColor, nTol ); + Bitmap aMask = aGraphic.GetBitmapEx().GetBitmap().CreateMask( rColor, nTol ); if( aGraphic.IsTransparent() ) aMask.CombineSimple( aGraphic.GetBitmapEx().GetMask(), BmpCombine::Or ); @@ -647,7 +645,8 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) aRedoGraphic = Graphic(); aUndoGraphic = aGraphic; - aGraphic = Graphic( BitmapEx( rBmp, aMask ) ); + Bitmap aBmp = aGraphic.GetBitmapEx().GetBitmap(); + aGraphic = Graphic( BitmapEx( aBmp, aMask ) ); mnGrfChanged++; bNewContour = (xQBox->run() == RET_YES); |