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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 12 18:03:35 UTC 2020


 vcl/source/treelist/svimpbox.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 7dadf3db348ea1e38be7f58697852f6d775bc710
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 11 20:03:36 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jun 12 20:02:57 2020 +0200

    allow hover-select to unselect when mouse outside treeview
    
    Change-Id: Id991d4c3cdbb6a97c0024430bbff9ccbb29a2d52
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96165
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index dbccbf3a17ca..bf54f1dcc7ae 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -2059,12 +2059,18 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
 
 void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
 {
-    SvTreeListEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
+    Point aPos = rMEvt.GetPosPixel();
+    SvTreeListEntry* pEntry = GetClickedEntry(aPos);
     if ( !MouseMoveCheckCtrl( rMEvt, pEntry ) && ( m_aSelEng.GetSelectionMode() != SelectionMode::NONE ) )
     {
         m_aSelEng.SelMouseMove(rMEvt);
-        if (m_pView->mbHoverSelection && !m_pView->IsSelected(pEntry) && IsSelectable(pEntry))
-            m_pView->Select(pEntry);
+        if (m_pView->mbHoverSelection)
+        {
+            if (aPos.X() < 0 || aPos.Y() < 0 || aPos.X() > m_aOutputSize.Width() || aPos.Y() > m_aOutputSize.Height())
+                m_pView->SelectAll(false);
+            else if (!m_pView->IsSelected(pEntry) && IsSelectable(pEntry))
+                m_pView->Select(pEntry);
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list