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:42:06 +0100 |
commit | 268c4907a04959ca546c5e2ecf469d4d297293b9 (patch) | |
tree | 6eca199227d129de9c7a06ef3b4a0e714060d87a | |
parent | 95d9e0641197164fedd2e89d40f5eb9607f87fc3 (diff) |
Resolves: fdo#79021 cannot delete ListBox from inside its own Select handler
Change-Id: I884e617b112397697a702216b62d0c1e17aae536
(cherry picked from commit b0a9f33a9b3018dcfb471641bde7c29a6e62f394)
-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*); }; |