From 68bc6a5dd68006ab86e7ef26f9e5d241cb118879 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 13 Mar 2021 12:00:28 +0900 Subject: add PixelFormat enum that replaces bit count in Bitmap/BitmapEx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bit count for the image is a numeric value (sal_uInt16) but only a handful of values make sense - namely 1,4,8,24 and 32. This replaces the numeric value with an enum, which only accepts those values and checks the correct values are used at compile time. Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- forms/source/component/imgprod.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'forms') diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index b38632ea4148..dbcaad592235 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -376,7 +376,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic ) if( !pMskAcc ) { - aMask = Bitmap( aBmp.GetSizePixel(), 1 ); + aMask = Bitmap(aBmp.GetSizePixel(), vcl::PixelFormat::N1_BPP); aMask.Erase( COL_BLACK ); pMskAcc = aMask.AcquireReadAccess(); } -- cgit