From 8eef10a5fd6ce6373fb54ee3d9ab053c997d2785 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 12 Mar 2016 01:43:09 +0100 Subject: Let's use the iterator return by erase method (part b) std::list seems ok but let's try for std::set and std::multiset Change-Id: I1d4875468517c732680ba98ac9f2e08d1baa61bd Reviewed-on: https://gerrit.libreoffice.org/23161 Tested-by: Jenkins Reviewed-by: Julien Nabet --- configmgr/source/components.cxx | 2 +- sw/source/core/text/blink.cxx | 2 +- sw/source/core/unocore/unoportenum.cxx | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 3f94a8d39917..3ba26407b4b3 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -774,7 +774,7 @@ void Components::parseXcdFiles(int layer, OUString const & url) { for (UnresolvedList::iterator i(unres.begin()); i != unres.end();) { if (i->manager->parse(&existingDeps)) { processedDeps.insert(i->name); - unres.erase(i++); + i = unres.erase(i); isResolved = true; } else { ++i; diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx index 9588973deec3..4fd56d2a1c5a 100644 --- a/sw/source/core/text/blink.cxx +++ b/sw/source/core/text/blink.cxx @@ -166,7 +166,7 @@ void SwBlink::FrameDelete( const SwRootFrame* pRoot ) for (SwBlinkSet::iterator it = m_List.begin(); it != m_List.end(); ) { if (pRoot == (*it)->GetRootFrame()) - m_List.erase( it++ ); + it = m_List.erase(it); else ++it; } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index c1aad4c5c094..e7cec35e48e9 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -617,7 +617,7 @@ static void lcl_ExportBookmark( SwXBookmarkPortion_ImplSharedPtr pPtr = (*aIter); if ( nIndex > pPtr->getIndex() ) { - rBkmArr.erase( aIter++ ); + aIter = rBkmArr.erase(aIter); continue; } if ( nIndex < pPtr->getIndex() ) @@ -641,7 +641,7 @@ static void lcl_ExportBookmark( rPortions.push_back(pPortion); pPortion->SetBookmark(pPtr->xBookmark); } - rBkmArr.erase( aIter++ ); + aIter = rBkmArr.erase(aIter); } } @@ -658,7 +658,7 @@ static void lcl_ExportSoftPageBreak( { if ( nIndex > *aIter ) { - rBreakArr.erase( aIter++ ); + aIter = rBreakArr.erase(aIter); continue; } if ( nIndex < *aIter ) @@ -666,7 +666,7 @@ static void lcl_ExportSoftPageBreak( rPortions.push_back( new SwXTextPortion(pUnoCursor, xParent, PORTION_SOFT_PAGEBREAK) ); - rBreakArr.erase( aIter++ ); + aIter = rBreakArr.erase(aIter); } } @@ -1113,13 +1113,13 @@ static void lcl_ExportRedline( sal_Int32 nRealIndex = pPtr->getRealIndex(); // MTG: 23/11/05: If there are elements before nIndex, remove them if ( nIndex > nRealIndex ) - rRedlineArr.erase ( aIter++ ); + aIter = rRedlineArr.erase(aIter); // MTG: 23/11/05: If the elements match, and them to the list else if ( nIndex == nRealIndex ) { rPortions.push_back( new SwXRedlinePortion( *pPtr->m_pRedline, pUnoCursor, xParent, pPtr->m_bStart)); - rRedlineArr.erase ( aIter++ ); + aIter = rRedlineArr.erase(aIter); } // MTG: 23/11/05: If we've iterated past nIndex, exit the loop else @@ -1161,7 +1161,7 @@ static void lcl_ExportAnnotationStarts( SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter); if ( nIndex > pPtr->getIndex() ) { - rAnnotationStartArr.erase( aIter++ ); + aIter = rAnnotationStartArr.erase(aIter); continue; } if ( pPtr->getIndex() > nIndex ) @@ -1174,7 +1174,7 @@ static void lcl_ExportAnnotationStarts( pPortion->SetTextField( pPtr->mxAnnotationField ); rPortions.push_back(pPortion); - rAnnotationStartArr.erase( aIter++ ); + aIter = rAnnotationStartArr.erase(aIter); } } } -- cgit