diff options
-rw-r--r-- | vcl/inc/salbmp.hxx | 3 | ||||
-rw-r--r-- | vcl/source/bitmap/salbmp.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx index 943f9d6b2986..adbf70e5c17f 100644 --- a/vcl/inc/salbmp.hxx +++ b/vcl/inc/salbmp.hxx @@ -121,7 +121,8 @@ protected: { A8, RGBA, - BGRA + BGRA, + LAST = BGRA }; static std::unique_ptr< sal_uInt8[] > convertDataBitCount( const sal_uInt8* src, int width, int height, int bitCount, int bytesPerRow, const BitmapPalette& palette, diff --git a/vcl/source/bitmap/salbmp.cxx b/vcl/source/bitmap/salbmp.cxx index 880be0bb437b..7159ac3d5a6b 100644 --- a/vcl/source/bitmap/salbmp.cxx +++ b/vcl/source/bitmap/salbmp.cxx @@ -18,6 +18,7 @@ */ #include <salbmp.hxx> +#include <o3tl/enumarray.hxx> static BitmapChecksum scanlineChecksum(BitmapChecksum nCrc, const sal_uInt8* bits, int lineBitsCount, sal_uInt8 extraBitsMask) { @@ -264,8 +265,8 @@ std::unique_ptr< sal_uInt8[] > SalBitmap::convertDataBitCount( const sal_uInt8* int width, int height, int bitCount, int bytesPerRow, const BitmapPalette& palette, BitConvert type ) { assert( bitCount == 1 || bitCount == 4 || bitCount == 8 ); - static const int bpp[] = { 1, 3, 3, 4, 4 }; - std::unique_ptr< sal_uInt8[] > data( new sal_uInt8[width * height * bpp[ static_cast<int>(type) ]] ); + static const o3tl::enumarray<BitConvert, int> bpp = { 1, 4, 4 }; + std::unique_ptr< sal_uInt8[] > data( new sal_uInt8[width * height * bpp[ type ]] ); if(type == BitConvert::A8 && bitCount == 8 && palette.IsGreyPalette8Bit()) { // no actual data conversion |