Resolves: #i124970# fix DocumentFocusListener::notifyEvent's...
handling of IndexOutOfBoundsException the DocumentFocusListener::notifyEvent() throw list only allows a RuntimeException to propagate. The methods called in notifyEvent() allow IndexOutOfBoundsException though, so it must be handled in all cases to prevent C++ from invoking its unexpected() abort mechanisms. Ceterum censeo, non-empty throw lists should be removed altogether... (cherry picked from commit 4da0e442f0fd4838e93e7316c24cfeef9289207d) Conflicts: vcl/osx/documentfocuslistener.cxx vcl/unx/gtk/a11y/atkutil.cxx Change-Id: Ie0b783832314ee5ec376a0c3c2cd67e4a70e218b
This commit is contained in:
committed by
Caolán McNamara
parent
94b2fe9b00
commit
5232d01ee5
@@ -48,10 +48,10 @@ void SAL_CALL
|
|||||||
DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
|
DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
|
||||||
throw( RuntimeException, std::exception )
|
throw( RuntimeException, std::exception )
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
switch( aEvent.EventId )
|
switch( aEvent.EventId )
|
||||||
{
|
{
|
||||||
case AccessibleEventId::STATE_CHANGED:
|
case AccessibleEventId::STATE_CHANGED:
|
||||||
try
|
|
||||||
{
|
{
|
||||||
sal_Int16 nState = AccessibleStateType::INVALID;
|
sal_Int16 nState = AccessibleStateType::INVALID;
|
||||||
aEvent.NewValue >>= nState;
|
aEvent.NewValue >>= nState;
|
||||||
@@ -59,10 +59,6 @@ DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
|
|||||||
if( AccessibleStateType::FOCUSED == nState )
|
if( AccessibleStateType::FOCUSED == nState )
|
||||||
m_aFocusTracker.setFocusedObject( getAccessible(aEvent) );
|
m_aFocusTracker.setFocusedObject( getAccessible(aEvent) );
|
||||||
}
|
}
|
||||||
catch(const IndexOutOfBoundsException &)
|
|
||||||
{
|
|
||||||
OSL_TRACE("Focused object has invalid index in parent");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AccessibleEventId::CHILD:
|
case AccessibleEventId::CHILD:
|
||||||
@@ -82,13 +78,18 @@ DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
|
|||||||
detachRecursive(xAccessible);
|
detachRecursive(xAccessible);
|
||||||
attachRecursive(xAccessible);
|
attachRecursive(xAccessible);
|
||||||
}
|
}
|
||||||
|
OSL_TRACE( "Invalidate all children called\n" );
|
||||||
OSL_TRACE( "Invalidate all children called" );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (const IndexOutOfBoundsException&)
|
||||||
|
{
|
||||||
|
OSL_TRACE("Focused object has invalid index in parent");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference< XAccessible > DocumentFocusListener::getAccessible(const EventObject& aEvent )
|
Reference< XAccessible > DocumentFocusListener::getAccessible(const EventObject& aEvent )
|
||||||
throw (IndexOutOfBoundsException, RuntimeException)
|
throw (IndexOutOfBoundsException, RuntimeException)
|
||||||
|
@@ -204,10 +204,10 @@ void DocumentFocusListener::disposing( const lang::EventObject& aEvent )
|
|||||||
void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent )
|
void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent )
|
||||||
throw( uno::RuntimeException, std::exception )
|
throw( uno::RuntimeException, std::exception )
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
switch( aEvent.EventId )
|
switch( aEvent.EventId )
|
||||||
{
|
{
|
||||||
case accessibility::AccessibleEventId::STATE_CHANGED:
|
case accessibility::AccessibleEventId::STATE_CHANGED:
|
||||||
try
|
|
||||||
{
|
{
|
||||||
sal_Int16 nState = accessibility::AccessibleStateType::INVALID;
|
sal_Int16 nState = accessibility::AccessibleStateType::INVALID;
|
||||||
aEvent.NewValue >>= nState;
|
aEvent.NewValue >>= nState;
|
||||||
@@ -215,10 +215,6 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj
|
|||||||
if( accessibility::AccessibleStateType::FOCUSED == nState )
|
if( accessibility::AccessibleStateType::FOCUSED == nState )
|
||||||
atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) );
|
atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) );
|
||||||
}
|
}
|
||||||
catch (const lang::IndexOutOfBoundsException&)
|
|
||||||
{
|
|
||||||
g_warning("Focused object has invalid index in parent");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case accessibility::AccessibleEventId::CHILD:
|
case accessibility::AccessibleEventId::CHILD:
|
||||||
@@ -235,10 +231,16 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj
|
|||||||
case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
|
case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
|
||||||
g_warning( "Invalidate all children called\n" );
|
g_warning( "Invalidate all children called\n" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch( const lang::IndexOutOfBoundsException& e )
|
||||||
|
{
|
||||||
|
g_warning("Focused object has invalid index in parent");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user