[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 3 08:01:25 UTC 2021


 vcl/source/window/window.cxx  |    5 +++--
 vcl/source/window/window2.cxx |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 675066678532110e8a1d3031407e0d14a561b254
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Aug 2 13:38:31 2021 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Aug 3 10:00:49 2021 +0200

    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
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119853
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5b91cd0da1a7..3b0e390721e3 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2272,7 +2272,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) )
         {
@@ -3701,7 +3702,7 @@ void Window::EnableNativeWidget( bool bEnable )
 
 bool Window::IsNativeWidgetEnabled() const
 {
-    return ImplGetWinData()->mbEnableNativeWidget;
+    return mpWindowImpl && ImplGetWinData()->mbEnableNativeWidget;
 }
 
 Reference< css::rendering::XCanvas > Window::ImplGetCanvas( bool bSpriteCanvas ) const
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 75885cb43d98..8b8348079887 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1192,7 +1192,7 @@ GetFocusFlags Window::GetGetFocusFlags() const
 
 bool Window::IsCompoundControl() const
 {
-    return mpWindowImpl->mbCompoundControl;
+    return mpWindowImpl && mpWindowImpl->mbCompoundControl;
 }
 
 bool Window::IsWait() const


More information about the Libreoffice-commits mailing list