diff --git a/vcl/osx/documentfocuslistener.cxx b/vcl/osx/documentfocuslistener.cxx index 908700383704..ee1e1f49d5c8 100644 --- a/vcl/osx/documentfocuslistener.cxx +++ b/vcl/osx/documentfocuslistener.cxx @@ -48,10 +48,10 @@ void SAL_CALL DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent ) throw( RuntimeException, std::exception ) { - switch( aEvent.EventId ) - { - case AccessibleEventId::STATE_CHANGED: - try + try { + switch( aEvent.EventId ) + { + case AccessibleEventId::STATE_CHANGED: { sal_Int16 nState = AccessibleStateType::INVALID; aEvent.NewValue >>= nState; @@ -59,34 +59,35 @@ DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent ) if( AccessibleStateType::FOCUSED == nState ) m_aFocusTracker.setFocusedObject( getAccessible(aEvent) ); } - catch(const IndexOutOfBoundsException &) + break; + + case AccessibleEventId::CHILD: { - OSL_TRACE("Focused object has invalid index in parent"); + Reference< XAccessible > xChild; + if( (aEvent.OldValue >>= xChild) && xChild.is() ) + detachRecursive(xChild); + + if( (aEvent.NewValue >>= xChild) && xChild.is() ) + attachRecursive(xChild); } break; - case AccessibleEventId::CHILD: - { - Reference< XAccessible > xChild; - if( (aEvent.OldValue >>= xChild) && xChild.is() ) - detachRecursive(xChild); + case AccessibleEventId::INVALIDATE_ALL_CHILDREN: + { + Reference< XAccessible > xAccessible( getAccessible(aEvent) ); + detachRecursive(xAccessible); + attachRecursive(xAccessible); + } + OSL_TRACE( "Invalidate all children called\n" ); + break; - if( (aEvent.NewValue >>= xChild) && xChild.is() ) - attachRecursive(xChild); + default: + break; } - break; - - case AccessibleEventId::INVALIDATE_ALL_CHILDREN: - { - Reference< XAccessible > xAccessible( getAccessible(aEvent) ); - detachRecursive(xAccessible); - attachRecursive(xAccessible); - } - - OSL_TRACE( "Invalidate all children called" ); - break; - default: - break; + } + catch (const IndexOutOfBoundsException&) + { + OSL_TRACE("Focused object has invalid index in parent"); } } diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index f662bbdc7bdd..96990c910f5c 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -204,10 +204,10 @@ void DocumentFocusListener::disposing( const lang::EventObject& aEvent ) void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent ) throw( uno::RuntimeException, std::exception ) { - switch( aEvent.EventId ) - { - case accessibility::AccessibleEventId::STATE_CHANGED: - try + try { + switch( aEvent.EventId ) + { + case accessibility::AccessibleEventId::STATE_CHANGED: { sal_Int16 nState = accessibility::AccessibleStateType::INVALID; aEvent.NewValue >>= nState; @@ -215,28 +215,30 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj if( accessibility::AccessibleStateType::FOCUSED == nState ) atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) ); } - catch (const lang::IndexOutOfBoundsException&) + break; + + case accessibility::AccessibleEventId::CHILD: { - g_warning("Focused object has invalid index in parent"); + uno::Reference< accessibility::XAccessible > xChild; + if( (aEvent.OldValue >>= xChild) && xChild.is() ) + detachRecursive(xChild); + + if( (aEvent.NewValue >>= xChild) && xChild.is() ) + attachRecursive(xChild); } break; - case accessibility::AccessibleEventId::CHILD: - { - uno::Reference< accessibility::XAccessible > xChild; - if( (aEvent.OldValue >>= xChild) && xChild.is() ) - detachRecursive(xChild); - - if( (aEvent.NewValue >>= xChild) && xChild.is() ) - attachRecursive(xChild); - } - break; - - case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN: + case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN: g_warning( "Invalidate all children called\n" ); break; - default: - break; + + default: + break; + } + } + catch( const lang::IndexOutOfBoundsException& e ) + { + g_warning("Focused object has invalid index in parent"); } }