sc/source/ui/condformat/condformatdlg.cxx | 10 ++++++++++ sc/source/ui/inc/condformatdlg.hxx | 1 + 2 files changed, 11 insertions(+)
New commits: commit 460d2ffa8dd461f41f1fc77596ee0578e8ea6731 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 5 16:41:02 2014 +0100 Resolves: fdo#79021 cannot delete ListBox from inside its own Select handler Change-Id: I884e617b112397697a702216b62d0c1e17aae536 (cherry picked from commit b0a9f33a9b3018dcfb471641bde7c29a6e62f394) (cherry picked from commit 268c4907a04959ca546c5e2ecf469d4d297293b9) Reviewed-on: https://gerrit.libreoffice.org/9656 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 907c1b6..2f5e6f8 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -235,6 +235,16 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox) IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox) { + //Resolves: fdo#79021 At this point we are still inside the ListBox Select. + //If we call maEntries.replace here then the pBox will be deleted before it + //has finished Select and will crash on accessing its deleted this. So Post + //to do the real work after the Select has completed + Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), pBox); + return 0; +} + +IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox) +{ EntryContainer::iterator itr = maEntries.begin(); for(; itr != maEntries.end(); ++itr) { diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 6baf33d..721397a 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -79,6 +79,7 @@ public: DECL_LINK( EntrySelectHdl, ScCondFrmtEntry* ); DECL_LINK( TypeListHdl, ListBox*); + DECL_LINK( AfterTypeListHdl, ListBox*); DECL_LINK( ColFormatTypeHdl, ListBox*); };
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits