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

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Sat Dec 19 03:17:05 UTC 2020


 vcl/source/gdi/bitmap3.cxx |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit f1469adf0e81e6e7c8aa650c95d9e7a93bb18e85
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Fri Dec 18 15:32:27 2020 +1100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Dec 19 04:16:31 2020 +0100

    vcl: remove bRet variable from Bitmap::Dither()
    
    Change-Id: I6b9b8107e745ba4c84d7add070562d876dbf03da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107948
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index e037c0c38c99..cd7232ed1b82 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -847,8 +847,6 @@ bool Bitmap::Dither()
     if( aSize.Width() == 1 || aSize.Height() == 1 )
         return true;
 
-    bool bRet = false;
-
     if( ( aSize.Width() > 3 ) && ( aSize.Height() > 2 ) )
     {
         ScopedReadAccess pReadAcc(*this);
@@ -964,14 +962,9 @@ bool Bitmap::Dither()
                 pWriteAcc->SetPixelOnData( pScanline, nWidth1, BitmapColor(static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ])) );
             }
 
-            bRet = true;
-        }
-
-        pReadAcc.reset();
-        pWriteAcc.reset();
+            pReadAcc.reset();
+            pWriteAcc.reset();
 
-        if( bRet )
-        {
             const MapMode aMap( maPrefMapMode );
             const Size aPrefSize( maPrefSize );
 
@@ -979,10 +972,15 @@ bool Bitmap::Dither()
 
             maPrefMapMode = aMap;
             maPrefSize = aPrefSize;
+
+            return true;
         }
+
+        pReadAcc.reset();
+        pWriteAcc.reset();
     }
 
-    return bRet;
+    return false;
 }
 
 void Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, const Link<tools::Long,void>* pProgress )


More information about the Libreoffice-commits mailing list