diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-05 09:24:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-05 13:21:33 +0100 |
commit | d62dc01ebc52b0d7f88dd1e42aa1a9f7961a85ea (patch) | |
tree | 8d19523ae68018ba16dd27d7a36872b0a450e94a /vcl | |
parent | c02c4df9414ed2bef96565522238ca05013d3ac3 (diff) |
Resolves: tdf#128599 null deref
Change-Id: If71a32b15b5ffab11185e2ce253ab65faf7e6ac3
Reviewed-on: https://gerrit.libreoffice.org/82056
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/event.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
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 ); } |