Simplify a bit by using return iterator from vector erase func

Change-Id: I5d927171cb05a253ef8f5f8abd9af11b499f9fc0
Reviewed-on: https://gerrit.libreoffice.org/25786
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2016-06-01 17:49:00 +02:00
parent cdf3a3907e
commit 0f54db1ce9

View File

@@ -837,14 +837,11 @@ void ShapeSortContext::popGroupAndSort()
sal_Int32 nIndex = 0;
for (ZOrderHint& rHint : maZOrderList)
{
while( nIndex < rHint.nShould && !maUnsortedList.empty() )
for (vector<ZOrderHint>::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 )