[Libreoffice-commits] core.git: 4 commits - accessibility/source

Caolán McNamara caolanm at redhat.com
Fri Apr 3 07:09:50 PDT 2015


 accessibility/source/standard/vclxaccessiblebox.cxx  |   22 ++++--------
 accessibility/source/standard/vclxaccessiblelist.cxx |   33 ++++---------------
 2 files changed, 15 insertions(+), 40 deletions(-)

New commits:
commit 74e673b49fdf8daa3365961de5fb0c9c6d831279
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 3 15:03:34 2015 +0100

    Resolves: tdf#82998 no object:active descendant changed emitted
    
    for listboxes in WB_DROPDOWN mode which means the dropdown exists,
    but when the drop down is not activated.
    
    I think it's plausible that there was confusion around "b_IsDropDownList" and
    that the meaning taken by the author was the the dropdown is active if
    b_IsDropDownList is set, so renamed that to bHasDropDownList and take the old
    "b_IsDropDownList" path when "b_IsDropDownList && ..IsInDropDown()"
    
    Folded the then both equal code paths of the LISTBOX code together. No idea if
    there should be an additional equivalent AccessibleEventId::SELECTION_CHANGED
    for LISTBOXES like COMBOBOX instead of
    AccessibleEventId::ACTIVE_DESCENDANT_CHANGED in the dropdown not active case.
    
    Change-Id: I6db3ec21b392b7bf1b488235464202bb326f2535

diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index 31217a2..7fc060b 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -205,7 +205,7 @@ void VCLXAccessibleList::UpdateSelection_Acc (const ::rtl::OUString& sTextOfSele
 }
 
 
-void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList)
+void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool bHasDropDownList)
 {
     uno::Any aOldValue, aNewValue;
 
@@ -261,22 +261,18 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList)
 
     if (m_aBoxType == COMBOBOX)
     {
-        if (b_IsDropDownList)
+        //VCLXAccessibleDropDownComboBox
+        //when in list is dropped down, xText = NULL
+        if (bHasDropDownList && m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
         {
-            //VCLXAccessibleDropDownComboBox
-            //when in list is dropped down, xText = NULL
-            if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
+            if ( aNewValue.hasValue() || aOldValue.hasValue() )
             {
-                if ( aNewValue.hasValue() || aOldValue.hasValue() )
-                {
-                    NotifyAccessibleEvent(
-                        AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-                        aOldValue,
-                        aNewValue );
-
-                    NotifyListItem(aNewValue);
+                NotifyAccessibleEvent(
+                    AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+                    aOldValue,
+                    aNewValue );
 
-                }
+                NotifyListItem(aNewValue);
             }
         }
         else
@@ -287,34 +283,14 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList)
     }
     else if (m_aBoxType == LISTBOX)
     {
-        if (b_IsDropDownList)
+        if ( aNewValue.hasValue() || aOldValue.hasValue() )
         {
-            //VCLXAccessibleDropdownListBox
-            //when in list is dropped down, xText = NULL
-            if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
-            {
-                if ( aNewValue.hasValue() || aOldValue.hasValue() )
-                {
-                    NotifyAccessibleEvent(
-                        AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-                        aOldValue,
-                        aNewValue );
+            NotifyAccessibleEvent(
+                    AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+                    aOldValue,
+                    aNewValue );
 
-                    NotifyListItem(aNewValue);
-                }
-            }
-        }
-        else
-        {
-            if ( aNewValue.hasValue() || aOldValue.hasValue() )
-            {
-                NotifyAccessibleEvent(
-                        AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-                        aOldValue,
-                        aNewValue );
-
-                NotifyListItem(aNewValue);
-            }
+            NotifyListItem(aNewValue);
         }
     }
 }
commit da907c7b7a328d29d5ede8d43f539811856417f9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 3 14:55:26 2015 +0100

    Related: tdf#82998 rearrange, no logic change
    
    Change-Id: I1d3a6a552bd535622009b43e0633a357b1a919e6

diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index f9aed93..31217a2 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -258,56 +258,63 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList)
             }
         }
     }
-    if (m_aBoxType == COMBOBOX && b_IsDropDownList)
+
+    if (m_aBoxType == COMBOBOX)
     {
-        //VCLXAccessibleDropDownComboBox
-        //when in list is dropped down, xText = NULL
-        if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
+        if (b_IsDropDownList)
         {
-            if ( aNewValue.hasValue() || aOldValue.hasValue() )
+            //VCLXAccessibleDropDownComboBox
+            //when in list is dropped down, xText = NULL
+            if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
             {
-                NotifyAccessibleEvent(
-                    AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-                    aOldValue,
-                    aNewValue );
+                if ( aNewValue.hasValue() || aOldValue.hasValue() )
+                {
+                    NotifyAccessibleEvent(
+                        AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+                        aOldValue,
+                        aNewValue );
 
-                NotifyListItem(aNewValue);
+                    NotifyListItem(aNewValue);
 
+                }
             }
         }
+        else
+        {
+            //VCLXAccessibleComboBox
+            NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, uno::Any(), uno::Any() );
+        }
     }
