diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-26 15:43:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-04-27 15:03:40 +0200 |
commit | 5e4fc9540993ee5e10f1986918acdd868a1fcf1b (patch) | |
tree | ce8220d974c5e7994c82fb35b7bee0f7fd21a7ed /filter/source/graphicfilter | |
parent | 0c2d6574c6cca4bbb0cc469fb2c976774394e01a (diff) |
clang-tidy modernize-loop-convert in f*
Change-Id: Id866aa244378758e3bdb9e99d02cdd2ae6104e16
Diffstat (limited to 'filter/source/graphicfilter')
-rw-r--r-- | filter/source/graphicfilter/icgm/bundles.cxx | 7 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/cgm.cxx | 4 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/elements.cxx | 13 | ||||
-rw-r--r-- | filter/source/graphicfilter/ipict/ipict.cxx | 6 | ||||
-rw-r--r-- | filter/source/graphicfilter/itiff/itiff.cxx | 6 |
5 files changed, 17 insertions, 19 deletions
diff --git a/filter/source/graphicfilter/icgm/bundles.cxx b/filter/source/graphicfilter/icgm/bundles.cxx index df877fed3020..a81f6db4c2d4 100644 --- a/filter/source/graphicfilter/icgm/bundles.cxx +++ b/filter/source/graphicfilter/icgm/bundles.cxx @@ -114,9 +114,8 @@ CGMFList& CGMFList::operator=( CGMFList& rSource ) nFontsAvailable = rSource.nFontsAvailable; nFontNameCount = rSource.nFontNameCount; nCharSetCount = rSource.nCharSetCount; - for ( size_t i = 0, n = rSource.aFontEntryList.size(); i < n; ++i ) + for (FontEntry* pPtr : rSource.aFontEntryList) { - FontEntry* pPtr = rSource.aFontEntryList[ i ]; FontEntry* pCFontEntry = new FontEntry; if ( pPtr->pFontName ) { @@ -248,8 +247,8 @@ void CGMFList::InsertCharSet( CharSetType eCharSetType, sal_uInt8* pSource, sal_ void CGMFList::ImplDeleteList() { - for ( size_t i = 0, n = aFontEntryList.size(); i < n; ++i ) - delete aFontEntryList[ i ]; + for (FontEntry* i : aFontEntryList) + delete i; aFontEntryList.clear(); } diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index b71aa03c0d60..30804b06845f 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -81,8 +81,8 @@ CGM::~CGM() mpGDIMetaFile->SetPrefSize( Size( static_cast< long >( mnOutdx ), static_cast< long >( mnOutdy ) ) ); *mpGraphic = Graphic( *mpGDIMetaFile ); } - for( size_t i = 0, n = maDefRepList.size(); i < n; ++i ) - delete [] maDefRepList[i]; + for(sal_uInt8* i : maDefRepList) + delete [] i; maDefRepList.clear(); maDefRepSizeList.clear(); delete mpBitmapInUse; diff --git a/filter/source/graphicfilter/icgm/elements.cxx b/filter/source/graphicfilter/icgm/elements.cxx index 60e4c0f5f7b2..b548d93a1283 100644 --- a/filter/source/graphicfilter/icgm/elements.cxx +++ b/filter/source/graphicfilter/icgm/elements.cxx @@ -292,8 +292,8 @@ void CGMElements::ImplInsertHatch( sal_Int32 nKey, int nStyle, long nDistance, l void CGMElements::DeleteAllBundles( BundleList& rList ) { - for ( size_t i = 0, n = rList.size(); i < n; ++i ) { - delete rList[ i ]; + for (Bundle* i : rList) { + delete i; } rList.clear(); }; @@ -303,9 +303,8 @@ void CGMElements::CopyAllBundles( BundleList& rSource, BundleList& rDest ) { DeleteAllBundles( rDest ); - for ( size_t i = 0, n = rSource.size(); i < n; ++i ) + for (Bundle* pPtr : rSource) { - Bundle* pPtr = rSource[ i ]; Bundle* pTempBundle = pPtr->Clone(); rDest.push_back( pTempBundle ); } @@ -324,9 +323,9 @@ Bundle* CGMElements::GetBundleIndex( long nIndex, BundleList& rList, Bundle& rBu Bundle* CGMElements::GetBundle( BundleList& rList, long nIndex ) { - for ( size_t i = 0, n = rList.size(); i < n; ++i ) { - if ( rList[ i ]->GetIndex() == nIndex ) { - return rList[ i ]; + for (Bundle* i : rList) { + if ( i->GetIndex() == nIndex ) { + return i; } } return nullptr; diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 223efb72838f..29298b2c1bd1 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -90,10 +90,10 @@ namespace PictReaderInternal { // count the no of bits in pattern which are set to 1: nBitCount=0; - for (short ny=0; ny<8; ny++) { - stream.ReadChar( reinterpret_cast<char&>(nbyte[ny]) ); + for (unsigned char & ny : nbyte) { + stream.ReadChar( reinterpret_cast<char&>(ny) ); for (short nx=0; nx<8; nx++) { - if ( (nbyte[ny] & (1<<nx)) != 0 ) nBitCount++; + if ( (ny & (1<<nx)) != 0 ) nBitCount++; } } diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index f4352df88e8f..c87e8f8e24f7 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -1369,15 +1369,15 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) { nBytesPerRow = ( nImageWidth * nSamplesPerPixel / nPlanes * nBitsPerSample + 7 ) >> 3; - for ( sal_uLong j = 0; j < 4; j++ ) + for (sal_uInt8*& j : pMap) { try { - pMap[ j ] = new sal_uInt8[ nBytesPerRow ]; + j = new sal_uInt8[ nBytesPerRow ]; } catch (const std::bad_alloc &) { - pMap[ j ] = nullptr; + j = nullptr; bStatus = false; break; } |