summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/source/bitmap/bitmap.cxx6
-rw-r--r--vcl/source/gdi/impbmp.cxx4
2 files changed, 6 insertions, 4 deletions
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index f02acce300e1..c1cf3027c2f0 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 04b3f4c34912..1bea17ce3173 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 )