From 918012d94cf9419318e66aaa489a75e56f81074f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 7 May 2023 16:08:40 +0200 Subject: [PATCH] simplify code The BitmapEx constructor already does this check, no need to do it here Change-Id: Iacd0e1b1d4aa3dfae120e0d4a60a6924ecd9f778 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151460 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/source/bitmap/dibtools.cxx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx index 78732a43f17a..c95c21704dd9 100644 --- a/vcl/source/bitmap/dibtools.cxx +++ b/vcl/source/bitmap/dibtools.cxx @@ -1670,25 +1670,9 @@ bool ReadDIBBitmapEx( bRetval = ImplReadDIB(aMask, nullptr, rIStm, true); - if(bRetval) - { - if(!aMask.IsEmpty()) - { - // do we have an alpha mask? - if (aMask.getPixelFormat() == vcl::PixelFormat::N8_BPP && aMask.HasGreyPalette8Bit()) - { - AlphaMask aAlpha; + if(bRetval && !aMask.IsEmpty()) + rTarget = BitmapEx(aBmp, aMask); - // create alpha mask quickly (without greyscale conversion) - aAlpha.ImplSetBitmap(aMask); - rTarget = BitmapEx(aBmp, aAlpha); - } - else - { - rTarget = BitmapEx(aBmp, aMask); - } - } - } break; } case 1: // backwards compat for old option TransparentType::Color