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

Stephan Bergmann sbergman at redhat.com
Tue Mar 7 18:54:02 UTC 2017


 filter/source/flash/swfexporter.cxx          |    3 +--
 filter/source/graphicfilter/eps/eps.cxx      |    6 +++---
 filter/source/graphicfilter/etiff/etiff.cxx  |    7 +++----
 filter/source/graphicfilter/idxf/dxf2mtf.cxx |    6 ++----
 filter/source/graphicfilter/ipbm/ipbm.cxx    |    4 +---
 filter/source/msfilter/escherex.cxx          |    6 ++----
 filter/source/msfilter/msdffimp.cxx          |    5 ++---
 filter/source/msfilter/svdfppt.cxx           |    4 ++--
 8 files changed, 16 insertions(+), 25 deletions(-)

New commits:
commit f33f9bb8d3c4e61320efd954c1b96ab88a661640
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 7 19:53:20 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: I72cdd1d386db62feff9a42651fc7f0954e76afdf

diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx
index d2af184..b011001 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -166,14 +166,13 @@ bool FlashExporter::exportAll( const Reference< XComponent >& xDoc, Reference< X
 
     // #i56084# nPageCount is 1 when exporting selection
     const sal_Int32 nPageCount = mbExportSelection ? 1 : xDrawPages->getCount();
-    sal_uInt16 nPage;
 
     if ( xStatusIndicator.is() )
     {
         xStatusIndicator->start("Macromedia Flash (SWF)", nPageCount);
     }
 
-    for( nPage = 0; nPage < nPageCount; nPage++)
+    for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++)
     {
         // #i56084# keep PageNumber? We could determine the PageNumber of the single to-be-exported page
         // when exporting the selection, but this is only used for swf internal, so no need to do so (AFAIK)
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 0f78c47..707c50e 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -500,13 +500,13 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
                 nLines++;
             nLines *= aSizeBitmap.Height();
             ImplWriteLong( nLines );
-            sal_Int32 nX, nY, nCount2, nCount = 4;
+            sal_Int32 nCount2, nCount = 4;
             const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
-            for ( nY = 0; nY < aSizeBitmap.Height(); nY++ )
+            for ( long nY = 0; nY < aSizeBitmap.Height(); nY++ )
             {
                 nCount2 = 0;
                 char nVal = 0;
-                for ( nX = 0; nX < aSizeBitmap.Width(); nX++ )
+                for ( long nX = 0; nX < aSizeBitmap.Width(); nX++ )
                 {
                     if ( !nCount2 )
                     {
diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx
index d5251b7..43b6730 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -314,23 +314,22 @@ bool TIFFWriter::ImplWriteHeader( bool bMultiPage )
 
 void TIFFWriter::ImplWritePalette()
 {
-    sal_uInt16 i;
     sal_uLong nCurrentPos = m_rOStm.Tell();
     m_rOStm.Seek( mnPalPos + 8 );           // the palette tag entry needs the offset
     m_rOStm.WriteUInt32( nCurrentPos - mnStreamOfs );  // to the palette colors
     m_rOStm.Seek( nCurrentPos );
 
-    for ( i = 0; i < mnColors; i++ )
+    for ( sal_uInt32 i = 0; i < mnColors; i++ )
     {
         const BitmapColor& rColor = mpAcc->GetPaletteColor( i );
         m_rOStm.WriteUInt16( rColor.GetRed() << 8 );
     }
-    for ( i = 0; i < mnColors; i++ )
+    for ( sal_uInt32 i = 0; i < mnColors; i++ )
     {
         const BitmapColor& rColor = mpAcc->GetPaletteColor( i );
         m_rOStm.WriteUInt16( rColor.GetGreen() << 8 );
     }
-    for ( i = 0; i < mnColors; i++ )
+    for ( sal_uInt32 i = 0; i < mnColors; i++ )
     {
         const BitmapColor& rColor = mpAcc->GetPaletteColor( i );
         m_rOStm.WriteUInt16( rColor.GetBlue() << 8 );
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 64ce94c..b867bca 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -74,9 +74,8 @@ DXFLineInfo DXF2GDIMetaFile::LTypeToDXFLineInfo(OString const& rLineType)
         aDXFLineInfo.eStyle = LineStyle::Solid;
     }
     else {
-        sal_Int32 i;
         aDXFLineInfo.eStyle = LineStyle::Dash;
-        for (i=0; i < (pLT->nDashCount); i++) {
+        for (long i=0; i < (pLT->nDashCount); i++) {
             const double x = pLT->fDash[i] * pDXF->getGlobalLineTypeScale();
             if ( x >= 0.0 ) {
                 if ( aDXFLineInfo.nDotCount == 0 ) {
@@ -584,8 +583,7 @@ void DXF2GDIMetaFile::DrawHatchEntity(const DXFHatchEntity & rE, const DXFTransf
             }
             else
             {
-                sal_uInt32 i;
-                for ( i = 0; i < rPathData.aEdges.size(); i++ )
+                for ( std::deque<DXFEdgeType*>::size_type i = 0; i < rPathData.aEdges.size(); i++ )
                 {
                     const DXFEdgeType* pEdge = rPathData.aEdges[ i ];
                     switch( pEdge->nEdgeType )
diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx
index aeb974c..855a253 100644
--- a/filter/source/graphicfilter/ipbm/ipbm.cxx
+++ b/filter/source/graphicfilter/ipbm/ipbm.cxx
@@ -66,8 +66,6 @@ PBMReader::PBMReader(SvStream & rPBM)
 
 bool PBMReader::ReadPBM(Graphic & rGraphic )
 {
-    sal_uInt16 i;
-
     if ( mrPBM.GetError() )
         return false;
 
@@ -116,7 +114,7 @@ bool PBMReader::ReadPBM(Graphic & rGraphic )
                 mnCol = 256;
 
             mpAcc->SetPaletteEntryCount( 256 );
-            for ( i = 0; i < mnCol; i++ )
+            for ( sal_uLong i = 0; i < mnCol; i++ )
             {
                 sal_uLong nCount = 255 * i / mnCol;
                 mpAcc->SetPaletteColor( i, BitmapColor( (sal_uInt8)nCount, (sal_uInt8)nCount, (sal_uInt8)nCount ) );
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 575cb6e..b32f965 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3504,7 +3504,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
                             sal_uInt16 nElements = (sal_uInt16)aHandlesPropSeq.getLength();
                             if ( nElements )
                             {
-                                sal_uInt16 k, j, nElementSize = 36;
+                                sal_uInt16 k, nElementSize = 36;
                                 sal_uInt32 nStreamSize = nElementSize * nElements + 6;
                                 SvMemoryStream aOut( nStreamSize );
                                 aOut.WriteUInt16( nElements )
@@ -3524,10 +3524,8 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
                                     sal_Int32 nYRangeMax = 0x7fffffff;
 
                                     const uno::Sequence< beans::PropertyValue >& rPropSeq = aHandlesPropSeq[ k ];
-                                    for ( j = 0; j < rPropSeq.getLength(); j++ )
+                                    for ( const beans::PropertyValue& rPropVal: rPropSeq )
                                     {
-                                        const beans::PropertyValue& rPropVal = rPropSeq[ j ];
-
                                         const OUString sPosition           ( "Position"  );
                                         const OUString sMirroredX          ( "MirroredX"  );
                                         const OUString sMirroredY          ( "MirroredY"  );
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 15b0449..502888e 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1112,10 +1112,9 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
         BitmapWriteAccess* pAcc = aBitmap.AcquireWriteAccess();
         if ( pAcc )
         {
-            sal_Int32 nX, nY;
-            for ( nY = 0; nY < aBitmapSizePixel.Height(); nY++ )
+            for ( long nY = 0; nY < aBitmapSizePixel.Height(); nY++ )
             {
-                for ( nX = 0; nX < aBitmapSizePixel.Width(); nX++ )
+                for ( long nX = 0; nX < aBitmapSizePixel.Width(); nX++ )
                 {
                     double fX = static_cast< double >( nX ) / aBitmapSizePixel.Width();
                     double fY = static_cast< double >( nY ) / aBitmapSizePixel.Height();
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index cb2fceb..5cb4caf 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2028,7 +2028,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
                                     {
                                         SvStorageInfoList aList;
                                         xSource->FillInfoList( &aList );
-                                        sal_uInt32 i;
+                                        SvStorageInfoList::size_type i;
 
                                         bool bCopied = true;
                                         for ( i = 0; i < aList.size(); i++ )    // copy all entries
@@ -6686,7 +6686,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                 if ( aTextSpecInfoAtomInterpreter.Read( rIn, aTextSpecInfoHd, PPT_PST_TextSpecInfoAtom,
                                         &(rSdrPowerPointImport.pPPTStyleSheet->maTxSI) ) )
                                 {
-                                    sal_uInt32  nI = 0;
+                                    PPTCharPropSetList::size_type nI = 0;
                                     for (PPTTextSpecInfo* pSpecInfo : aTextSpecInfoAtomInterpreter.aList)
                                     {
                                         sal_uInt32 nCharIdx = pSpecInfo->nCharIdx;


More information about the Libreoffice-commits mailing list