bin/find-can-be-private-symbols.functions.results |    1 
 bin/gla11y                                        |    5 +
 include/vcl/window.hxx                            |    1 
 sw/uiconfig/swriter/ui/sortdialog.ui              |   61 +++++++++++++++++-----
 vcl/inc/window.h                                  |    1 
 vcl/source/window/accessibility.cxx               |   11 ---
 vcl/source/window/builder.cxx                     |    2 
 vcl/unx/gtk4/convert3to4.cxx                      |   11 +++
 8 files changed, 61 insertions(+), 32 deletions(-)

New commits:
commit c9efbdbfaf110c18576b7294b72cd03dad310720
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Mar 8 12:36:01 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Mar 8 17:01:26 2022 +0100

    replace member-of in .ui a11y relations
    
    Change-Id: I454c945c5ce17bcc1834923064014b43a0b45be7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131186
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/bin/find-can-be-private-symbols.functions.results 
b/bin/find-can-be-private-symbols.functions.results
index 137b54d7a903..82e5f0c55912 100644
--- a/bin/find-can-be-private-symbols.functions.results
+++ b/bin/find-can-be-private-symbols.functions.results
@@ -23185,7 +23185,6 @@ vcl::Window::SaveFocus()
 vcl::Window::SetAccessibleDescription(rtl::OUString const&)
 vcl::Window::SetAccessibleRelationLabelFor(vcl::Window*)
 vcl::Window::SetAccessibleRelationLabeledBy(vcl::Window*)
-vcl::Window::SetAccessibleRelationMemberOf(vcl::Window*)
 vcl::Window::SetActivateMode(ActivateModeFlags)
 vcl::Window::SetDumpAsPropertyTreeHdl(Link<tools::JsonWriter&, void> const&)
 vcl::Window::SetFakeFocus(bool)
