[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - cui/source sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 9 07:54:17 UTC 2020


 cui/source/inc/optlingu.hxx       |    5 ++++-
 cui/source/options/optlingu.cxx   |   12 +++++++++---
 sw/source/uibase/uiview/pview.cxx |    5 +++--
 3 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 72a2704ffab0301f6d39cfe99c2a08a670cc211e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 5 16:18:50 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 9 09:53:42 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/+/95564
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index d4d568708bea..b389733b1651 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -75,8 +75,9 @@ public:
     virtual ~SvxEditModulesDlg() override;
 };
 
-// class SvxLinguTabPage -------------------------------------------------
+struct ImplSVEvent;
 
+// class SvxLinguTabPage -------------------------------------------------
 class SvxLinguTabPage : public SfxTabPage
 {
 private:
@@ -95,6 +96,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 2026c73826a9..419b93b9d1bd 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -826,6 +826,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"))
@@ -893,6 +894,11 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, weld::DialogController*
 
 SvxLinguTabPage::~SvxLinguTabPage()
 {
+    if (m_nDlbClickEventId)
+    {
+        Application::RemoveUserEvent(m_nDlbClickEventId);
+        m_nDlbClickEventId = nullptr;
+    }
     pLinguData.reset();
 }
 
@@ -1272,13 +1278,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())
     {
@@ -1289,6 +1294,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);
 }
 
commit 2e935e32200e70ac2f9956171224b69855fdca0d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 5 08:46:02 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 9 09:53:35 2020 +0200

    rhbz#1844263 unchecked nullptr return from SfxViewFrame::Current()
    
    Change-Id: Id3474f82ef1e52051ccf02d2cfefaf43c8c5ec34
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95554
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 3e93705806f3..c8a3c398b46b 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1159,8 +1159,9 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
     SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Printpreview));
     SfxShell::BroadcastContextForActivation(true);
     //removelisteners for notebookbar
-    if (auto& pBar = SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar())
-        pBar->ControlListenerForCurrentController(false);
+    if (SfxViewFrame* pCurrent = SfxViewFrame::Current())
+        if (auto& pBar = pCurrent->GetWindow().GetSystemWindow()->GetNotebookBar())
+            pBar->ControlListenerForCurrentController(false);
 
     SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
     if ( !pOldSh )


More information about the Libreoffice-commits mailing list