summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/bitmap.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-17 08:19:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-17 09:19:40 +0200
commit3564b46992fc30e212011c19043a2553178ccbca (patch)
tree6d482124e951b7694f97ee230cccecfdb81b082f /vcl/source/bitmap/bitmap.cxx
parent9a831a6c19a30869782cfeb17f1c649a4ce4d9d9 (diff)
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>
Diffstat (limited to 'vcl/source/bitmap/bitmap.cxx')
-rw-r--r--vcl/source/bitmap/bitmap.cxx6
1 files changed, 5 insertions, 1 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