Kaydet (Commit) bf3f6b7c authored tarafından Julien Nabet's avatar Julien Nabet

Replace list by vector in fecopy (sw)

+ use for-range loop

Change-Id: Ib2d9d5208cbb884e000fad5e56fe4f17bfcd3a61
Reviewed-on: https://gerrit.libreoffice.org/45755Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 21d45e8b
...@@ -727,7 +727,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) ...@@ -727,7 +727,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc )
if( pClpDoc->IsColumnSelection() && !IsTableMode() ) if( pClpDoc->IsColumnSelection() && !IsTableMode() )
{ {
// Creation of the list of insert positions // Creation of the list of insert positions
std::list< Insertion > aCopyList; std::vector< Insertion > aCopyVector;
// The number of text portions of the rectangular selection // The number of text portions of the rectangular selection
const sal_uInt32 nSelCount = aCpyPam.GetPoint()->nNode.GetIndex() const sal_uInt32 nSelCount = aCpyPam.GetPoint()->nNode.GetIndex()
- aCpyPam.GetMark()->nNode.GetIndex(); - aCpyPam.GetMark()->nNode.GetIndex();
...@@ -786,7 +786,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) ...@@ -786,7 +786,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc )
else else
aInsertion.first->GetPoint()->nContent = aInsertion.first->GetPoint()->nContent =
aInsertion.first->GetContentNode()->Len(); aInsertion.first->GetContentNode()->Len();
aCopyList.push_back( aInsertion ); aCopyVector.push_back( aInsertion );
} }
// If there are no text portions left but there are some more // If there are no text portions left but there are some more
// cursor positions to fill we have to restart with the first // cursor positions to fill we have to restart with the first
...@@ -797,12 +797,10 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) ...@@ -797,12 +797,10 @@ bool SwFEShell::Paste( SwDoc* pClpDoc )
aIdx = aClpIdx; // Start of clipboard content aIdx = aClpIdx; // Start of clipboard content
} }
} }
std::list< Insertion >::const_iterator pCurr = aCopyList.begin(); for (auto const& item : aCopyVector)
std::list< Insertion >::const_iterator pEnd = aCopyList.end();
while( pCurr != pEnd )
{ {
SwPosition& rInsPos = *pCurr->second; SwPosition& rInsPos = *item.second;
SwPaM& rCopy = *pCurr->first; SwPaM& rCopy = *item.first;
const SwStartNode* pBoxNd = rInsPos.nNode.GetNode().FindTableBoxStartNode(); const SwStartNode* pBoxNd = rInsPos.nNode.GetNode().FindTableBoxStartNode();
if( pBoxNd && 2 == pBoxNd->EndOfSectionIndex() - pBoxNd->GetIndex() && if( pBoxNd && 2 == pBoxNd->EndOfSectionIndex() - pBoxNd->GetIndex() &&
rCopy.GetPoint()->nNode != rCopy.GetMark()->nNode ) rCopy.GetPoint()->nNode != rCopy.GetMark()->nNode )
...@@ -823,7 +821,6 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) ...@@ -823,7 +821,6 @@ bool SwFEShell::Paste( SwDoc* pClpDoc )
} }
} }
SaveTableBoxContent( &rInsPos ); SaveTableBoxContent( &rInsPos );
++pCurr;
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment