cui/source/inc/optlingu.hxx     |    5 ++++-
 cui/source/options/optlingu.cxx |   12 +++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit da9b3b9dba701d23dfcbd90e454c70a7138b698a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Jun 5 16:18:50 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Jun 5 20:32:59 2020 +0200

    crash on double-clicking an entry in Available language modules
    
    tools, options, language settings, writing aids, entry in Available 
language modules
    
    Change-Id: I0146a313cfae206bc9399c964a746dd00cba0fa2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95560
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index bc12d3991daa..cbaaaefdf169 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -76,8 +76,9 @@ public:
     virtual ~SvxEditModulesDlg() override;
 };
 
-// class SvxLinguTabPage -------------------------------------------------
+struct ImplSVEvent;
 
+// class SvxLinguTabPage -------------------------------------------------
 class SvxLinguTabPage : public SfxTabPage
 {
 private:
@@ -96,6 +97,8 @@ private:
     int nUPN_HYPH_MIN_LEADING;
     int nUPN_HYPH_MIN_TRAILING;
 
+    ImplSVEvent* m_nDlbClickEventId;
+
     css::uno::Reference<
         css::linguistic2::XLinguProperties >     xProp;
 
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 296451e6a380..dd5cda2d9cf4 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -836,6 +836,7 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, 
weld::DialogController*
     , nUPN_HYPH_MIN_WORD_LENGTH(-1)
     , nUPN_HYPH_MIN_LEADING(-1)
     , nUPN_HYPH_MIN_TRAILING(-1)
+    , m_nDlbClickEventId(nullptr)
     , m_xLinguModulesFT(m_xBuilder->weld_label("lingumodulesft"))
     , m_xLinguModulesCLB(m_xBuilder->weld_tree_view("lingumodules"))
     , m_xLinguModulesEditPB(m_xBuilder->weld_button("lingumodulesedit"))
@@ -903,6 +904,11 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, 
weld::DialogController*
 
 SvxLinguTabPage::~SvxLinguTabPage()
 {
+    if (m_nDlbClickEventId)
+    {
+        Application::RemoveUserEvent(m_nDlbClickEventId);
+        m_nDlbClickEventId = nullptr;
+    }
     pLinguData.reset();
 }
 
@@ -1282,13 +1288,12 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
 
 IMPL_LINK(SvxLinguTabPage, BoxDoubleClickHdl_Impl, weld::TreeView&, rBox, bool)
 {
-    if (&rBox == m_xLinguModulesCLB.get())
+    if (&rBox == m_xLinguModulesCLB.get() && !m_nDlbClickEventId)
     {
         //! in order to avoid a bug causing a GPF when double clicking
         //! on a module entry and exiting the "Edit Modules" dialog
         //! after that.
-        Application::PostUserEvent( LINK(
-                    this, SvxLinguTabPage, PostDblClickHdl_Impl ), nullptr, 
true);
+        m_nDlbClickEventId = Application::PostUserEvent(LINK(this, 
SvxLinguTabPage, PostDblClickHdl_Impl));
     }
     else if (&rBox == m_xLinguOptionsCLB.get())
     {
@@ -1299,6 +1304,7 @@ IMPL_LINK(SvxLinguTabPage, BoxDoubleClickHdl_Impl, 
weld::TreeView&, rBox, bool)
 
 IMPL_LINK_NOARG(SvxLinguTabPage, PostDblClickHdl_Impl, void*, void)
 {
+    m_nDlbClickEventId = nullptr;
     ClickHdl_Impl(*m_xLinguModulesEditPB);
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to