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

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


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

New commits:
commit 641d6c35f3494f7e62d5ca3089b1f0764cfeb0a8
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Fri Dec 18 17:35:41 2020 +1100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Dec 19 04:21:23 2020 +0100

    vcl: remove duplicate pScanlineRead assignment
    
    Change-Id: I7864b8f009c2ea837f9d7afe43f882cf7037dca9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107953
    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 5c27100ef50a..a6c83bb52cc1 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -769,20 +769,22 @@ bool Bitmap::Dither()
             bool bPal = pReadAcc->HasPalette();
             pTmp = p2T;
 
-            if( bPal )
             {
                 Scanline pScanlineRead = pReadAcc->GetScanline(0);
-                for( tools::Long nZ = 0; nZ < nWidth; nZ++ )
+
+                if( bPal )
                 {
-                    shiftColor(pTmp, pReadAcc->GetPaletteColor(pReadAcc->GetIndexFromData(pScanlineRead, nZ)));
+                    for (tools::Long nZ = 0; nZ < nWidth; nZ++)
+                    {
+                        shiftColor(pTmp, pReadAcc->GetPaletteColor(pReadAcc->GetIndexFromData(pScanlineRead, nZ)));
+                    }
                 }
-            }
-            else
-            {
-                Scanline pScanlineRead = pReadAcc->GetScanline(0);
-                for( tools::Long nZ = 0; nZ < nWidth; nZ++ )
+                else
                 {
-                    shiftColor(pTmp, pReadAcc->GetPixelFromData(pScanlineRead, nZ));
+                    for (tools::Long nZ = 0; nZ < nWidth; nZ++)
+                    {
+                        shiftColor(pTmp, pReadAcc->GetPixelFromData(pScanlineRead, nZ));
+                    }
                 }
             }
 
@@ -795,11 +797,12 @@ bool Bitmap::Dither()
                 p1T = p2T;
                 p2T = pTmp;
 
-                if( nY < nHeight )
+                if (nY < nHeight)
                 {
+                    Scanline pScanlineRead = pReadAcc->GetScanline(nY);
+
                     if( bPal )
                     {
-                        Scanline pScanlineRead = pReadAcc->GetScanline(nY);
                         for( tools::Long nZ = 0; nZ < nWidth; nZ++ )
                         {
                             shiftColor(pTmp, pReadAcc->GetPaletteColor(pReadAcc->GetIndexFromData(pScanlineRead, nZ)));
@@ -807,7 +810,6 @@ bool Bitmap::Dither()
                     }
                     else
                     {
-                        Scanline pScanlineRead = pReadAcc->GetScanline(nY);
                         for( tools::Long nZ = 0; nZ < nWidth; nZ++ )
                         {
                             shiftColor(pTmp, pReadAcc->GetPixelFromData(pScanlineRead, nZ));


More information about the Libreoffice-commits mailing list