diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2016-03-12 01:43:09 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2016-03-12 08:24:56 +0000 |
commit | 8eef10a5fd6ce6373fb54ee3d9ab053c997d2785 (patch) | |
tree | ac885cee4cc8515681b33ee818456bc0c3c84848 /sw | |
parent | 682da4010b45cbb3268ea8b2b3da455bca413acd (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/blink.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 16 |
2 files changed, 9 insertions, 9 deletions
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); } } } |