diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-11-14 00:57:07 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-14 09:58:55 +0100 |
commit | 25622f29b4003307d2ba780ff1232d8b7cdafa35 (patch) | |
tree | ad15c747685e803deeb5fffd209ae0b5992ac87a /sw/source/core/docnode/ndcopy.cxx | |
parent | 638d619866784510dcbf0cadb6eb251208489a73 (diff) |
Simplify containers iterations in sw/source/core/[d-l]*
Use range-based loop or replace with STL functions
Change-Id: I143e9a769e1c1bb0228933a0a92150f00e3e1f20
Reviewed-on: https://gerrit.libreoffice.org/63347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/docnode/ndcopy.cxx')
-rw-r--r-- | sw/source/core/docnode/ndcopy.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index f323f0a8ea58..88d2cef844c7 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -140,8 +140,8 @@ static void lcl_CopyTableLine( const SwTableLine* pLine, CopyTable* pCT ); static void lcl_CopyTableBox( SwTableBox* pBox, CopyTable* pCT ) { SwTableBoxFormat * pBoxFormat = static_cast<SwTableBoxFormat*>(pBox->GetFrameFormat()); - for (MapTableFrameFormats::const_iterator it = pCT->m_rMapArr.begin(); it != pCT->m_rMapArr.end(); ++it) - if ( !lcl_SrchNew( *it, reinterpret_cast<SwFrameFormat**>(&pBoxFormat) ) ) + for (const auto& rMap : pCT->m_rMapArr) + if ( !lcl_SrchNew( rMap, reinterpret_cast<SwFrameFormat**>(&pBoxFormat) ) ) break; if (pBoxFormat == pBox->GetFrameFormat()) // Create a new one? @@ -205,8 +205,8 @@ static void lcl_CopyTableBox( SwTableBox* pBox, CopyTable* pCT ) static void lcl_CopyTableLine( const SwTableLine* pLine, CopyTable* pCT ) { SwTableLineFormat * pLineFormat = static_cast<SwTableLineFormat*>(pLine->GetFrameFormat()); - for (MapTableFrameFormats::const_iterator it = pCT->m_rMapArr.begin(); it != pCT->m_rMapArr.end(); ++it) - if ( !lcl_SrchNew( *it, reinterpret_cast<SwFrameFormat**>(&pLineFormat) ) ) + for (const auto& rMap : pCT->m_rMapArr) + if ( !lcl_SrchNew( rMap, reinterpret_cast<SwFrameFormat**>(&pLineFormat) ) ) break; if( pLineFormat == pLine->GetFrameFormat() ) // Create a new one? @@ -228,9 +228,8 @@ static void lcl_CopyTableLine( const SwTableLine* pLine, CopyTable* pCT ) } pCT->m_pInsLine = pNewLine; - for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(pLine)->GetTabBoxes().begin(); - it != const_cast<SwTableLine*>(pLine)->GetTabBoxes().end(); ++it) - lcl_CopyTableBox(*it, pCT ); + for( auto& rpBox : const_cast<SwTableLine*>(pLine)->GetTabBoxes() ) + lcl_CopyTableBox(rpBox, pCT); } SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const |