From e19a986cb7a3d7dd2115a86e46fdb06043d9fb87 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 13 May 2017 17:24:04 +0200 Subject: tdf#101885: fix crash in AccFrameSelector Deal with no parent case 0x00007ffff5e98240 in vcl::Window::GetChildCount() const () 0 0x00007ffff5e98240 in vcl::Window::GetChildCount() const () 1 0x00007ffff54f2d1f in svx::a11y::AccFrameSelector::getAccessibleIndexInParent() () See https://bugs.documentfoundation.org/attachment.cgi?id=127141 Change-Id: I795dc4c083d743466b5605d3dcc8f9fca8674c43 Reviewed-on: https://gerrit.libreoffice.org/37575 Tested-by: Jenkins Reviewed-by: Julien Nabet (cherry picked from commit c9275062ed745a8c5d52a3863299baf8bcf86ea7) Reviewed-on: https://gerrit.libreoffice.org/38414 Reviewed-by: Michael Meeks Tested-by: Michael Meeks (cherry picked from commit 75d14731e79b66a75e2d3327b94721f6218eb4d7) --- svx/source/accessibility/AccessibleFrameSelector.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 26ae123968d0..00e1a28ecbb6 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -139,6 +139,8 @@ sal_Int32 AccFrameSelector::getAccessibleIndexInParent( ) if( meBorder == FrameBorderType::NONE ) { vcl::Window* pTabPage = mpFrameSel->GetParent(); + if (!pTabPage) + return nIdx; sal_Int32 nChildren = pTabPage->GetChildCount(); for( nIdx = 0; nIdx < nChildren; ++nIdx ) if( pTabPage->GetChild( static_cast< sal_uInt16 >( nIdx ) ) == mpFrameSel ) -- cgit