diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-17 08:19:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-17 09:19:40 +0200 |
commit | 3564b46992fc30e212011c19043a2553178ccbca (patch) | |
tree | 6d482124e951b7694f97ee230cccecfdb81b082f /vcl | |
parent | 9a831a6c19a30869782cfeb17f1c649a4ce4d9d9 (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')
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/impbmp.cxx | 4 |
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 ) |