summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-08-25 22:20:16 +0200
committerThorsten Behrens <tbehrens@suse.com>2013-08-27 15:57:53 +0000
commit2729009dcfa1bc4a4a0f5547fff1b75b5ff9fecb (patch)
tree25cc79e4713eaef3e00432b097886b69d99af9b9
parent31fbd9d8b65c7eb9ad618fd68f331a32760c468e (diff)
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> Reviewed-on: https://gerrit.libreoffice.org/5638 Reviewed-by: Thorsten Behrens <tbehrens@suse.com> Tested-by: Thorsten Behrens <tbehrens@suse.com>
-rw-r--r--sw/source/core/docnode/ndcopy.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index deefc128203d..f444c47fcf54 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,