[Libreoffice-commits] core.git: vcl/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Apr 17 07:20:45 UTC 2018


 vcl/source/bitmap/bitmap.cxx |    6 +++++-
 vcl/source/gdi/impbmp.cxx    |    4 +---
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 3564b46992fc30e212011c19043a2553178ccbca
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Apr 17 08:19:37 2018 +0200

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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 )


More information about the Libreoffice-commits mailing list