diff --git a/bin/gla11y b/bin/gla11y
index 7376f672d866..c3ae7be67604 100755
--- a/bin/gla11y
+++ b/bin/gla11y
@@ -1069,8 +1069,9 @@ def check_a11y_relation(filename, tree):
             if len(mnemonic_for_elm[oid]) > 1:
                 warn(filename, tree, obj, "duplicate-mnemonic", "is referenced 
by multiple mnemonic_widget " + elms_names_lines(mnemonic_for_elm[oid]))
 
-        # Check member-of
-        member_of = check_rels(filename, tree, root, obj, "member-of")
+        # Check controlled-by/controller-for
+        controlled_by = check_rels(filename, tree, root, obj, "controlled-by", 
"controller-for")
+        controller_for = check_rels(filename, tree, root, obj, 
"controlled-for", "controlled-by")
 
         # Labels special case
         if klass in widgets_labels:
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 08c87993b65e..4ce1cf44a388 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1158,7 +1158,6 @@ public:
     void                                SetAccessibleRelationLabelFor( 
vcl::Window* pLabelFor );
     vcl::Window*                        GetAccessibleRelationLabelFor() const;
 
-    void                                SetAccessibleRelationMemberOf( 
vcl::Window* pMemberOf );
     vcl::Window*                        GetAccessibleRelationMemberOf() const;
 
     // to avoid sending accessibility events in cases like closing dialogs
diff --git a/sw/uiconfig/swriter/ui/sortdialog.ui 
b/sw/uiconfig/swriter/ui/sortdialog.ui
index b3566b7aa71d..2295168fc042 100644
--- a/sw/uiconfig/swriter/ui/sortdialog.ui
+++ b/sw/uiconfig/swriter/ui/sortdialog.ui
@@ -153,6 +153,14 @@
                         <property name="visible">True</property>
                         <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="sortdialog|order">Order</property>
+                        <accessibility>
+                          <relation type="label-for" target="up1"/>
+                          <relation type="label-for" target="down1"/>
+                          <relation type="label-for" target="up2"/>
+                          <relation type="label-for" target="down2"/>
+                          <relation type="label-for" target="up3"/>
+                          <relation type="label-for" target="down3"/>
+                        </accessibility>
                       </object>
                       <packing>
                         <property name="left-attach">3</property>
@@ -175,7 +183,8 @@
                             <property name="active">True</property>
                             <property name="draw-indicator">True</property>
                             <accessibility>
-                              <relation type="member-of" target="key1"/>
+                              <relation type="controlled-by" target="key1"/>
+                              <relation type="labelled-by" target="order"/>
                             </accessibility>
                             <child internal-child="accessible">
                               <object class="AtkObject" id="up1-atkobject">
@@ -198,7 +207,8 @@
                             <property name="draw-indicator">True</property>
                             <property name="group">up1</property>
                             <accessibility>
-                              <relation type="member-of" target="key1"/>
+                              <relation type="controlled-by" target="key1"/>
+                              <relation type="labelled-by" target="order"/>
                             </accessibility>
                             <child internal-child="accessible">
                               <object class="AtkObject" id="down1-atkobject">
@@ -233,7 +243,8 @@
                             <property name="active">True</property>
                             <property name="draw-indicator">True</property>
                             <accessibility>
-                              <relation type="member-of" target="key2"/>
+                              <relation type="controlled-by" target="key2"/>
+                              <relation type="labelled-by" target="order"/>
                             </accessibility>
                             <child internal-child="accessible">
                               <object class="AtkObject" id="up2-atkobject">
@@ -256,7 +267,8 @@
                             <property name="draw-indicator">True</property>
                             <property name="group">up2</property>
                             <accessibility>
-                              <relation type="member-of" target="key2"/>
+                              <relation type="controlled-by" target="key2"/>
+                              <relation type="labelled-by" target="order"/>
                             </accessibility>
                             <child internal-child="accessible">
                               <object class="AtkObject" id="down2-atkobject">
@@ -291,7 +303,8 @@
                             <property name="active">True</property>
                             <property name="draw-indicator">True</property>
                             <accessibility>
-                              <relation type="member-of" target="key3"/>
+                              <relation type="controlled-by" target="key3"/>
+                              <relation type="labelled-by" target="order"/>
                             </accessibility>
                             <child internal-child="accessible">
                               <object class="AtkObject" id="up3-atkobject">
@@ -314,7 +327,8 @@
                             <property name="draw-indicator">True</property>
                             <property name="group">up3</property>
                             <accessibility>
-                              <relation type="member-of" target="key3"/>
+                              <relation type="controlled-by" target="key3"/>
+                              <relation type="labelled-by" target="order"/>
                             </accessibility>
                             <child internal-child="accessible">
                               <object class="AtkObject" id="down3-atkobject">
@@ -343,6 +357,12 @@
                         <property name="use-underline">True</property>
                         <property name="active">True</property>
                         <property name="draw-indicator">True</property>
+                        <accessibility>
+                          <relation type="controller-for" target="up1"/>
+                          <relation type="controller-for" target="down1"/>
+                          <relation type="controller-for" target="colsb1"/>
+                          <relation type="controller-for" target="typelb1"/>
+                        </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="key1-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="sortdialog|extended_tip|key1">Specifies additional 
sorting criteria. You can also combine sort keys.</property>
@@ -363,6 +383,12 @@
                         <property name="valign">center</property>
                         <property name="use-underline">True</property>
                         <property name="draw-indicator">True</property>
+                        <accessibility>
+                          <relation type="controller-for" target="up2"/>
+                          <relation type="controller-for" target="down2"/>
+                          <relation type="controller-for" target="colsb2"/>
+                          <relation type="controller-for" target="typelb2"/>
+                        </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="key2-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="sortdialog|extended_tip|key2">Specifies additional 
sorting criteria. You can also combine sort keys.</property>
@@ -383,6 +409,12 @@
                         <property name="valign">center</property>
                         <property name="use-underline">True</property>
                         <property name="draw-indicator">True</property>
+                        <accessibility>
+                          <relation type="controller-for" target="up3"/>
+                          <relation type="controller-for" target="down3"/>
+                          <relation type="controller-for" target="colsb3"/>
+                          <relation type="controller-for" target="typelb3"/>
+                        </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="key3-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="sortdialog|extended_tip|key3">Specifies additional 
sorting criteria. You can also combine sort keys.</property>
@@ -403,8 +435,8 @@
                         <property name="truncate-multiline">True</property>
                         <property name="adjustment">adjustment1</property>
                         <accessibility>
+                          <relation type="controlled-by" target="key1"/>
                           <relation type="labelled-by" target="column"/>
-                          <relation type="member-of" target="key1"/>
                         </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="colsb1-atkobject">
@@ -426,8 +458,8 @@
                         <property name="truncate-multiline">True</property>
                         <property name="adjustment">adjustment2</property>
                         <accessibility>
+                          <relation type="controlled-by" target="key2"/>
                           <relation type="labelled-by" target="column"/>
-                          <relation type="member-of" target="key2"/>
                         </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="colsb2-atkobject">
@@ -449,8 +481,8 @@
                         <property name="truncate-multiline">True</property>
                         <property name="adjustment">adjustment3</property>
                         <accessibility>
+                          <relation type="controlled-by" target="key3"/>
                           <relation type="labelled-by" target="column"/>
-                          <relation type="member-of" target="key3"/>
                         </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="colsb3-atkobject">
@@ -470,8 +502,8 @@
                         <property name="valign">center</property>
                         <property name="hexpand">True</property>
                         <accessibility>
+                          <relation type="controlled-by" target="key1"/>
                           <relation type="labelled-by" target="keytype"/>
-                          <relation type="member-of" target="key1"/>
                         </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="typelb1-atkobject">
@@ -493,8 +525,8 @@
                         <property name="valign">center</property>
                         <property name="hexpand">True</property>
                         <accessibility>
+                          <relation type="controlled-by" target="key2"/>
                           <relation type="labelled-by" target="keytype"/>
-                          <relation type="member-of" target="key2"/>
                         </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="typelb2-atkobject">
@@ -515,8 +547,8 @@
                         <property name="valign">center</property>
                         <property name="hexpand">True</property>
                         <accessibility>
+                          <relation type="controlled-by" target="key3"/>
                           <relation type="labelled-by" target="keytype"/>
-                          <relation type="member-of" target="key3"/>
                         </accessibility>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="typelb3-atkobject">
@@ -680,6 +712,8 @@
                             <property name="draw-indicator">True</property>
                             <property name="group">tabs</property>
                             <accessibility>
+                              <relation type="controller-for" 
target="separator"/>
+                              <relation type="controller-for" 
target="delimpb"/>
                               <relation type="label-for" target="separator"/>
                               <relation type="label-for" target="delimpb"/>
                             </accessibility>
@@ -711,6 +745,7 @@
                                 <property name="max-width-chars">1</property>
                                 <property 
name="truncate-multiline">True</property>
                                 <accessibility>
+                                  <relation type="controlled-by" 
target="character"/>
                                   <relation type="labelled-by" 
target="character"/>
                                 </accessibility>
                                 <child internal-child="accessible">
@@ -731,8 +766,8 @@
                                 <property name="can-focus">True</property>
                                 <property 
name="receives-default">True</property>
                                 <accessibility>
+                                  <relation type="controlled-by" 
target="character"/>
                                   <relation type="labelled-by" 
target="character"/>
-                                  <relation type="member-of" 
target="character"/>
                                 </accessibility>
                                 <child internal-child="accessible">
                                   <object class="AtkObject" 
id="delimpb-atkobject">
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index b5ef63ab327c..903e857037aa 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -193,7 +193,6 @@ struct ImplAccessibleInfos
                         pAccessibleDescription;
     VclPtr<vcl::Window> pLabeledByWindow;
     VclPtr<vcl::Window> pLabelForWindow;
-    VclPtr<vcl::Window> pMemberOfWindow;
 
     ImplAccessibleInfos();
     ~ImplAccessibleInfos();
diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 238eacc0518e..d332da62a36d 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -46,7 +46,6 @@ ImplAccessibleInfos::ImplAccessibleInfos()
     nAccessibleRole = 0xFFFF;
     pLabeledByWindow = nullptr;
     pLabelForWindow = nullptr;
-    pMemberOfWindow = nullptr;
 }
 
 ImplAccessibleInfos::~ImplAccessibleInfos()
