[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

Stephan Bergmann sbergman at redhat.com
Thu Sep 3 08:26:11 PDT 2015


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

New commits:
commit 65305ee03a64a90fa011b5b11b7076ddecf7728b
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
    (cherry picked from commit 0aa9cd69598e1c022aa676f81dc7bc2f03e58b2c)
    Reviewed-on: https://gerrit.libreoffice.org/18310
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 9a656d6..f5f6c32 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -866,22 +866,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
@@ -917,6 +915,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