sfx2/uiconfig/ui/templatepanel.ui |   16 ++++++++++++++++
 vcl/unx/gtk3/gtkinst.cxx          |    4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit a90d3a8f09f8bea3630020eda42dad6fccac18e3
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 3 17:30:30 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Feb 4 00:34:03 2025 +0100

    gtk4 a11y: Terminate gtk_accessible_update_property params
    
    As the documentation [1] describes:
    
    > A list of property and value pairs, terminated by -1.
    
    Without explicitly terminating the list by -1, gtk4 was
    seen crashing with a segfault when started after
    
        Change-Id: I8c30b6b67366d1839acb725bc4af012c276a5ee2
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Feb 3 08:41:49 2025 +0100
    
            tdf#165002 sidebar a11y: Set a11y names for styles tool buttons
    
    that triggered this preexisting issue.
    
    [1] https://docs.gtk.org/gtk4/method.Accessible.update_property.html
    
    Change-Id: If167b0723df29d4eabf813c670e4cfa842f259d3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181069
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 24d923728cd5..5001f71d11d3 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -12536,7 +12536,7 @@ public:
         atk_object_set_name(pAccessible, OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
 #else
         gtk_accessible_update_property(GTK_ACCESSIBLE(pItem), 
GTK_ACCESSIBLE_PROPERTY_LABEL,
-                                       OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
+                                       OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr(), -1);
 #endif
     }
 
@@ -12549,7 +12549,7 @@ public:
         atk_object_set_name(pAccessible, OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
 #else
         gtk_accessible_update_property(GTK_ACCESSIBLE(pItem), 
GTK_ACCESSIBLE_PROPERTY_LABEL,
-                                       OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr());
+                                       OUStringToOString(rName, 
RTL_TEXTENCODING_UTF8).getStr(), -1);
 #endif
     }
 
commit 8b221ecd50d2bd7ce84874333c06068e45c774cd
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 3 13:58:28 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Feb 4 00:33:51 2025 +0100

    tdf#165002 sidebar a11y: Set a11y names for "Styles" toolbar items in .ui
    
    Similar to how
    
        Change-Id: I8c30b6b67366d1839acb725bc4af012c276a5ee2
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Feb 3 08:41:49 2025 +0100
    
            tdf#165002 sidebar a11y: Set a11y names for styles tool buttons
    
            For the toolbar buttons to switch between the different
            styles categories ("Paragraph Styles", "Character Styles",...)
            in the "Styles" sidebar deck, set the tooltip text also as
            the accessible name.
    
            This makes the Orca screen reader with announce them
            (e.g. "Paragraph styles, toggle button, pressed") when using
            the gtk3 VCL plugin instead of just saying "toggle button", which
            doesn't give the screen reader any clue what those buttons are for.
    
    did for those toolbar buttons whose tooltips etc. are set in
    C++ code, also set a11y names for those that are handled in
    the .ui file and set the text used for the tooltip also
    as the accessible name, so Orca can announce those as well.
    This makes Orca also announce the items in the right-hand
    side toolbar of the "Styles" sidebar deck when using the
    gtk3 VCL plugin.
    
    Change-Id: Iaf68ec56049feceaf27be5f62cf631a81bf0f50e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181039
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sfx2/uiconfig/ui/templatepanel.ui 
b/sfx2/uiconfig/ui/templatepanel.ui
index 60b8b574ca04..541cf8bc5f91 100644
--- a/sfx2/uiconfig/ui/templatepanel.ui
+++ b/sfx2/uiconfig/ui/templatepanel.ui
@@ -133,6 +133,7 @@
                     <property name="icon-name">res/sc05554.png</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="watercan-atkobject">
+                        <property name="AtkObject::accessible-name" 
translatable="yes" context="templatepanel|accessible_name|watercan">Fill Format 
Mode</property>
                         <property name="AtkObject::accessible-description" 
translatable="yes" context="templatepanel|extended_tip|watercan">Applies the 
selected style to the object or text that you select in the document. 
</property>
                       </object>
                     </child>
@@ -148,6 +149,11 @@
                     <property name="tooltip-text" translatable="yes" 
context="templatepanel|STR_STYLE_NEW_STYLE_FROM_SELECTION">New Style from 
Selection</property>
                     <property name="use-underline">True</property>
                     <property name="icon-name">res/sc05555.png</property>
+                    <child internal-child="accessible">
+                      <object class="AtkObject" id="new-atkobject">
+                        <property name="AtkObject::accessible-name" 
translatable="yes" context="templatepanel|accessible_name|new">New Style from 
Selection</property>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -160,6 +166,11 @@
                     <property name="tooltip-text" translatable="yes" 
context="templatepanel|STR_STYLE_NEW_STYLE_ACTION">Styles actions</property>
                     <property name="use-underline">True</property>
                     <property name="icon-name">res/sc05555.png</property>
+                    <child internal-child="accessible">
+                      <object class="AtkObject" id="newmenu-atkobject">
+                        <property name="AtkObject::accessible-name" 
translatable="yes" context="templatepanel|accessible_name|newmenu">Styles 
actions</property>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -172,6 +183,11 @@
                     <property name="tooltip-text" translatable="yes" 
context="templatepanel|STR_STYLE_UPDATE_STYLE">Update Style</property>
                     <property name="use-underline">True</property>
                     <property name="icon-name">res/sc05556.png</property>
+                    <child internal-child="accessible">
+                      <object class="AtkObject" id="update-atkobject">
+                        <property name="AtkObject::accessible-name" 
translatable="yes" context="templatepanel|accessible_name|update">Update 
Style</property>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>

Reply via email to