-    else if (m_aBoxType == COMBOBOX && !b_IsDropDownList)
-    {
-        //VCLXAccessibleComboBox
-        NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, uno::Any(), uno::Any() );
-    }
-    else if (m_aBoxType == LISTBOX && b_IsDropDownList)
+    else if (m_aBoxType == LISTBOX)
     {
-        //VCLXAccessibleDropdownListBox
-        //when in list is dropped down, xText = NULL
-        if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
+        if (b_IsDropDownList)
         {
-            if ( aNewValue.hasValue() || aOldValue.hasValue() )
+            //VCLXAccessibleDropdownListBox
+            //when in list is dropped down, xText = NULL
+            if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown())
             {
-                NotifyAccessibleEvent(
-                    AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-                    aOldValue,
-                    aNewValue );
+                if ( aNewValue.hasValue() || aOldValue.hasValue() )
+                {
+                    NotifyAccessibleEvent(
+                        AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+                        aOldValue,
+                        aNewValue );
 
-                NotifyListItem(aNewValue);
+                    NotifyListItem(aNewValue);
+                }
             }
         }
-    }
-    else if (m_aBoxType == LISTBOX && !b_IsDropDownList)
-    {
-        if ( aNewValue.hasValue() || aOldValue.hasValue() )
+        else
         {
-            NotifyAccessibleEvent(
-                    AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
-                    aOldValue,
-                    aNewValue );
+            if ( aNewValue.hasValue() || aOldValue.hasValue() )
+            {
+                NotifyAccessibleEvent(
+                        AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+                        aOldValue,
+                        aNewValue );
 
-            NotifyListItem(aNewValue);
+                NotifyListItem(aNewValue);
+            }
         }
     }
 }
commit 835fcfacc66601299aa73cd5423e8277ccd8fc34
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 3 14:18:04 2015 +0100

    Related: tdf#82998 assume VALUE_CHANGED makes sense only for windows
    
    jdiggs: I believe [VALUE_CHANGED] is expected for Windows' accessibility APIs.
    However for ATK/AT-SPI2, value-change events are expected only for the sorts of
    things which implement AtkValue (scrollbars, progressbars, sliders,
    spinbuttons, etc.) Combo boxes, lists, and the like should not be emitting this
    event.
    
    Change-Id: I9dcab7fb4004a24f88915f904eb508dfee2d4ae5

diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index 2519087..15e3829 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -124,10 +124,12 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
             if ( pList != NULL )
             {
                 pList->ProcessWindowEvent (rVclWindowEvent, m_bIsDropDownBox);
+#if defined WNT
                 if (m_bIsDropDownBox)
                 {
                     NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
                 }
+#endif
             }
             break;
         }
@@ -179,8 +181,10 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
                     if ( sText.isEmpty() )
                         sText = xText->getText();
                     pList->UpdateSelection_Acc(sText, m_bIsDropDownBox);
+#if defined WNT
                     if (m_bIsDropDownBox || ( !m_bIsDropDownBox && m_aBoxType==COMBOBOX))
                         NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
+#endif
                 }
             }
             break;
@@ -545,7 +549,7 @@ void VCLXAccessibleBox::FillAccessibleStateSet( utl::AccessibleStateSetHelper& r
         ListBox* pListBox = static_cast< ListBox* >( GetWindow() );
         if (pListBox != NULL && pListBox->GetEntryCount() > 0)
         {
-                nSelectedEntryCount = pListBox->GetSelectEntryCount();
+            nSelectedEntryCount = pListBox->GetSelectEntryCount();
             if ( nSelectedEntryCount == 0)
                 rStateSet.AddState(AccessibleStateType::INDETERMINATE);
         }
commit ccaeafab704b46ed8ca8c4aad3c14f6143bfc141
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 3 14:10:24 2015 +0100

    Related: tdf#82998 don't emit an Indeterminate state change for boxes
    
    Emitting object:state-changed:indeterminate is appropriate for things like
    tri-state checkboxes when the state is neither fully checked nor fully
    unchecked. ... jdiggs think that this event doesn't make sense in this instance
    for any platform's accessibility API
    
    Change-Id: Id8288522a825ad7ff61524ad4f225a79c015bb8f

diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index f7ad6ab..2519087 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -113,9 +113,8 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
         case VCLEVENT_DROPDOWN_SELECT:
         case VCLEVENT_LISTBOX_SELECT:
         case VCLEVENT_LISTBOX_FOCUSITEMCHANGED:
-
         {
-                // Forward the call to the list child.
+            // Forward the call to the list child.
             VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
             if ( pList == NULL )
             {
@@ -125,14 +124,9 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
             if ( pList != NULL )
             {
                 pList->ProcessWindowEvent (rVclWindowEvent, m_bIsDropDownBox);
-                if(m_bIsDropDownBox)
+                if (m_bIsDropDownBox)
                 {
                     NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
-                    Any aOldValue;
-                    Any aNewValue;
-                    aOldValue <<= AccessibleStateType::INDETERMINATE;
-                    NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue);
-
                 }
             }
             break;
@@ -187,12 +181,6 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
                     pList->UpdateSelection_Acc(sText, m_bIsDropDownBox);
                     if (m_bIsDropDownBox || ( !m_bIsDropDownBox && m_aBoxType==COMBOBOX))
                         NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
-
-                    Any aOldValue;
-                    Any aNewValue;
-                    aOldValue <<= AccessibleStateType::INDETERMINATE;
-                    NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue);
-
                 }
             }
             break;


More information about the Libreoffice-commits mailing list