Kaydet (Commit) 1950127b authored tarafından Michael Meeks's avatar Michael Meeks

tdf#92213 - don't crash fetching pixelctl a11y peer for un-parented window.

Change-Id: Ie36f46e2eae72e8838aa5e45f96bd02fef45f7d5
üst 0a964829
...@@ -88,15 +88,15 @@ uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleChild( sal_Int ...@@ -88,15 +88,15 @@ uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleChild( sal_Int
return CreateChild(i, mrPixelCtl.IndexToPoint(i)); return CreateChild(i, mrPixelCtl.IndexToPoint(i));
} }
uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleParent( ) uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleParent( )
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
vcl::Window *pTabPage = getNonLayoutParent(&mrPixelCtl); vcl::Window *pTabPage = getNonLayoutParent(&mrPixelCtl);
assert(pTabPage && WINDOW_TABPAGE == pTabPage->GetType()); if (!pTabPage || WINDOW_TABPAGE != pTabPage->GetType())
return pTabPage->GetAccessible(); return uno::Reference< XAccessible >();
else
return pTabPage->GetAccessible();
} }
sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( ) sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( )
...@@ -105,13 +105,15 @@ sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( ) ...@@ -105,13 +105,15 @@ sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( )
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
sal_uInt16 nIdx = 0; sal_uInt16 nIdx = 0;
vcl::Window *pTabPage = getNonLayoutParent(&mrPixelCtl); vcl::Window *pTabPage = getNonLayoutParent(&mrPixelCtl);
assert(pTabPage && WINDOW_TABPAGE == pTabPage->GetType()); if (!pTabPage || WINDOW_TABPAGE != pTabPage->GetType())
return -1;
sal_uInt16 nChildren = pTabPage->GetChildCount(); sal_uInt16 nChildren = pTabPage->GetChildCount();
for(nIdx = 0; nIdx < nChildren; nIdx++) for(nIdx = 0; nIdx < nChildren; nIdx++)
if(pTabPage->GetChild( nIdx ) == &mrPixelCtl) if(pTabPage->GetChild( nIdx ) == &mrPixelCtl)
break; break;
return nIdx; return nIdx;
} }
sal_Int16 SvxPixelCtlAccessible::getAccessibleRole( ) throw (uno::RuntimeException, std::exception) sal_Int16 SvxPixelCtlAccessible::getAccessibleRole( ) throw (uno::RuntimeException, std::exception)
{ {
return AccessibleRole::LIST; return AccessibleRole::LIST;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment