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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 4 08:29:53 UTC 2019


 vcl/source/window/seleng.cxx |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 59c15729bdd6b3fb15f66ad9f3cb96292fd0eba9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Apr 3 15:14:55 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Apr 4 10:29:24 2019 +0200

    SelectionEngine::ReleaseMouse checks for null pWin
    
    Change-Id: I80e6a304d07fcc290e73e6251f520926398a7ecb
    Reviewed-on: https://gerrit.libreoffice.org/70215
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index a7ff02889bf6..4f7630b54e06 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -149,7 +149,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
             {
                 nFlags |= SelectionEngineFlags::WAIT_UPEVT;
                 nFlags &= ~SelectionEngineFlags::IN_SEL;
-                pWin->ReleaseMouse();
+                ReleaseMouse();
                 return true;  // wait for STARTDRAG-Command-Event
             }
             if ( eSelMode != SelectionMode::Single )
@@ -170,7 +170,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
         case KEY_SHIFT:
             if ( eSelMode == SelectionMode::Single )
             {
-                pWin->ReleaseMouse();
+                ReleaseMouse();
                 nFlags &= ~SelectionEngineFlags::IN_SEL;
                 return false;
             }
@@ -194,7 +194,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
             if ( eSelMode != SelectionMode::Multiple )
             {
                 nFlags &= ~SelectionEngineFlags::IN_SEL;
-                pWin->ReleaseMouse();
+                ReleaseMouse();
                 return true;  // skip Mouse-Click
             }
             if ( nFlags & SelectionEngineFlags::HAS_ANCH )
@@ -217,7 +217,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
         case KEY_SHIFT + KEY_MOD1:
             if ( eSelMode != SelectionMode::Multiple )
             {
-                pWin->ReleaseMouse();
+                ReleaseMouse();
                 nFlags &= ~SelectionEngineFlags::IN_SEL;
                 return false;
             }
@@ -244,10 +244,8 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
         return false;
     }
 
-    if( !rMEvt.IsRight() )
-    {
-       ReleaseMouse();
-    }
+    if (!rMEvt.IsRight())
+        ReleaseMouse();
 
     if( (nFlags & SelectionEngineFlags::WAIT_UPEVT) && !(nFlags & SelectionEngineFlags::CMDEVT) &&
         eSelMode != SelectionMode::Single)
@@ -324,8 +322,8 @@ void SelectionEngine::SetWindow( vcl::Window* pNewWin )
 {
     if( pNewWin != pWin )
     {
-        if ( pWin && (nFlags & SelectionEngineFlags::IN_SEL) )
-            pWin->ReleaseMouse();
+        if (nFlags & SelectionEngineFlags::IN_SEL)
+            ReleaseMouse();
         pWin = pNewWin;
         if ( pWin && ( nFlags & SelectionEngineFlags::IN_SEL ) )
             pWin->CaptureMouse();
@@ -335,8 +333,8 @@ void SelectionEngine::SetWindow( vcl::Window* pNewWin )
 void SelectionEngine::Reset()
 {
     aWTimer.Stop();
-    if ( nFlags & SelectionEngineFlags::IN_SEL )
-        pWin->ReleaseMouse();
+    if (nFlags & SelectionEngineFlags::IN_SEL)
+        ReleaseMouse();
     nFlags &= ~SelectionEngineFlags(SelectionEngineFlags::HAS_ANCH | SelectionEngineFlags::IN_SEL);
     nLockedMods = 0;
 }


More information about the Libreoffice-commits mailing list