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

Stephan Bergmann sbergman at redhat.com
Thu Sep 3 07:37:16 PDT 2015


 vcl/source/gdi/bitmap3.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 0aa9cd69598e1c022aa676f81dc7bc2f03e58b2c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Sep 3 16:29:31 2015 +0200

    Fix mis-merge
    
    ...where fb6f2e1109abdd09e80dbcd6660a9530fc06ff0f "Resolves: #i121407# Gallery
    reorganizations..." first cherry-picked the younger 8012fae6cedcf325130d70adf0a486e8918f452f
    before f7d373d18f965b36f310d44044bdba6476f6eb03 "Added ColorDepth change test with assertion to
    the Bitmap::Scale method" then cherry-picked the older 4be8cc079667cca2cae91dba9e46c16ccff1537f,
    leading to the two checks at the top of Bitmap::Scale to not return early as intended.
    
    Thanks to clang-tidy clang-analyzer-deadcode.DeadStores for flagging this.
    
    Change-Id: Id89cc517a9f7efdff040c70f3b0e640d969cf24d

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index b2704e1..9d1ec35 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -873,22 +873,20 @@ bool Bitmap::ImplConvertGhosted()
 
 bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
-    bool bRetval(false);
-
-    const sal_uInt16 nStartCount(GetBitCount());
-
     if(basegfx::fTools::equalZero(rScaleX) || basegfx::fTools::equalZero(rScaleY))
     {
         // no scale
-        bRetval = true;
+        return true;
     }
 
     if(basegfx::fTools::equal(rScaleX, 1.0) && basegfx::fTools::equal(rScaleY, 1.0))
     {
         // no scale
-        bRetval = true;
+        return true;
     }
 
+    const sal_uInt16 nStartCount(GetBitCount());
+
     if( mpImpBmp )
     {
         // implementation specific scaling
@@ -924,6 +922,8 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
     if (nStartCount == 1 && nScaleFlag != BmpScaleFlag::NONE)
         nScaleFlag = BmpScaleFlag::Fast;
 
+    bool bRetval(false);
+
     switch(nScaleFlag)
     {
         case BmpScaleFlag::NONE :


More information about the Libreoffice-commits mailing list