Kaydet (Commit) 5732db01 authored tarafından Samuel Thibault's avatar Samuel Thibault Kaydeden (comit) Thorsten Behrens

tdf#116542 a11y: Implement .ui ways of setting widget role

Atk-LO correspondance in getRoleFromName() was built on
vcl/unx/gtk/a11y/atkwrapper.cxx's correspondance, with the same "?"
uncertainties, plus some approximations.

Change-Id: I2e3a5042d4c9dabbab5407397373a373ee1caa6d
Reviewed-on: https://gerrit.libreoffice.org/58767
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 414ef6cb
......@@ -354,7 +354,8 @@ private:
void applyPackingProperty(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader);
void collectProperty(xmlreader::XmlReader &reader, stringmap &rVec) const;
static void collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap);
static void collectAtkAttribute(xmlreader::XmlReader &reader, stringmap &rMap);
static void collectAtkRelationAttribute(xmlreader::XmlReader &reader, stringmap &rMap);
static void collectAtkRoleAttribute(xmlreader::XmlReader &reader, stringmap &rMap);
static void collectAccelerator(xmlreader::XmlReader &reader, accelmap &rMap);
void insertMenuObject(
......@@ -411,6 +412,9 @@ namespace BuilderUtils
//Helpers to retrofit all the existing code to the builder
VCL_DLLPUBLIC void reorderWithinParent(std::vector< vcl::Window*>& rChilds, bool bIsButtonBox);
VCL_DLLPUBLIC void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition);
//Convert an accessibility role name to accessibility role number
VCL_DLLPUBLIC sal_Int16 getRoleFromName(const OString& roleName);
}
template <typename T>
......
This diff is collapsed.
......@@ -34,6 +34,7 @@
#include <vcl/dockwin.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/settings.hxx>
#include <vcl/builder.hxx>
#include <window.h>
#include <fontinstance.hxx>
......@@ -44,6 +45,8 @@
#include <salframe.hxx>
#include <scrwnd.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
using namespace com::sun::star;
namespace vcl {
......@@ -1582,6 +1585,12 @@ bool Window::set_property(const OString &rKey, const OUString &rValue)
{
SetAccessibleDescription(rValue);
}
else if (rKey == "accessible-role")
{
sal_Int16 role = BuilderUtils::getRoleFromName(rValue.toUtf8());
if (role != com::sun::star::accessibility::AccessibleRole::UNKNOWN)
SetAccessibleRole(role);
}
else if (rKey == "use-markup")
{
//https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment