diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-04-26 13:12:37 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-05-03 22:31:56 +0200 |
commit | 358bd7bc83265efc69d275216ff714811bfa3b5e (patch) | |
tree | 8b6897d5909705ccbe508f34a26d28d01cb7209e /sw/source/core/edit/edtox.cxx | |
parent | 9fbb74b5b688eb51bf3b849e56841a00b836628c (diff) |
Use auto and range-based for loops
Change-Id: I400bce4479eb0ab8105384f88a379c3ea90b9f66
Diffstat (limited to 'sw/source/core/edit/edtox.cxx')
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 0fe3c0a1b9b6..fdc6253b9b83 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -225,7 +225,7 @@ sal_uInt16 SwEditShell::GetTOXCount() const { const SwSectionFmts& rFmts = GetDoc()->GetSections(); sal_uInt16 nRet = 0; - for( sal_uInt16 n = rFmts.size(); n; ) + for( auto n = rFmts.size(); n; ) { const SwSection* pSect = rFmts[ --n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && @@ -238,9 +238,10 @@ sal_uInt16 SwEditShell::GetTOXCount() const const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const { const SwSectionFmts& rFmts = GetDoc()->GetSections(); - for( sal_uInt16 n = 0, nCnt = 0; n < rFmts.size(); ++n ) + sal_uInt16 nCnt {0}; + for( const SwSectionFmt *pFmt : rFmts ) { - const SwSection* pSect = rFmts[ n ]->GetSection(); + const SwSection* pSect = pFmt->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode() && nCnt++ == nPos ) @@ -292,9 +293,8 @@ void SwEditShell::ApplyAutoMark() SwTOXMarks aMarks; SwTOXMark::InsertTOXMarks( aMarks, *pTOXType ); - for( sal_uInt16 nMark=0; nMark<aMarks.size(); nMark++ ) + for( SwTOXMark* pMark : aMarks ) { - SwTOXMark* pMark = aMarks[nMark]; if(pMark->IsAutoGenerated() && pMark->GetTxtTOXMark()) // mba: test iteration; objects are deleted in iteration DeleteTOXMark(pMark); |