From c184e054d736ff1c87d2fcefb7ea9faee3d8fe9c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 22 Feb 2015 22:39:36 +0100 Subject: [PATCH] Simplify erase iterator management (charmap.cxx) Change-Id: I36b4b9895e83007d3b1f9ea4463a97c0fdd9a341 --- svx/source/dialog/charmap.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 321786584d3f..5da4f6e3b248 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -1577,17 +1577,18 @@ void SubsetMap::ApplyCharMap( const FontCharMapPtr pFontCharMap ) return; // remove subsets that are not matched in any range - SubsetList::iterator it_next = maSubsets.begin(); - while( it_next != maSubsets.end() ) + SubsetList::iterator it = maSubsets.begin(); + while( it != maSubsets.end() ) { - SubsetList::iterator it = it_next++; const Subset& rSubset = *it; sal_uInt32 cMin = rSubset.GetRangeMin(); sal_uInt32 cMax = rSubset.GetRangeMax(); int nCount = pFontCharMap->CountCharsInRange( cMin, cMax ); if( nCount <= 0 ) - maSubsets.erase( it ); + it = maSubsets.erase(it); + else + ++it; } } -- 2.11.4.GIT