@@ -490,18 +489,8 @@ void Window::SetAccessibleRelationLabelFor( vcl::Window* 
pLabelFor )
     mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
 }
 
-void Window::SetAccessibleRelationMemberOf( vcl::Window* pMemberOfWin )
-{
-    if ( !mpWindowImpl->mpAccessibleInfos )
-        mpWindowImpl->mpAccessibleInfos.reset( new ImplAccessibleInfos );
-    mpWindowImpl->mpAccessibleInfos->pMemberOfWindow = pMemberOfWin;
-}
-
 vcl::Window* Window::GetAccessibleRelationMemberOf() const
 {
-    if (mpWindowImpl->mpAccessibleInfos && 
mpWindowImpl->mpAccessibleInfos->pMemberOfWindow)
-        return mpWindowImpl->mpAccessibleInfos->pMemberOfWindow;
-
     if (!isContainerWindow(this) && !isContainerWindow(GetParent()))
         return getLegacyNonLayoutAccessibleRelationMemberOf();
 
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 9a5b1271a6f8..83800c16b09e 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -518,8 +518,6 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const 
OUString& sUIDir, const OUStr
                     pSource->SetAccessibleRelationLabeledBy(pTarget);
                 else if (rType == "label-for")
                     pSource->SetAccessibleRelationLabelFor(pTarget);
-                else if (rType == "member-of")
-                    pSource->SetAccessibleRelationMemberOf(pTarget);
                 else
                 {
                     SAL_WARN("vcl.builder", "unhandled a11y relation :" << 
rType);
diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index 6d7caeaa3c78..747ea7553093 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -901,6 +901,12 @@ ConvertResult Convert3To4(const 
css::uno::Reference<css::xml::dom::XNode>& xNode
                 // there will be a matching labelled-by which should be 
sufficient in the gtk4 world
                 xRemoveList.push_back(xChild);
             }
+            if (xType->getNodeValue() == "controlled-by")
+            {
+                // there will be a matching controller-for converted to -> 
controls
+                // which should be sufficient in the gtk4 world
+                xRemoveList.push_back(xChild);
+            }
             else
             {
                 css::uno::Reference<css::xml::dom::XNode> xTarget = 
xMap->getNamedItem("target");
@@ -910,7 +916,10 @@ ConvertResult Convert3To4(const 
css::uno::Reference<css::xml::dom::XNode>& xNode
                 xChild->appendChild(xValue);
 
                 css::uno::Reference<css::xml::dom::XAttr> xName = 
xDoc->createAttribute("name");
-                xName->setValue(xType->getNodeValue());
+                if (xType->getNodeValue() == "controller-for")
+                    xName->setValue("controls");
+                else
+                    xName->setValue(xType->getNodeValue());
 
                 css::uno::Reference<css::xml::dom::XElement> xElem(xChild,
                                                                    
css::uno::UNO_QUERY_THROW);

Reply via email to