summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 8e952d7c35de..37bf0b2bb4aa 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -380,10 +380,11 @@ IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl, Button*, void )
{
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- if((*itr)->IsSelected())
+ auto widget = *itr;
+ if (widget->IsSelected())
{
- itr->disposeAndClear();
maEntries.erase(itr);
+ widget.disposeAndClear();
break;
}
}