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

Caolán McNamara caolanm at redhat.com
Tue Feb 28 09:30:24 UTC 2017


 filter/source/graphicfilter/itiff/itiff.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit c0d06c51f2b742d544a452f38556c49f889147e3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 09:29:26 2017 +0000

    sal_uLong->sal_uInt32
    
    Change-Id: I49d926f4ff064871e3773fce089d7f927df9b099

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 807756a..3fe1018 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -91,7 +91,7 @@ private:
     sal_uLong               nGroup4Options;
     sal_uLong               nResolutionUnit;            // unit of fX/YResolution: 1=unknown, 2(default)=inch, 3=cm
     sal_uLong               nPredictor;
-    sal_uLong*              pColorMap;                  // color palette
+    sal_uInt32*             pColorMap;                  // color palette
     sal_uLong               nNumColors;                 // number of colors within the color palette
 
     sal_uLong               nPlanes;                    // number of layers within the Tiff file
@@ -493,23 +493,23 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen)
             nNumColors= ( (sal_uLong)1 << nBitsPerSample );
             if ( nDataType == 3 && nNumColors <= 256)
             {
-                pColorMap = new sal_uLong[ 256 ];
+                pColorMap = new sal_uInt32[256];
                 for ( i = 0; i < nNumColors; i++ )
                     pColorMap[ i ] = 0;
                 for ( i = 0; i < nNumColors; i++ )
                 {
                     pTIFF->ReadUInt16( nVal );
-                    pColorMap[ i ] |= ( ( (sal_uLong)nVal ) << 8 ) & 0x00ff0000;
+                    pColorMap[ i ] |= ( ( (sal_uInt32)nVal ) << 8 ) & 0x00ff0000;
                 }
                 for ( i = 0; i < nNumColors; i++ )
                 {
                     pTIFF->ReadUInt16( nVal );
-                    pColorMap[ i ] |= ( (sal_uLong)nVal ) & 0x0000ff00;
+                    pColorMap[ i ] |= ( (sal_uInt32)nVal ) & 0x0000ff00;
                 }
                 for ( i = 0; i < nNumColors; i++ )
                 {
                     pTIFF->ReadUInt16( nVal );
-                    pColorMap[ i ] |= ( ( (sal_uLong)nVal ) >> 8 ) & 0x000000ff;
+                    pColorMap[ i ] |= ( ( (sal_uInt32)nVal ) >> 8 ) & 0x000000ff;
                 }
             }
             else
@@ -1098,9 +1098,9 @@ void TIFFReader::MakePalCol()
 {
     if ( nDstBitsPerPixel <= 8 )
     {
-        sal_uLong i, nVal, n0RGB;
+        sal_uLong i, nVal;
         if  ( pColorMap == nullptr )
-            pColorMap = new sal_uLong[ 256 ];
+            pColorMap = new sal_uInt32[256];
         if ( nPhotometricInterpretation <= 1 )
         {
             nNumColors = (sal_uLong)1 << nBitsPerSample;
@@ -1110,7 +1110,7 @@ void TIFFReader::MakePalCol()
             for ( i = 0; i < nNumColors; i++ )
             {
                 nVal = ( i * 255 / ( nNumColors - 1 ) ) & 0xff;
-                n0RGB = nVal | ( nVal << 8 ) | ( nVal << 16 );
+                sal_uInt32 n0RGB = nVal | ( nVal << 8 ) | ( nVal << 16 );
                 if ( nPhotometricInterpretation == 1 )
                     pColorMap[ i ] = n0RGB;
                 else


More information about the Libreoffice-commits mailing list