From 0f54db1ce9a2d29a9f7cd0ce21de1f044df873de Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Wed, 1 Jun 2016 17:49:00 +0200 Subject: [PATCH] Simplify a bit by using return iterator from vector erase func Change-Id: I5d927171cb05a253ef8f5f8abd9af11b499f9fc0 Reviewed-on: https://gerrit.libreoffice.org/25786 Tested-by: Jenkins Reviewed-by: Julien Nabet --- xmloff/source/draw/shapeimport.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index b2614a144ea6..c6db306d632e 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -837,14 +837,11 @@ void ShapeSortContext::popGroupAndSort() sal_Int32 nIndex = 0; for (ZOrderHint& rHint : maZOrderList) { - while( nIndex < rHint.nShould && !maUnsortedList.empty() ) + for (vector::iterator aIt = maUnsortedList.begin(); aIt != maUnsortedList.end() && nIndex < rHint.nShould; ) { - auto it = maUnsortedList.begin(); + moveShape( (*aIt).nIs, nIndex++ ); + aIt = maUnsortedList.erase(aIt); - ZOrderHint aGapHint(*it); - maUnsortedList.erase(it); - - moveShape( aGapHint.nIs, nIndex++ ); } if(rHint.nIs != nIndex )