summaryrefslogtreecommitdiff
path: root/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-08-27 08:40:46 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-08-27 08:43:21 +0100
commit1950127b1cf056bc5b7d594e6a2d54375f8504ab (patch)
tree8f1c5fc8c7e9b26a27df16adf901adc8fa8e0fe8 /svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
parent0a96482941d510043bfef235ab5e1bf18a45fba7 (diff)
tdf#92213 - don't crash fetching pixelctl a11y peer for un-parented window.
Change-Id: Ie36f46e2eae72e8838aa5e45f96bd02fef45f7d5
Diffstat (limited to 'svx/source/accessibility/svxpixelctlaccessiblecontext.cxx')
-rw-r--r--svx/source/accessibility/svxpixelctlaccessiblecontext.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index e5253d91bcc3..74960ea53dec 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -88,15 +88,15 @@ uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleChild( sal_Int
return CreateChild(i, mrPixelCtl.IndexToPoint(i));
}
-
-
uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleParent( )
throw (uno::RuntimeException, std::exception)
{
::osl::MutexGuard aGuard( m_aMutex );
vcl::Window *pTabPage = getNonLayoutParent(&mrPixelCtl);
- assert(pTabPage && WINDOW_TABPAGE == pTabPage->GetType());
- return pTabPage->GetAccessible();
+ if (!pTabPage || WINDOW_TABPAGE != pTabPage->GetType())
+ return uno::Reference< XAccessible >();
+ else
+ return pTabPage->GetAccessible();
}
sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( )
@@ -105,13 +105,15 @@ sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( )
::osl::MutexGuard aGuard( m_aMutex );
sal_uInt16 nIdx = 0;
vcl::Window *pTabPage = getNonLayoutParent(&mrPixelCtl);
- assert(pTabPage && WINDOW_TABPAGE == pTabPage->GetType());
+ if (!pTabPage || WINDOW_TABPAGE != pTabPage->GetType())
+ return -1;
sal_uInt16 nChildren = pTabPage->GetChildCount();
for(nIdx = 0; nIdx < nChildren; nIdx++)
if(pTabPage->GetChild( nIdx ) == &mrPixelCtl)
break;
return nIdx;
}
+
sal_Int16 SvxPixelCtlAccessible::getAccessibleRole( ) throw (uno::RuntimeException, std::exception)
{
return AccessibleRole::LIST;