diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-08-25 22:20:16 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-08-26 21:04:51 +0000 |
commit | 87cf1b730e771f18d5f0a110b98ffab6494d3b25 (patch) | |
tree | c66afef6e9ac4d9033cab5fe618ba36d1c47b55c /sw | |
parent | Resolves: fdo#59048 crash on text-to-table undo (diff) | |
download | core-87cf1b730e771f18d5f0a110b98ffab6494d3b25.tar.gz core-87cf1b730e771f18d5f0a110b98ffab6494d3b25.zip |
Fix iterator management
Change-Id: Ifb230525d3f5462553a3e78bb4ee740f6a7cc5c2
Reviewed-on: https://gerrit.libreoffice.org/5629
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/ndcopy.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index a23d4eb696ed..fe9201befc03 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -1469,8 +1469,9 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, // They are stored as matching the originals, so that we will be later // able to build the chains accordingly. ::std::vector< SwFrmFmt* > aVecSwFrmFmt; + ::std::set< _ZSortFly >::const_iterator it=aSet.begin(); - for (::std::set< _ZSortFly >::const_iterator it=aSet.begin() ; it != aSet.end(); ++it ) + while (it != aSet.end()) { // #i59964# // correct determination of new anchor position @@ -1570,7 +1571,9 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, rStartIdx.GetIndex() < pSNd->EndOfSectionIndex() ) { bMakeCpy = false; - aSet.erase ( it ); + ::std::set< _ZSortFly >::const_iterator it_erase=it++; + aSet.erase (it_erase); + continue; } } @@ -1578,6 +1581,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, if( bMakeCpy ) aVecSwFrmFmt.push_back( pDest->CopyLayoutFmt( *(*it).GetFmt(), aAnchor, false, true ) ); + ++it; } // Rebuild as much as possible of all chains that are available in the original, |