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

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 18 10:48:55 UTC 2020


 vcl/source/gdi/bitmap3.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3f28fd9a4093de421ea92ddcf7e8cda65f65a3f0
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Thu Dec 17 05:34:37 2020 +1100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Dec 18 11:48:13 2020 +0100

    vcl: move nShift closer into scope where it is used
    
    Change-Id: If85e013269b39e1d8d34653a1348d080d34eba99
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107851
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index a2c50583a2b4..e037c0c38c99 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -343,7 +343,6 @@ bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
     if( pReadAcc )
     {
         const BitmapPalette& rPal = GetGreyPalette( nGreys );
-        sal_uLong nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
         bool bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
 
         if( !bPalDiffers )
@@ -359,6 +358,8 @@ bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
                 const tools::Long nWidth = pWriteAcc->Width();
                 const tools::Long nHeight = pWriteAcc->Height();
 
+                sal_uLong nShift = ((nGreys == 16) ? 4UL : 0UL);
+
                 if( pReadAcc->HasPalette() )
                 {
                     for( tools::Long nY = 0; nY < nHeight; nY++ )


More information about the Libreoffice-commits mailing list