diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-31 19:17:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-02 09:37:08 +0200 |
commit | 7541fac2c0d5341f4d362779594ae236f05ff9a6 (patch) | |
tree | 73aefef941dd91b562b84689d50625858da2d15e /vcl/source/window/builder.cxx | |
parent | 8ce0c756e64242431361059566d41495e3550d99 (diff) |
tdf#136331 implement applying atk properties to tab pages
Change-Id: I2ee57dbdb3d743fe1dd3d505a3aa2f479ffa62b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101765
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/builder.cxx')
-rw-r--r-- | vcl/source/window/builder.cxx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index d3f9febb7208..03f686f0a664 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -2599,10 +2599,14 @@ VclPtr<vcl::Window> VclBuilder::insertObject(vcl::Window *pParent, const OString void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &reader) { + TabControl *pTabControl = pParent && pParent->GetType() == WindowType::TABCONTROL ? + static_cast<TabControl*>(pParent) : nullptr; + std::vector<OString> sIDs; int nLevel = 1; stringmap aProperties; + stringmap aAtkProperties; std::vector<vcl::EnumContext::Context> context; while(true) @@ -2643,6 +2647,12 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read } else if (name == "property") collectProperty(reader, aProperties); + else if (pTabControl && name == "child") + { + // just to collect the atk properties (if any) for the label + handleChild(nullptr, &aAtkProperties, reader); + --nLevel; + } } if (res == xmlreader::XmlReader::Result::End) @@ -2658,8 +2668,6 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read if (!pParent) return; - TabControl *pTabControl = pParent->GetType() == WindowType::TABCONTROL ? - static_cast<TabControl*>(pParent) : nullptr; VerticalTabControl *pVerticalTabControl = pParent->GetType() == WindowType::VERTICALTABCONTROL ? static_cast<VerticalTabControl*>(pParent) : nullptr; assert(pTabControl || pVerticalTabControl); @@ -2676,6 +2684,20 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read TabPage* pPage = pTabControl->GetTabPage(nPageId); pPage->SetContext(context); } + + for (auto const& prop : aAtkProperties) + { + const OString &rKey = prop.first; + const OUString &rValue = prop.second; + + if (rKey == "AtkObject::accessible-name") + pTabControl->SetAccessibleName(nPageId, rValue); + else if (rKey == "AtkObject::accessible-description") + pTabControl->SetAccessibleDescription(nPageId, rValue); + else + SAL_INFO("vcl.builder", "unhandled atk property: " << rKey); + } + } else { |