diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-12-03 21:00:26 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-12-03 23:54:26 +0100 |
commit | bf3f6b7cf952db4d1dee75daeeda218978f6af54 (patch) | |
tree | d4ed5fc794f627933c607dd2fdff67916b325cf8 /sw | |
parent | 21d45e8b6186a0a9978aa6904b7eff221ac7abf0 (diff) |
Replace list by vector in fecopy (sw)
+ use for-range loop
Change-Id: Ib2d9d5208cbb884e000fad5e56fe4f17bfcd3a61
Reviewed-on: https://gerrit.libreoffice.org/45755
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 4c465df866c6..f6be7c2e167a 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -727,7 +727,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) if( pClpDoc->IsColumnSelection() && !IsTableMode() ) { // Creation of the list of insert positions - std::list< Insertion > aCopyList; + std::vector< Insertion > aCopyVector; // The number of text portions of the rectangular selection const sal_uInt32 nSelCount = aCpyPam.GetPoint()->nNode.GetIndex() - aCpyPam.GetMark()->nNode.GetIndex(); @@ -786,7 +786,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) else aInsertion.first->GetPoint()->nContent = aInsertion.first->GetContentNode()->Len(); - aCopyList.push_back( aInsertion ); + aCopyVector.push_back( aInsertion ); } // If there are no text portions left but there are some more // cursor positions to fill we have to restart with the first @@ -797,12 +797,10 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) aIdx = aClpIdx; // Start of clipboard content } } - std::list< Insertion >::const_iterator pCurr = aCopyList.begin(); - std::list< Insertion >::const_iterator pEnd = aCopyList.end(); - while( pCurr != pEnd ) + for (auto const& item : aCopyVector) { - SwPosition& rInsPos = *pCurr->second; - SwPaM& rCopy = *pCurr->first; + SwPosition& rInsPos = *item.second; + SwPaM& rCopy = *item.first; const SwStartNode* pBoxNd = rInsPos.nNode.GetNode().FindTableBoxStartNode(); if( pBoxNd && 2 == pBoxNd->EndOfSectionIndex() - pBoxNd->GetIndex() && rCopy.GetPoint()->nNode != rCopy.GetMark()->nNode ) @@ -823,7 +821,6 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) } } SaveTableBoxContent( &rInsPos ); - ++pCurr; } } else |