summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-26 15:43:28 +0200
committerNoel Grandin <noel@peralex.com>2016-04-27 15:03:40 +0200
commit5e4fc9540993ee5e10f1986918acdd868a1fcf1b (patch)
treece8220d974c5e7994c82fb35b7bee0f7fd21a7ed /filter
parent0c2d6574c6cca4bbb0cc469fb2c976774394e01a (diff)
clang-tidy modernize-loop-convert in f*
Change-Id: Id866aa244378758e3bdb9e99d02cdd2ae6104e16
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/bundles.cxx7
-rw-r--r--filter/source/graphicfilter/icgm/cgm.cxx4
-rw-r--r--filter/source/graphicfilter/icgm/elements.cxx13
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx6
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx6
-rw-r--r--filter/source/msfilter/escherex.cxx35
-rw-r--r--filter/source/msfilter/msdffimp.cxx4
-rw-r--r--filter/source/msfilter/msoleexp.cxx3
-rw-r--r--filter/source/msfilter/msvbahelper.cxx4
-rw-r--r--filter/source/msfilter/svdfppt.cxx96
-rw-r--r--filter/source/msfilter/util.cxx8
-rw-r--r--filter/source/svg/svgexport.cxx23
-rw-r--r--filter/source/svg/svgfilter.cxx4
-rw-r--r--filter/source/svg/svgreader.cxx12
14 files changed, 102 insertions, 123 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;
}
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index c56d27a4eca2..d67557686a80 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3854,15 +3854,14 @@ EscherPersistTable::EscherPersistTable()
EscherPersistTable::~EscherPersistTable()
{
- for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
- delete maPersistTable[ i ];
+ for(EscherPersistEntry* i : maPersistTable) {
+ delete i;
}
}
bool EscherPersistTable::PtIsID( sal_uInt32 nID )
{
- for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
- EscherPersistEntry* pPtr = maPersistTable[ i ];
+ for(EscherPersistEntry* pPtr : maPersistTable) {
if ( pPtr->mnID == nID ) {
return true;
}
@@ -3890,8 +3889,7 @@ void EscherPersistTable::PtDelete( sal_uInt32 nID )
sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID )
{
- for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
- EscherPersistEntry* pPtr = maPersistTable[ i ];
+ for(EscherPersistEntry* pPtr : maPersistTable) {
if ( pPtr->mnID == nID ) {
return pPtr->mnOffset;
}
@@ -3901,8 +3899,7 @@ sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID )
void EscherPersistTable::PtReplace( sal_uInt32 nID, sal_uInt32 nOfs )
{
- for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
- EscherPersistEntry* pPtr = maPersistTable[ i ];
+ for(EscherPersistEntry* pPtr : maPersistTable) {
if ( pPtr->mnID == nID ) {
pPtr->mnOffset = nOfs;
return;
@@ -3912,8 +3909,7 @@ void EscherPersistTable::PtReplace( sal_uInt32 nID, sal_uInt32 nOfs )
void EscherPersistTable::PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs )
{
- for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
- EscherPersistEntry* pPtr = maPersistTable[ i ];
+ for(EscherPersistEntry* pPtr : maPersistTable) {
if ( pPtr->mnID == nID ) {
pPtr->mnOffset = nOfs;
return;
@@ -4731,11 +4727,11 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
EscherSolverContainer::~EscherSolverContainer()
{
- for( size_t i = 0, n = maShapeList.size(); i < n; ++i ) {
- delete maShapeList[ i ];
+ for(EscherShapeListEntry* i : maShapeList) {
+ delete i;
}
- for( size_t i = 0, n = maConnectorList.size(); i < n; ++i ) {
- delete maConnectorList[ i ];
+ for(EscherConnectorListEntry* i : maConnectorList) {
+ delete i;
}
}
@@ -4757,11 +4753,10 @@ void EscherSolverContainer::AddConnector(
sal_uInt32 EscherSolverContainer::GetShapeId( const css::uno::Reference< css::drawing::XShape > & rXShape ) const
{
- for ( size_t i = 0, n = maShapeList.size(); i < n; ++i )
+ for (EscherShapeListEntry* pPtr : maShapeList)
{
- EscherShapeListEntry* pPtr = maShapeList[ i ];
if ( rXShape == pPtr->aXShape )
- return ( pPtr->n_EscherId );
+ return pPtr->n_EscherId;
}
return 0;
}
@@ -4780,9 +4775,8 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm )
EscherConnectorRule aConnectorRule;
aConnectorRule.nRuleId = 2;
- for ( size_t i = 0, n = maConnectorList.size(); i < n; ++i )
+ for (EscherConnectorListEntry* pPtr : maConnectorList)
{
- EscherConnectorListEntry* pPtr = maConnectorList[ i ];
aConnectorRule.ncptiA = aConnectorRule.ncptiB = 0xffffffff;
aConnectorRule.nShapeC = GetShapeId( pPtr->mXConnector );
aConnectorRule.nShapeA = GetShapeId( pPtr->mXConnectToA );
@@ -5025,8 +5019,7 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom )
sal_uInt32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
// adjust persist table
- for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) {
- EscherPersistEntry* pPtr = maPersistTable[ i ];
+ for(EscherPersistEntry* pPtr : maPersistTable) {
sal_uInt32 nOfs = pPtr->mnOffset;
if ( nOfs >= nCurPos ) {
pPtr->mnOffset += nBytes;
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index c4b367006b8f..36192106d979 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -398,8 +398,8 @@ SvxMSDffSolverContainer::SvxMSDffSolverContainer()
SvxMSDffSolverContainer::~SvxMSDffSolverContainer()
{
- for( size_t i = 0, n = aCList.size(); i < n; ++i ) {
- delete aCList[ i ];
+ for(SvxMSDffConnectorRule* i : aCList) {
+ delete i;
}
aCList.clear();
}
diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx
index 564058d93ec2..6660d7cd0f05 100644
--- a/filter/source/msfilter/msoleexp.cxx
+++ b/filter/source/msfilter/msoleexp.cxx
@@ -161,9 +161,8 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SotSt
for( const ObjExpType* pArr = aArr; !pExpFilter && ( pArr->nFlag != 0xffff ); ++pArr )
{
- for ( int n = 0; n < 4; ++n )
+ for (const ObjExpType::GlobalNameIds& rId : pArr->aGlNmIds)
{
- const ObjExpType::GlobalNameIds& rId = pArr->aGlNmIds[ n ];
SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3,
rId.b8, rId.b9, rId.b10, rId.b11,
rId.b12, rId.b13, rId.b14, rId.b15 );
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index c43638abbd19..3a5330dca903 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -695,9 +695,9 @@ awt::KeyEvent parseKeyEvent( const OUString& Key ) throw ( uno::RuntimeException
static MSKeyCodeMap s_KeyCodes;
if ( s_KeyCodes.empty() )
{
- for ( unsigned int i = 0; i < SAL_N_ELEMENTS( aMSKeyCodesData ); ++i )
+ for (KeyCodeEntry & i : aMSKeyCodesData)
{
- s_KeyCodes[ OUString::createFromAscii( aMSKeyCodesData[ i ].sName ) ] = aMSKeyCodesData[ i ].nCode;
+ s_KeyCodes[ OUString::createFromAscii( i.sName ) ] = i.nCode;
}
}
OUString sKeyCode;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index c9e44c6fd293..437207f12503 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -298,8 +298,8 @@ SvStream& ReadPptDocumentAtom(SvStream& rIn, PptDocumentAtom& rAtom)
void PptSlideLayoutAtom::Clear()
{
eLayout = PptSlideLayout::TITLESLIDE;
- for ( sal_uInt16 i = 0; i < 8; i++ )
- aPlaceholderId[ i ] = PptPlaceholder::NONE;
+ for (PptPlaceholder & i : aPlaceholderId)
+ i = PptPlaceholder::NONE;
}
SvStream& ReadPptSlideLayoutAtom( SvStream& rIn, PptSlideLayoutAtom& rAtom )
@@ -529,8 +529,8 @@ SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const OUString&
SdrEscherImport::~SdrEscherImport()
{
- for ( size_t i = 0, n = aOleObjectList.size(); i < n; ++i )
- delete aOleObjectList[ i ];
+ for (PPTOleEntry* i : aOleObjectList)
+ delete i;
aOleObjectList.clear();
delete m_pFonts;
}
@@ -1242,9 +1242,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
if ( rPersistEntry.pSolverContainer )
{
- for ( size_t i = 0; i < rPersistEntry.pSolverContainer->aCList.size(); ++i )
+ for (SvxMSDffConnectorRule* pPtr : rPersistEntry.pSolverContainer->aCList)
{
- SvxMSDffConnectorRule* pPtr = rPersistEntry.pSolverContainer->aCList[ i ];
if ( rObjData.nShapeId == pPtr->nShapeC )
pPtr->pCObj = pRet;
else
@@ -1649,8 +1648,8 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O
SdrPowerPointImport::~SdrPowerPointImport()
{
- for ( size_t i = 0, n = aHyperList.size(); i < n; ++i ) {
- delete aHyperList[ i ];
+ for (SdHyperlinkEntry* i : aHyperList) {
+ delete i;
}
aHyperList.clear();
delete m_pMasterPages;
@@ -1813,10 +1812,8 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
}
}
- PPTOleEntry* pOe;
- for ( size_t i = 0; i < const_cast<SdrPowerPointImport*>(this)->aOleObjectList.size(); ++i )
+ for (PPTOleEntry* pOe : const_cast<SdrPowerPointImport*>(this)->aOleObjectList)
{
- pOe = const_cast<SdrPowerPointImport*>(this)->aOleObjectList[ i ];
if ( pOe->nId != (sal_uInt32)nOLEId )
continue;
@@ -3168,9 +3165,9 @@ bool PPTExtParaProv::GetGraphic( sal_uInt32 nInstance, Graphic& rGraph ) const
}
if ( !bRetValue )
{
- for (size_t i = 0; i < aBuGraList.size(); i++ )
+ for (PPTBuGraEntry* i : aBuGraList)
{
- pPtr = aBuGraList[ i ];
+ pPtr = i;
if ( pPtr->nInstance == nInstance )
{
bRetValue = true;
@@ -3333,8 +3330,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
PPTExtParaProv::~PPTExtParaProv()
{
- for ( size_t i = 0, n = aBuGraList.size(); i < n; ++i )
- delete aBuGraList[ i ];
+ for (PPTBuGraEntry* i : aBuGraList)
+ delete i;
aBuGraList.clear();
}
@@ -3766,15 +3763,15 @@ PPTCharSheet::PPTCharSheet( sal_uInt32 nInstance )
nFontHeight = 24;
break;
}
- for ( sal_uInt32 nDepth = 0; nDepth < 5; nDepth++ )
+ for (PPTCharLevel & nDepth : maCharLevel)
{
- maCharLevel[ nDepth ].mnFlags = 0;
- maCharLevel[ nDepth ].mnFont = 0;
- maCharLevel[ nDepth ].mnAsianOrComplexFont = 0xffff;
- maCharLevel[ nDepth ].mnFontHeight = nFontHeight;
- maCharLevel[ nDepth ].mnFontColor = nColor;
- maCharLevel[ nDepth ].mnFontColorInStyleSheet = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
- maCharLevel[ nDepth ].mnEscapement = 0;
+ nDepth.mnFlags = 0;
+ nDepth.mnFont = 0;
+ nDepth.mnAsianOrComplexFont = 0xffff;
+ nDepth.mnFontHeight = nFontHeight;
+ nDepth.mnFontColor = nColor;
+ nDepth.mnFontColorInStyleSheet = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
+ nDepth.mnEscapement = 0;
}
}
@@ -3855,22 +3852,22 @@ PPTParaSheet::PPTParaSheet( sal_uInt32 nInstance )
nUpperDist = 0x1e;
break;
}
- for ( sal_uInt32 i = 0; i < 5; i++ )
+ for (PPTParaLevel & i : maParaLevel)
{
- maParaLevel[ i ].mnBuFlags = nBuFlags;
- maParaLevel[ i ].mnBulletChar = 0x2022;
- maParaLevel[ i ].mnBulletFont = 0;
- maParaLevel[ i ].mnBulletHeight = 100;
- maParaLevel[ i ].mnBulletColor = nBulletColor;
- maParaLevel[ i ].mnAdjust = 0;
- maParaLevel[ i ].mnLineFeed = 100;
- maParaLevel[ i ].mnLowerDist = 0;
- maParaLevel[ i ].mnUpperDist = nUpperDist;
- maParaLevel[ i ].mnTextOfs = 0;
- maParaLevel[ i ].mnBulletOfs = 0;
- maParaLevel[ i ].mnDefaultTab = 0x240;
- maParaLevel[ i ].mnAsianLineBreak = 0;
- maParaLevel[ i ].mnBiDi = 0;
+ i.mnBuFlags = nBuFlags;
+ i.mnBulletChar = 0x2022;
+ i.mnBulletFont = 0;
+ i.mnBulletHeight = 100;
+ i.mnBulletColor = nBulletColor;
+ i.mnAdjust = 0;
+ i.mnLineFeed = 100;
+ i.mnLowerDist = 0;
+ i.mnUpperDist = nUpperDist;
+ i.mnTextOfs = 0;
+ i.mnBulletOfs = 0;
+ i.mnDefaultTab = 0x240;
+ i.mnAsianLineBreak = 0;
+ i.mnBiDi = 0;
}
}
@@ -4831,8 +4828,8 @@ bool PPTTextSpecInfoAtomInterpreter::Read( SvStream& rIn, const DffRecordHeader&
PPTTextSpecInfoAtomInterpreter::~PPTTextSpecInfoAtomInterpreter()
{
- for ( size_t i = 0, n = aList.size(); i < n; ++i ) {
- delete aList[ i ];
+ for (PPTTextSpecInfo* i : aList) {
+ delete i;
}
aList.clear();
}
@@ -6382,9 +6379,9 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
sal_uInt32 PPTParagraphObj::GetTextSize()
{
sal_uInt32 nCount, nRetValue = 0;
- for (size_t i = 0; i < m_PortionList.size(); i++)
+ for (std::unique_ptr<PPTPortionObj> & i : m_PortionList)
{
- PPTPortionObj const& rPortionObj = *m_PortionList[i];
+ PPTPortionObj const& rPortionObj = *i;
nCount = rPortionObj.Count();
if ((!nCount) && rPortionObj.mpFieldItem)
nCount++;
@@ -6701,10 +6698,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
&(rSdrPowerPointImport.pPPTStyleSheet->maTxSI) ) )
{
sal_uInt32 nI = 0;
- PPTTextSpecInfo* pSpecInfo;
- for ( size_t i = 0; i < aTextSpecInfoAtomInterpreter.aList.size(); ++i)
+ for (PPTTextSpecInfo* pSpecInfo : aTextSpecInfoAtomInterpreter.aList)
{
- pSpecInfo = aTextSpecInfoAtomInterpreter.aList[ i ];
sal_uInt32 nCharIdx = pSpecInfo->nCharIdx;
// portions and text have to been splitted in some cases
@@ -6884,9 +6879,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
PptInteractiveInfoAtom aInteractiveInfoAtom;
ReadPptInteractiveInfoAtom( rIn, aInteractiveInfoAtom );
- for ( size_t i = 0; i < rSdrPowerPointImport.aHyperList.size(); ++i )
+ for (SdHyperlinkEntry* pHyperlink : rSdrPowerPointImport.aHyperList)
{
- SdHyperlinkEntry* pHyperlink = rSdrPowerPointImport.aHyperList[ i ];
if ( pHyperlink->nIndex == aInteractiveInfoAtom.nExHyperlinkId )
{
aTextHd.SeekToEndOfRecord( rIn );
@@ -7092,8 +7086,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
n--;
}
- for( size_t j = 0, n2 = FieldList.size(); j < n2; ++j ) {
- delete FieldList[ j ];
+ for(PPTFieldEntry* j : FieldList) {
+ delete j;
}
}
mpImplTextObj->mpParagraphList = new PPTParagraphObj*[ nParagraphs ];
@@ -7696,10 +7690,8 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
// possibly connections to the group object have to be removed.
if ( pSolverContainer )
{
- for ( size_t i = 0; i < pSolverContainer->aCList.size(); ++i )
+ for (SvxMSDffConnectorRule* pPtr : pSolverContainer->aCList)
{
- SvxMSDffConnectorRule* pPtr = pSolverContainer->aCList[ i ];
-
// check connections to the group object
if ( pPtr->pAObj == pGroup )
pPtr->pAObj = nullptr;
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index 89ab37a10203..36046fbc06db 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -1184,9 +1184,9 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType )
if( pCustomShapeTypeTranslationHashMap == nullptr )
{
pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap ();
- for( unsigned int i = 0; i < SAL_N_ELEMENTS(pCustomShapeTypeTranslationTable); ++i )
+ for(const msfilter::util::CustomShapeTypeTranslationTable& i : pCustomShapeTypeTranslationTable)
{
- (*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO;
+ (*pCustomShapeTypeTranslationHashMap)[ i.sOOo ] = i.sMSO;
}
}
CustomShapeTypeTranslationHashMap::iterator i(
@@ -1204,8 +1204,8 @@ MSO_SPT GETVMLShapeType(const OString& aType)
if (!pDMLToVMLMap)
{
pDMLToVMLMap = new DMLToVMLTranslationHashMap();
- for (size_t i = 0; i < SAL_N_ELEMENTS(pDMLToVMLTable); ++i)
- (*pDMLToVMLMap)[pDMLToVMLTable[i].sDML] = pDMLToVMLTable[i].nVML;
+ for (auto& i : pDMLToVMLTable)
+ (*pDMLToVMLMap)[i.sDML] = i.nVML;
}
DMLToVMLTranslationHashMap::iterator i(pDMLToVMLMap->find(pDML));
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 47f5a1d4032a..18403f6eb978 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -575,8 +575,8 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
implRegisterInterface( rPage );
// create an id for each master page
- for( size_t i = 0; i < mMasterPageTargets.size(); ++i )
- implRegisterInterface( mMasterPageTargets[i] );
+ for(uno::Reference<drawing::XDrawPage> & mMasterPageTarget : mMasterPageTargets)
+ implRegisterInterface( mMasterPageTarget );
try
{
@@ -1132,20 +1132,17 @@ void SVGFilter::implGenerateMetaData()
}
if( mpSVGExport->IsEmbedFonts() && mpSVGExport->IsUsePositionedCharacters() )
{
- for( sal_Int32 i = 0, nSize = aFieldSet.size(); i < nSize; ++i )
+ for(TextField* i : aFieldSet)
{
- aFieldSet[i]->growCharSet( mTextFieldCharSets );
+ i->growCharSet( mTextFieldCharSets );
}
}
}
// text fields are used only for generating meta info so we don't need them anymore
- for( size_t i = 0; i < aFieldSet.size(); ++i )
+ for(TextField* i : aFieldSet)
{
- if( aFieldSet[i] != nullptr )
- {
- delete aFieldSet[i];
- }
+ delete i;
}
}
}
@@ -1157,9 +1154,9 @@ void SVGFilter::implExportAnimations()
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation-animations" );
SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
- for( size_t i = 0; i < mSelectedPages.size(); ++i )
+ for(uno::Reference<drawing::XDrawPage> & mSelectedPage : mSelectedPages)
{
- Reference< XPropertySet > xProps( mSelectedPages[i], UNO_QUERY );
+ Reference< XPropertySet > xProps( mSelectedPage, UNO_QUERY );
if( xProps.is() && xProps->getPropertySetInfo()->hasPropertyByName( "TransitionType" ) )
{
@@ -1168,7 +1165,7 @@ void SVGFilter::implExportAnimations()
// we have a slide transition ?
bool bHasEffects = ( nTransition != 0 );
- Reference< XAnimationNodeSupplier > xAnimNodeSupplier( mSelectedPages[i], UNO_QUERY );
+ Reference< XAnimationNodeSupplier > xAnimNodeSupplier( mSelectedPage, UNO_QUERY );
if( xAnimNodeSupplier.is() )
{
Reference< XAnimationNode > xRootNode = xAnimNodeSupplier->getAnimationNode();
@@ -1193,7 +1190,7 @@ void SVGFilter::implExportAnimations()
}
if( bHasEffects )
{
- OUString sId = implGetValidIDFromInterface( mSelectedPages[i] );
+ OUString sId = implGetValidIDFromInterface( mSelectedPage );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrSlide, sId );
sId += "-animations";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId );
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 2c5769ebf15f..7304a56c9077 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -258,9 +258,9 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
* The master page are put in an unordered set.
*/
ObjectSet aMasterPageTargetSet;
- for( size_t i = 0; i < mSelectedPages.size(); ++i )
+ for(uno::Reference<drawing::XDrawPage> & mSelectedPage : mSelectedPages)
{
- uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPages[i], uno::UNO_QUERY );
+ uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPage, uno::UNO_QUERY );
if( xMasterPageTarget.is() )
{
aMasterPageTargetSet.insert( xMasterPageTarget->getMasterPage() );
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index fe2912c9d618..48ebaeb21f34 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -1877,13 +1877,13 @@ struct ShapeWritingVisitor
boost::bind(&basegfx::B2DPolyPolygon::transform,
_1,boost::cref(aState.maCTM)));
- for( size_t i=0; i<aPolys.size(); ++i )
+ for(basegfx::B2DPolyPolygon & aPoly : aPolys)
{
const basegfx::B2DRange aBounds(
- aPolys[i].areControlPointsUsed() ?
+ aPoly.areControlPointsUsed() ?
basegfx::tools::getRange(
- basegfx::tools::adaptiveSubdivideByAngle(aPolys[i])) :
- basegfx::tools::getRange(aPolys[i]));
+ basegfx::tools::adaptiveSubdivideByAngle(aPoly)) :
+ basegfx::tools::getRange(aPoly));
fillShapeProperties(xAttrs,
xElem,
aBounds,
@@ -1896,10 +1896,10 @@ struct ShapeWritingVisitor
basegfx::B2DHomMatrix aNormalize;
aNormalize.translate(-aBounds.getMinX(),-aBounds.getMinY());
aNormalize.scale(2540.0/72.0,2540.0/72.0);
- aPolys[i].transform(aNormalize);
+ aPoly.transform(aNormalize);
xAttrs->AddAttribute( "svg:d", basegfx::tools::exportToSvgD(
- aPolys[i],
+ aPoly,
false, // no relative coords. causes rounding errors
false, // no quad bezier detection. crashes older versions.
false ));