diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2021-08-02 13:38:31 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-05-23 10:49:16 +0200 |
commit | d572ee2d6c17c112a457d47d759a72bffcbc4bba (patch) | |
tree | c92a26fb5f709c8dc467fc5b2ac87d5efb952060 | |
parent | 019d9472d29adbb6487e20433b6c576047b16e66 (diff) |
vcl: avoid native widget pieces for disposed BorderWindow.
Fixes crash around help windows:
vcl::Window::IsCompoundControl() const
vcl/source/window/window2.cxx:1200
vcl::Window::Show(bool, ShowFlags)
vcl/source/window/window.cxx:2243 (discriminator 3)
vcl::Window::Show(bool, ShowFlags)
vcl/source/window/window.cxx:2298
HelpTextWindow::ImplShow()
vcl/source/app/help.cxx:371
Scheduler::ProcessTaskScheduling()
vcl/source/app/scheduler.cxx:495
Change-Id: Ia0205813f3e9d306314577d59d6cdd1bdfa0ee71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119881
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | vcl/source/window/window.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 49551be5f901..9a5a6cde533b 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2239,7 +2239,8 @@ void Window::Show(bool bVisible, ShowFlags nFlags) // inherit native widget flag for form controls // required here, because frames never show up in the child hierarchy - which should be fixed... // eg, the drop down of a combobox which is a system floating window - if( mpWindowImpl->mbFrame && GetParent() && GetParent()->IsCompoundControl() && + if( mpWindowImpl->mbFrame && GetParent() && !GetParent()->IsDisposed() && + GetParent()->IsCompoundControl() && GetParent()->IsNativeWidgetEnabled() != IsNativeWidgetEnabled() && !(GetStyle() & WB_TOOLTIPWIN) ) { @@ -3706,7 +3707,7 @@ void Window::EnableNativeWidget( bool bEnable ) bool Window::IsNativeWidgetEnabled() const { - return ImplGetWinData()->mbEnableNativeWidget; + return mpWindowImpl ? ImplGetWinData()->mbEnableNativeWidget : false; } Reference< css::rendering::XCanvas > Window::ImplGetCanvas( bool bSpriteCanvas ) const diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 0e4b3d6ee00f..e2c306fdab1b 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1182,7 +1182,7 @@ GetFocusFlags Window::GetGetFocusFlags() const bool Window::IsCompoundControl() const { - return mpWindowImpl->mbCompoundControl; + return mpWindowImpl ? mpWindowImpl->mbCompoundControl : false; } bool Window::IsWait() const |