diff options
Diffstat (limited to 'accessibility/source/extended/accessiblelistbox.cxx')
-rw-r--r-- | accessibility/source/extended/accessiblelistbox.cxx | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index d56df44e0080..1e1946fe4224 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -64,137 +64,137 @@ namespace accessibility void AccessibleListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { - if ( isAlive() ) + if ( !isAlive() ) + return; + + switch ( rVclWindowEvent.GetId() ) { - switch ( rVclWindowEvent.GetId() ) + case VclEventId::CheckboxToggle : { - case VclEventId::CheckboxToggle : + if ( !getListBox() || !getListBox()->HasFocus() ) { - if ( !getListBox() || !getListBox()->HasFocus() ) - { - return; - } - AccessibleListBoxEntry* pCurOpEntry = GetCurEventEntry(rVclWindowEvent); - if(!pCurOpEntry) - { - return ; - } - uno::Any aValue; - aValue <<= AccessibleStateType::CHECKED; - - if ( getListBox()->GetCheckButtonState( pCurOpEntry->GetSvLBoxEntry() ) == SvButtonState::Checked ) - { - pCurOpEntry->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), aValue ); - } - else - { - pCurOpEntry->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aValue,uno::Any() ); - } - break; + return; } + AccessibleListBoxEntry* pCurOpEntry = GetCurEventEntry(rVclWindowEvent); + if(!pCurOpEntry) + { + return ; + } + uno::Any aValue; + aValue <<= AccessibleStateType::CHECKED; - case VclEventId::ListboxSelect : + if ( getListBox()->GetCheckButtonState( pCurOpEntry->GetSvLBoxEntry() ) == SvButtonState::Checked ) + { + pCurOpEntry->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), aValue ); + } + else { - OSL_FAIL("Debug: Treelist shouldn't use VclEventId::ListboxSelect"); - break; + pCurOpEntry->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aValue,uno::Any() ); } + break; + } + + case VclEventId::ListboxSelect : + { + OSL_FAIL("Debug: Treelist shouldn't use VclEventId::ListboxSelect"); + break; + } - case VclEventId::ListboxTreeSelect: + case VclEventId::ListboxTreeSelect: + { + 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()); - if (pEntry) - { - pEntry->NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() ); - } + pEntry->NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() ); } } - break; - case VclEventId::ListboxTreeFocus: + } + break; + case VclEventId::ListboxTreeFocus: + { + VclPtr<SvTreeListBox> pBox = getListBox(); + if( pBox && pBox->HasFocus() ) { - VclPtr<SvTreeListBox> pBox = getListBox(); - if( pBox && pBox->HasFocus() ) + uno::Any aNewValue; + SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); + if ( pEntry ) { - uno::Any aNewValue; - SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); - if ( pEntry ) + AccessibleListBoxEntry* pEntryFocus =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get()); + if (pEntryFocus && pEntryFocus->GetSvLBoxEntry() == pEntry) { - AccessibleListBoxEntry* pEntryFocus =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get()); - if (pEntryFocus && pEntryFocus->GetSvLBoxEntry() == pEntry) - { - aNewValue <<= m_xFocusedChild; - NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, uno::Any(), aNewValue ); - return ; - } + aNewValue <<= m_xFocusedChild; + NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, uno::Any(), aNewValue ); + return ; + } - uno::Any aOldValue; - aOldValue <<= m_xFocusedChild; + uno::Any aOldValue; + aOldValue <<= m_xFocusedChild; - m_xFocusedChild.set(implGetAccessible(*pEntry).get()); + m_xFocusedChild.set(implGetAccessible(*pEntry).get()); - aNewValue <<= m_xFocusedChild; - NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue ); - } - else - { - aNewValue <<= AccessibleStateType::FOCUSED; - NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), aNewValue ); - } + aNewValue <<= m_xFocusedChild; + NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue ); + } + else + { + aNewValue <<= AccessibleStateType::FOCUSED; + NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), aNewValue ); } } - break; - case VclEventId::ListboxItemRemoved: + } + break; + case VclEventId::ListboxItemRemoved: + { + SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); + if ( pEntry ) { - SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); - if ( pEntry ) + RemoveChildEntries(pEntry); + } + else + { + // NULL means Clear() + for (auto const& entry : m_mapEntry) { - RemoveChildEntries(pEntry); + uno::Any aNewValue; + uno::Any aOldValue; + aOldValue <<= uno::Reference<XAccessible>(entry.second.get()); + NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue ); } - else - { - // NULL means Clear() - for (auto const& entry : m_mapEntry) - { - uno::Any aNewValue; - uno::Any aOldValue; - aOldValue <<= uno::Reference<XAccessible>(entry.second.get()); - NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue ); - } - for (auto const& entry : m_mapEntry) - { // release references ... - entry.second->dispose(); - } - m_mapEntry.clear(); + for (auto const& entry : m_mapEntry) + { // release references ... + entry.second->dispose(); } + m_mapEntry.clear(); } - break; + } + break; - // #i92103# - case VclEventId::ItemExpanded : - case VclEventId::ItemCollapsed : + // #i92103# + case VclEventId::ItemExpanded : + case VclEventId::ItemCollapsed : + { + SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); + if ( pEntry ) { - SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() ); - if ( pEntry ) + Reference<XAccessible> const xChild(implGetAccessible(*pEntry).get()); + const short nAccEvent = + ( rVclWindowEvent.GetId() == VclEventId::ItemExpanded ) + ? AccessibleEventId::LISTBOX_ENTRY_EXPANDED + : AccessibleEventId::LISTBOX_ENTRY_COLLAPSED; + uno::Any aListBoxEntry; + aListBoxEntry <<= xChild; + NotifyAccessibleEvent( nAccEvent, Any(), aListBoxEntry ); + if ( getListBox() && getListBox()->HasFocus() ) { - Reference<XAccessible> const xChild(implGetAccessible(*pEntry).get()); - const short nAccEvent = - ( rVclWindowEvent.GetId() == VclEventId::ItemExpanded ) - ? AccessibleEventId::LISTBOX_ENTRY_EXPANDED - : AccessibleEventId::LISTBOX_ENTRY_COLLAPSED; - uno::Any aListBoxEntry; - aListBoxEntry <<= xChild; - NotifyAccessibleEvent( nAccEvent, Any(), aListBoxEntry ); - if ( getListBox() && getListBox()->HasFocus() ) - { - NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), aListBoxEntry ); - } + NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), aListBoxEntry ); } } - break; - default: - VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent); } + break; + default: + VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent); } } |