diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-26 09:19:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-26 09:19:52 +0000 |
commit | 4584e3a6df74b1d83c077f3b33a6515c2aab1aa5 (patch) | |
tree | 2e708e878ba0e85c61753036b2e0834d78f3a884 /vcl | |
parent | 5e1546ccbce1c8fcea16c191edc1409da04c9193 (diff) |
test for IsMouseCaptured before releasing mouse
like the other call sites do
Change-Id: I77250f172f9d9ce97e5982bafbc8f042e9343acc
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/mouse.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 198e4cde7460..330cb701a695 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -468,10 +468,10 @@ void Window::ReleaseMouse() ImplSVData* pSVData = ImplGetSVData(); - SAL_WARN_IF( pSVData->maWinData.mpCaptureWin.get() != this, "vcl", + SAL_WARN_IF(!IsMouseCaptured(), "vcl", "Window::ReleaseMouse(): window doesn't have the mouse capture" ); - if ( pSVData->maWinData.mpCaptureWin.get() == this ) + if (IsMouseCaptured()) { pSVData->maWinData.mpCaptureWin = nullptr; mpWindowImpl->mpFrame->CaptureMouse( false ); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 48be7171a994..89015128c4c8 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -249,13 +249,13 @@ void Window::dispose() DBG_ASSERT( pSVData->maWinData.mpTrackWin.get() != this, "Window::~Window(): Window is in TrackingMode" ); - DBG_ASSERT( pSVData->maWinData.mpCaptureWin.get() != this, - "Window::~Window(): Window has the mouse captured" ); + DBG_ASSERT(!IsMouseCaptured(), + "Window::~Window(): Window has the mouse captured"); // due to old compatibility if ( pSVData->maWinData.mpTrackWin == this ) EndTracking(); - if ( pSVData->maWinData.mpCaptureWin == this ) + if (IsMouseCaptured()) ReleaseMouse(); if ( pSVData->maWinData.mpDefDialogParent == this ) pSVData->maWinData.mpDefDialogParent = nullptr; |