diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-05 16:41:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-05 16:41:02 +0100 |
commit | b0a9f33a9b3018dcfb471641bde7c29a6e62f394 (patch) | |
tree | b9400daea61c8b148b29fdbd143a0e2399b4ac61 | |
parent | 1268a6f8752dd0f1cb78557244b324aaed6461eb (diff) |
Resolves: fdo#79021 cannot delete ListBox from inside its own Select handler
Change-Id: I884e617b112397697a702216b62d0c1e17aae536
-rw-r--r-- | sc/source/ui/condformat/condformatdlg.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 4f12df30bcab..9c0a6d9de25a 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -266,6 +266,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 60c7763df402..12b522ff67c9 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -85,6 +85,7 @@ public: DECL_LINK( EntrySelectHdl, ScCondFrmtEntry* ); DECL_LINK( TypeListHdl, ListBox*); + DECL_LINK( AfterTypeListHdl, ListBox*); DECL_LINK( ColFormatTypeHdl, ListBox*); }; |