move the ImpBitmap::GetBitCount logic up to Bitmap
in preparation for removing ImpBitmap
Change-Id: I1ca76c645a8e988f6cd9be8a01b0d2853f6d6750
Reviewed-on: https://gerrit.libreoffice.org/53014
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index f02acce..c1cf302 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -247,7 +247,11 @@ Size Bitmap::GetSizePixel() const
sal_uInt16 Bitmap::GetBitCount() const
{
return( mxImpBmp ? mxImpBmp->GetBitCount() : 0 );
if (!mxImpBmp)
return 0;
sal_uInt16 nBitCount = mxImpBmp->GetBitCount();
return ( nBitCount <= 4 ) ? ( ( nBitCount <= 1 ) ? 1 : 4 ):
( ( nBitCount <= 8 ) ? 8 : 24);
}
bool Bitmap::HasGreyPalette() const
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 04b3f4c..1bea17c 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -72,9 +72,7 @@ Size ImpBitmap::GetSize() const
sal_uInt16 ImpBitmap::GetBitCount() const
{
sal_uInt16 nBitCount = mpSalBitmap->GetBitCount();
return ( nBitCount <= 4 ) ? ( ( nBitCount <= 1 ) ? 1 : 4 ):
( ( nBitCount <= 8 ) ? 8 : 24);
return mpSalBitmap->GetBitCount();
}
BitmapBuffer* ImpBitmap::AcquireBuffer( BitmapAccessMode nMode )