[Libreoffice-commits] core.git: sc/source
Caolán McNamara
caolanm at redhat.com
Thu Jun 5 08:41:46 PDT 2014
sc/source/ui/condformat/condformatdlg.cxx | 10 ++++++++++
sc/source/ui/inc/condformatdlg.hxx | 1 +
2 files changed, 11 insertions(+)
New commits:
commit b0a9f33a9b3018dcfb471641bde7c29a6e62f394
Author: Caolán McNamara <caolanm at 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
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 4f12df3..9c0a6d9 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 60c7763..12b522f 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*);
};
More information about the Libreoffice-commits
mailing list