From d01b7b910b5b40ef180fc96660b7607acaafd8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Thu, 12 Jun 2003 07:03:45 +0000 Subject: INTEGRATION: CWS uaa04 (1.2.2); FILE MERGED 2003/06/03 15:19:29 obr 1.2.2.1: #109948# catch possible RuntimeExceptions --- .../source/java/WindowsAccessBridgeAdapter.cxx | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx b/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx index db634b3d9117..67759cdcc1af 100644 --- a/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx +++ b/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx @@ -275,30 +275,40 @@ void handleWindowEvent(Window * pWindow, bool bShow) if ( pParentWindow ) { - // The parent window of a combo box floating window should have the role COMBO_BOX - Reference< XAccessible > xParentAccessible(pParentWindow->GetAccessible()); - if ( xParentAccessible.is() ) + try { - Reference< XAccessibleContext > xParentAC(xParentAccessible->getAccessibleContext()); - if ( xParentAC.is() && (AccessibleRole::COMBO_BOX == xParentAC->getAccessibleRole()) ) + // The parent window of a combo box floating window should have the role COMBO_BOX + Reference< XAccessible > xParentAccessible(pParentWindow->GetAccessible()); + if ( xParentAccessible.is() ) { - // O.k. - this is a combo box floating window corresponding to the child of role LIST of the parent. - // Let's not rely on a specific child order, just search for the child with the role LIST - sal_Int32 nCount = xParentAC->getAccessibleChildCount(); - for ( sal_Int32 n = 0; (n < nCount) && !xAccessible.is(); n++) + Reference< XAccessibleContext > xParentAC(xParentAccessible->getAccessibleContext()); + if ( xParentAC.is() && (AccessibleRole::COMBO_BOX == xParentAC->getAccessibleRole()) ) { - Reference< XAccessible > xChild = xParentAC->getAccessibleChild(n); - if ( xChild.is() ) + // O.k. - this is a combo box floating window corresponding to the child of role LIST of the parent. + // Let's not rely on a specific child order, just search for the child with the role LIST + sal_Int32 nCount = xParentAC->getAccessibleChildCount(); + for ( sal_Int32 n = 0; (n < nCount) && !xAccessible.is(); n++) { - Reference< XAccessibleContext > xChildAC = xChild->getAccessibleContext(); - if ( xChildAC.is() && (AccessibleRole::LIST == xChildAC->getAccessibleRole()) ) + Reference< XAccessible > xChild = xParentAC->getAccessibleChild(n); + if ( xChild.is() ) { - xAccessible = xChild; + Reference< XAccessibleContext > xChildAC = xChild->getAccessibleContext(); + if ( xChildAC.is() && (AccessibleRole::LIST == xChildAC->getAccessibleRole()) ) + { + xAccessible = xChild; + } } } } } } + catch (::com::sun::star::uno::RuntimeException e) + { + // Ignore show events that throw DisposedExceptions in getAccessibleContext(), + // but keep revoking these windows in hide(s). + if (bShow) + return; + } } // We have to rely on the fact that Window::GetAccessible()->getAccessibleContext() returns a valid XAccessibleContext -- cgit v1.2.1