[Libreoffice-commits] core.git: sw/source

Julien Nabet serval2412 at yahoo.fr
Sun Dec 3 22:55:27 UTC 2017


 sw/source/core/frmedt/fecopy.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit bf3f6b7cf952db4d1dee75daeeda218978f6af54
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Dec 3 21:00:26 2017 +0100

    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 at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

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


More information about the Libreoffice-commits mailing list