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

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


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

New commits:
commit f0e1f861d537e95bafeb52e240d093e574aa2ee9
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Fri Dec 18 16:30:54 2020 +1100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Dec 19 04:20:02 2020 +0100

    vcl: move variables in Dither() closer to where they are used
    
    Change-Id: If0621cd6feb4442f2bc2c026580bf50259c6b2f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107951
    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 aba33b41c754..293f1682e00c 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -751,18 +751,15 @@ bool Bitmap::Dither()
             tools::Long nWidth = pReadAcc->Width();
             tools::Long nWidth1 = nWidth - 1;
             tools::Long nHeight = pReadAcc->Height();
-            tools::Long nX;
             tools::Long nW = nWidth * 3;
             tools::Long nW2 = nW - 3;
-            tools::Long nRErr, nGErr, nBErr;
-            tools::Long nRC, nGC, nBC;
             std::unique_ptr<tools::Long[]> p1(new tools::Long[ nW ]);
             std::unique_ptr<tools::Long[]> p2(new tools::Long[ nW ]);
             tools::Long* p1T = p1.get();
             tools::Long* p2T = p2.get();
             tools::Long* pTmp;
-            bool bPal = pReadAcc->HasPalette();
 
+            bool bPal = pReadAcc->HasPalette();
             pTmp = p2T;
 
             if( bPal )
@@ -790,6 +787,9 @@ bool Bitmap::Dither()
                 }
             }
 
+            tools::Long nRErr, nGErr, nBErr;
+            tools::Long nRC, nGC, nBC;
+
             for( tools::Long nY = 1, nYAcc = 0; nY <= nHeight; nY++, nYAcc++ )
             {
                 pTmp = p1T;
@@ -825,7 +825,7 @@ bool Bitmap::Dither()
                 }
 
                 // Examine first Pixel separately
-                nX = 0;
+                tools::Long nX = 0;
                 tools::Long nTemp;
                 CALC_ERRORS;
                 CALC_TABLES7;


More information about the Libreoffice-commits mailing list