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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 30 17:22:42 UTC 2020


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

New commits:
commit b1a6c0355a5a8fc6f9cca0bbaa32f9fdd2b84495
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 11 20:03:36 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Nov 30 18:22:05 2020 +0100

    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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106879
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index 75b482ecaa0b..e56932047df0 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -2091,9 +2091,19 @@ 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 );
+    {
+        m_aSelEng.SelMouseMove(rMEvt);
+        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);
+        }
+    }
 }
 
 void SvImpLBox::ExpandAll()


More information about the Libreoffice-commits mailing list