diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2016-06-01 17:49:00 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2016-07-07 19:02:29 +0000 |
commit | 0f54db1ce9a2d29a9f7cd0ce21de1f044df873de (patch) | |
tree | 959079645ef322ba6b125fb48904dda7e6cd96a4 /xmloff | |
parent | cdf3a3907e19111bc602f9697b2c158cd32adb23 (diff) |
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>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 9 |
1 files 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<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 ) |