From efc4761686b9c566d9a45fb9ab3984d7704603ba Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Fri, 26 Apr 2013 22:15:35 +0200 Subject: Fixed crash on deleting custom slide show Create a custom slide show in Impress, attempt to delete it -> crash STL vector::erase returns an iterator pointing to the next element i.e. not the element we want to remove, evtl. invalid end iterator Change-Id: Ie3758fc1ae5fc5f2a934cd8bed3de4e84a0b841b --- sd/source/ui/dlg/custsdlg.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 8eedbf141e89..8019f4304123 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -165,7 +165,8 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) sal_uInt16 nPos = m_pLbCustomShows->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - delete *pCustomShowList->erase( pCustomShowList->begin() + nPos ); + delete (*pCustomShowList)[nPos]; + pCustomShowList->erase( pCustomShowList->begin() + nPos ); m_pLbCustomShows->RemoveEntry( nPos ); m_pLbCustomShows->SelectEntryPos( nPos == 0 ? nPos : nPos - 1 ); bModified = sal_True; -- cgit