[Libreoffice-commits] core.git: svx/source
Michael Meeks
michael.meeks at collabora.com
Thu Aug 27 00:34:24 PDT 2015
svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 1950127b1cf056bc5b7d594e6a2d54375f8504ab
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Aug 27 08:40:46 2015 +0100
tdf#92213 - don't crash fetching pixelctl a11y peer for un-parented window.
Change-Id: Ie36f46e2eae72e8838aa5e45f96bd02fef45f7d5
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index e5253d9..74960ea 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;
More information about the Libreoffice-commits
mailing list