From 7cfbe5ad4fa351228c4764d9a7231024a97212c4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 17 Jan 2017 13:15:00 +0200 Subject: fix bug in SfxItemSet::ClearItem resulting from commit 2757ee9fe610e253e4ccc37423fa420004d0f388 used std::map in SfxItemSet where I failed to notice that the nWhich parameter was being re-used as a loop variable. This bug was spotted by Jochen Nitschke Change-Id: Ifb43dfb84261ecbcf88e5b312b8ec24cf7c3dce9 --- svl/source/items/itemset.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 5de52ce8c8dc..468ecb75f06d 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -292,8 +292,8 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) aTmp.swap(m_aItems); for (auto & rPair : aTmp) { - // Due to the assertions in the sub calls, we need to do this const SfxPoolItem *pItemToClear = rPair.second; + nWhich = rPair.first; if ( !IsInvalidItem(pItemToClear) ) { -- cgit