[Libreoffice-commits] core.git: Branch 'feature/cib_contract57' - vcl/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Wed Jul 27 12:32:17 UTC 2016


 vcl/source/window/accessibility.cxx |    2 ++
 vcl/source/window/stacking.cxx      |    2 +-
 vcl/source/window/window.cxx        |    2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit e295459936a915d7003ace607727a6bcecc81755
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Wed Jul 27 11:00:55 2016 +0200

    Fix some crashes
    
    Change-Id: If647305bc886856991b21cce9499b76eaae2260c
    Reviewed-on: https://gerrit.libreoffice.org/27573
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 39befda..59091d4 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -152,6 +152,8 @@ namespace vcl {
 
 void Window::SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > x )
 {
+    if (mpWindowImpl == nullptr)
+        return;
     mpWindowImpl->mxAccessible = x;
 }
 
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 52d9685..fb4760c 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -862,7 +862,7 @@ void Window::SetParent( vcl::Window* pNewParent )
     DBG_ASSERT( pNewParent, "Window::SetParent(): pParent == NULL" );
     DBG_ASSERT( pNewParent != this, "someone tried to reparent a window to itself" );
 
-    if( pNewParent == this )
+    if( pNewParent == this || pNewParent == nullptr)
         return;
 
     // check if the taskpanelist would change and move the window pointer accordingly
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e8d2b96..6c2b1d6 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3292,6 +3292,8 @@ const OUString& Window::GetHelpText() const
 
 void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow  )
 {
+    if (mpWindowImpl == nullptr)
+        return;
     // be safe against re-entrance: first clear the old ref, then assign the new one
     mpWindowImpl->mxWindowPeer.clear();
     mpWindowImpl->mxWindowPeer = xPeer;


More information about the Libreoffice-commits mailing list