[Libreoffice-commits] core.git: sw/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Sat May 2 18:26:02 UTC 2020


 sw/source/uibase/utlui/content.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 9ba0df5d3ccb71acd912507ee0e9e4f3ab4a9b12
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Sun Apr 26 23:23:30 2020 -0800
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat May 2 20:25:30 2020 +0200

    Resolves: tdf#132477 Fix Writer Navigator drag and drop crash
    
    Dont allow drag and drop when tree root is selected
    
    Change-Id: Ia5b8c07861c4ac9b0e4632ccc09e1cd9211e2a8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92962
    Tested-by: Jenkins
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index d940f90b1637..87ae08cfcecb 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -927,6 +927,14 @@ IMPL_LINK(SwContentTree, DragBeginHdl, bool&, rUnsetDragIcon, bool)
 
     bool bDisallow = true;
 
+    // don't allow if tree root is selected
+    std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator());
+    bool bEntry = m_xTreeView->get_selected(xEntry.get());
+    if (!bEntry || lcl_IsContentType(*xEntry, *m_xTreeView))
+    {
+        return true; // disallow
+    }
+
     rtl::Reference<TransferDataContainer> xContainer = new TransferDataContainer;
     sal_Int8 nDragMode = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
 
@@ -940,10 +948,6 @@ IMPL_LINK(SwContentTree, DragBeginHdl, bool&, rUnsetDragIcon, bool)
 
         std::unique_ptr<weld::TreeIter> xScratch(m_xTreeView->make_iterator());
 
-        std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator());
-        bool bEntry = m_xTreeView->get_selected(xEntry.get());
-        if (!bEntry)
-            return true; // disallow
         // Find first selected of continuous siblings
         while (true)
         {


More information about the Libreoffice-commits mailing list