Kaydet (Commit) 8eef10a5 authored tarafından Julien Nabet's avatar Julien Nabet

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/23161Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 682da401
...@@ -774,7 +774,7 @@ void Components::parseXcdFiles(int layer, OUString const & url) { ...@@ -774,7 +774,7 @@ void Components::parseXcdFiles(int layer, OUString const & url) {
for (UnresolvedList::iterator i(unres.begin()); i != unres.end();) { for (UnresolvedList::iterator i(unres.begin()); i != unres.end();) {
if (i->manager->parse(&existingDeps)) { if (i->manager->parse(&existingDeps)) {
processedDeps.insert(i->name); processedDeps.insert(i->name);
unres.erase(i++); i = unres.erase(i);
isResolved = true; isResolved = true;
} else { } else {
++i; ++i;
......
...@@ -166,7 +166,7 @@ void SwBlink::FrameDelete( const SwRootFrame* pRoot ) ...@@ -166,7 +166,7 @@ void SwBlink::FrameDelete( const SwRootFrame* pRoot )
for (SwBlinkSet::iterator it = m_List.begin(); it != m_List.end(); ) for (SwBlinkSet::iterator it = m_List.begin(); it != m_List.end(); )
{ {
if (pRoot == (*it)->GetRootFrame()) if (pRoot == (*it)->GetRootFrame())
m_List.erase( it++ ); it = m_List.erase(it);
else else
++it; ++it;
} }
......
...@@ -617,7 +617,7 @@ static void lcl_ExportBookmark( ...@@ -617,7 +617,7 @@ static void lcl_ExportBookmark(
SwXBookmarkPortion_ImplSharedPtr pPtr = (*aIter); SwXBookmarkPortion_ImplSharedPtr pPtr = (*aIter);
if ( nIndex > pPtr->getIndex() ) if ( nIndex > pPtr->getIndex() )
{ {
rBkmArr.erase( aIter++ ); aIter = rBkmArr.erase(aIter);
continue; continue;
} }
if ( nIndex < pPtr->getIndex() ) if ( nIndex < pPtr->getIndex() )
...@@ -641,7 +641,7 @@ static void lcl_ExportBookmark( ...@@ -641,7 +641,7 @@ static void lcl_ExportBookmark(
rPortions.push_back(pPortion); rPortions.push_back(pPortion);
pPortion->SetBookmark(pPtr->xBookmark); pPortion->SetBookmark(pPtr->xBookmark);
} }
rBkmArr.erase( aIter++ ); aIter = rBkmArr.erase(aIter);
} }
} }
...@@ -658,7 +658,7 @@ static void lcl_ExportSoftPageBreak( ...@@ -658,7 +658,7 @@ static void lcl_ExportSoftPageBreak(
{ {
if ( nIndex > *aIter ) if ( nIndex > *aIter )
{ {
rBreakArr.erase( aIter++ ); aIter = rBreakArr.erase(aIter);
continue; continue;
} }
if ( nIndex < *aIter ) if ( nIndex < *aIter )
...@@ -666,7 +666,7 @@ static void lcl_ExportSoftPageBreak( ...@@ -666,7 +666,7 @@ static void lcl_ExportSoftPageBreak(
rPortions.push_back( rPortions.push_back(
new SwXTextPortion(pUnoCursor, xParent, PORTION_SOFT_PAGEBREAK) ); new SwXTextPortion(pUnoCursor, xParent, PORTION_SOFT_PAGEBREAK) );
rBreakArr.erase( aIter++ ); aIter = rBreakArr.erase(aIter);
} }
} }
...@@ -1113,13 +1113,13 @@ static void lcl_ExportRedline( ...@@ -1113,13 +1113,13 @@ static void lcl_ExportRedline(
sal_Int32 nRealIndex = pPtr->getRealIndex(); sal_Int32 nRealIndex = pPtr->getRealIndex();
// MTG: 23/11/05: If there are elements before nIndex, remove them // MTG: 23/11/05: If there are elements before nIndex, remove them
if ( nIndex > nRealIndex ) if ( nIndex > nRealIndex )
rRedlineArr.erase ( aIter++ ); aIter = rRedlineArr.erase(aIter);
// MTG: 23/11/05: If the elements match, and them to the list // MTG: 23/11/05: If the elements match, and them to the list
else if ( nIndex == nRealIndex ) else if ( nIndex == nRealIndex )
{ {
rPortions.push_back( new SwXRedlinePortion( rPortions.push_back( new SwXRedlinePortion(
*pPtr->m_pRedline, pUnoCursor, xParent, pPtr->m_bStart)); *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 // MTG: 23/11/05: If we've iterated past nIndex, exit the loop
else else
...@@ -1161,7 +1161,7 @@ static void lcl_ExportAnnotationStarts( ...@@ -1161,7 +1161,7 @@ static void lcl_ExportAnnotationStarts(
SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter); SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter);
if ( nIndex > pPtr->getIndex() ) if ( nIndex > pPtr->getIndex() )
{ {
rAnnotationStartArr.erase( aIter++ ); aIter = rAnnotationStartArr.erase(aIter);
continue; continue;
} }
if ( pPtr->getIndex() > nIndex ) if ( pPtr->getIndex() > nIndex )
...@@ -1174,7 +1174,7 @@ static void lcl_ExportAnnotationStarts( ...@@ -1174,7 +1174,7 @@ static void lcl_ExportAnnotationStarts(
pPortion->SetTextField( pPtr->mxAnnotationField ); pPortion->SetTextField( pPtr->mxAnnotationField );
rPortions.push_back(pPortion); rPortions.push_back(pPortion);
rAnnotationStartArr.erase( aIter++ ); aIter = rAnnotationStartArr.erase(aIter);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment