coverity#1132668 : missing break in switch

Change-Id: Ia759081e7ccc9105898f25025ea567d900d33b13
This commit is contained in:
Norbert Thiebaud 2014-01-19 15:29:26 -06:00
parent 3c2f3f4854
commit a1a545aa98

View File

@ -78,7 +78,7 @@ namespace accessibility
{ {
switch ( rVclWindowEvent.GetId() ) switch ( rVclWindowEvent.GetId() )
{ {
case VCLEVENT_CHECKBOX_TOGGLE : case VCLEVENT_CHECKBOX_TOGGLE :
{ {
if ( !getListBox() || !getListBox()->HasFocus() ) if ( !getListBox() || !getListBox()->HasFocus() )
{ {
@ -103,114 +103,111 @@ namespace accessibility
break; break;
} }
case VCLEVENT_LISTBOX_SELECT : case VCLEVENT_LISTBOX_SELECT :
{ {
// First send an event that tells the listeners of a
// modified selection. The active descendant event is
// send after that so that the receiving AT has time to
// read the text or name of the active child.
OSL_ASSERT(0 && "Debug: Treelist shouldn't use VCLEVENT_LISTBOX_SELECT"); OSL_ASSERT(0 && "Debug: Treelist shouldn't use VCLEVENT_LISTBOX_SELECT");
break;
} }
case VCLEVENT_LISTBOX_TREESELECT: case VCLEVENT_LISTBOX_TREESELECT:
{
if ( getListBox() && getListBox()->HasFocus() )
{ {
if ( getListBox() && getListBox()->HasFocus() ) AccessibleListBoxEntry* pEntry =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get());
if (pEntry)
{ {
AccessibleListBoxEntry* pEntry =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get()); pEntry->NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
if (pEntry)
{
pEntry->NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
}
} }
} }
break; }
case VCLEVENT_LISTBOX_TREEFOCUS: break;
case VCLEVENT_LISTBOX_TREEFOCUS:
{
SvTreeListBox* pBox = getListBox();
sal_Bool bNeedFocus = sal_False;
if (pBox)
{ {
SvTreeListBox* pBox = getListBox(); Window* pParent = ((Window*)pBox)->GetParent();
sal_Bool bNeedFocus = sal_False; if (pParent && pParent->GetType() == WINDOW_FLOATINGWINDOW)
if (pBox)
{ {
Window* pParent = ((Window*)pBox)->GetParent(); // MT: ImplGetAppSVData shouldn't be exported from VCL.
if (pParent && pParent->GetType() == WINDOW_FLOATINGWINDOW) // In which scenario is this needed?
{ // If needed, we need to find an other solution
// MT: ImplGetAppSVData shouldn't be exported from VCL. /*
// In which scenario is this needed? ImplSVData* pSVData = ImplGetAppSVData();
// If needed, we need to find an other solution if (pSVData && pSVData->maWinData.mpFirstFloat == (FloatingWindow*)pParent)
/* bNeedFocus = sal_True;
ImplSVData* pSVData = ImplGetAppSVData(); */
if (pSVData && pSVData->maWinData.mpFirstFloat == (FloatingWindow*)pParent)
bNeedFocus = sal_True;
*/
}
}
if( pBox && (pBox->HasFocus() || bNeedFocus) )
{
uno::Any aOldValue, aNewValue;
SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
if ( pEntry )
{
AccessibleListBoxEntry* pEntryFocus =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get());
if (pEntryFocus && pEntryFocus->GetSvLBoxEntry() == pEntry)
{
aOldValue <<= uno::Any();
aNewValue <<= m_xFocusedChild;
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
return ;
}
aOldValue <<= m_xFocusedChild;
MAP_ENTRY::iterator mi = m_mapEntry.find(pEntry);
if(mi != m_mapEntry.end())
{
OSL_ASSERT(mi->second.get() != NULL);
m_xFocusedChild = mi->second;
}
else
{
AccessibleListBoxEntry *pEntNew = new AccessibleListBoxEntry( *getListBox(), pEntry, NULL );
m_xFocusedChild = pEntNew;
m_mapEntry.insert(MAP_ENTRY::value_type(pEntry,pEntNew));
}
aNewValue <<= m_xFocusedChild;
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
}
else
{
aOldValue <<= uno::Any();
aNewValue <<= AccessibleStateType::FOCUSED;
NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
}
} }
} }
break; if( pBox && (pBox->HasFocus() || bNeedFocus) )
case VCLEVENT_LISTBOX_ITEMREMOVED:
{ {
uno::Any aOldValue, aNewValue;
SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
if ( pEntry ) if ( pEntry )
{ {
RemoveChildEntries(pEntry); AccessibleListBoxEntry* pEntryFocus =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get());
if (pEntryFocus && pEntryFocus->GetSvLBoxEntry() == pEntry)
{
aOldValue <<= uno::Any();
aNewValue <<= m_xFocusedChild;
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
return ;
}
aOldValue <<= m_xFocusedChild;
MAP_ENTRY::iterator mi = m_mapEntry.find(pEntry);
if(mi != m_mapEntry.end())
{
OSL_ASSERT(mi->second.get() != NULL);
m_xFocusedChild = mi->second;
}
else
{
AccessibleListBoxEntry *pEntNew = new AccessibleListBoxEntry( *getListBox(), pEntry, NULL );
m_xFocusedChild = pEntNew;
m_mapEntry.insert(MAP_ENTRY::value_type(pEntry,pEntNew));
}
aNewValue <<= m_xFocusedChild;
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
} }
else else
{ {
// NULL means Clear() aOldValue <<= uno::Any();
MAP_ENTRY::iterator mi = m_mapEntry.begin(); aNewValue <<= AccessibleStateType::FOCUSED;
for ( ; mi != m_mapEntry.end() ; ++mi) NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
{
uno::Any aNewValue;
uno::Any aOldValue;
aOldValue <<= mi->second;
NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue );
}
m_mapEntry.clear();
} }
} }
break; }
break;
case VCLEVENT_LISTBOX_ITEMREMOVED:
{
SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
if ( pEntry )
{
RemoveChildEntries(pEntry);
}
else
{
// NULL means Clear()
MAP_ENTRY::iterator mi = m_mapEntry.begin();
for ( ; mi != m_mapEntry.end() ; ++mi)
{
uno::Any aNewValue;
uno::Any aOldValue;
aOldValue <<= mi->second;
NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue );
}
m_mapEntry.clear();
}
}
break;
// #i92103# // #i92103#
case VCLEVENT_ITEM_EXPANDED : case VCLEVENT_ITEM_EXPANDED :
case VCLEVENT_ITEM_COLLAPSED : case VCLEVENT_ITEM_COLLAPSED :
{ {
SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
if ( pEntry ) if ( pEntry )
@ -232,8 +229,8 @@ namespace accessibility
} }
} }
break; break;
default: default:
VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent); VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
} }
} }
} }