[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 5 12:22:34 UTC 2019
vcl/source/window/event.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit d62dc01ebc52b0d7f88dd1e42aa1a9f7961a85ea
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Nov 5 09:24:02 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Nov 5 13:21:33 2019 +0100
Resolves: tdf#128599 null deref
Change-Id: If71a32b15b5ffab11185e2ce253ab65faf7e6ac3
Reviewed-on: https://gerrit.libreoffice.org/82056
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/event.cxx b/vcl/source/window/event.cxx
index e6d52a240e5e..edfa7fd8c4d8 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -89,6 +89,17 @@ bool Window::PreNotify( NotifyEvent& rNEvt )
return bDone;
}
+namespace
+{
+ bool parentNotDialogControl(Window* pWindow)
+ {
+ vcl::Window* pParent = getNonLayoutParent(pWindow);
+ if (!pParent)
+ return true;
+ return ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL);
+ }
+}
+
bool Window::EventNotify( NotifyEvent& rNEvt )
{
bool bRet = false;
@@ -172,8 +183,7 @@ bool Window::EventNotify( NotifyEvent& rNEvt )
// if the parent also has dialog control activated, the parent takes over control
if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) || (rNEvt.GetType() == MouseNotifyEvent::KEYUP) )
{
- if ( ImplIsOverlapWindow() ||
- ((getNonLayoutParent(this)->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
+ if (ImplIsOverlapWindow() || parentNotDialogControl(this))
{
bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == MouseNotifyEvent::KEYINPUT );
}
More information about the Libreoffice-commits
mailing list