summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-17 21:01:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-19 12:10:13 +0100
commit7bf4edd62fd0e34a0bd79cc918155ac5043b091b (patch)
tree8e82d0dc6609329a5291844d588b0377c252981e /vcl
parent62c634d6e8d55f71fa9ebd8c4b78774f8946f39d (diff)
weld SwFieldDBPage
Change-Id: Ic4919fa3caa2106598ed8da3cec5deffa506eee1 Reviewed-on: https://gerrit.libreoffice.org/69401 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx12
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx40
2 files changed, 52 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 47f2ecda410f..7173f8ad5b03 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -468,6 +468,18 @@ public:
return m_xWidget->GetAccessibleDescription();
}
+ virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) override
+ {
+ vcl::Window* pAtkLabel = pLabel ? dynamic_cast<SalInstanceWidget&>(*pLabel).getWidget() : nullptr;
+ m_xWidget->SetAccessibleRelationLabeledBy(pAtkLabel);
+ }
+
+ virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) override
+ {
+ vcl::Window* pAtkLabeled = pLabeled ? dynamic_cast<SalInstanceWidget&>(*pLabeled).getWidget() : nullptr;
+ m_xWidget->SetAccessibleRelationLabelFor(pAtkLabeled);
+ }
+
virtual void set_tooltip_text(const OUString& rTip) override
{
m_xWidget->SetQuickHelpText(rTip);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 2a7551456922..2056ea4068e5 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1718,6 +1718,46 @@ public:
return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
}
+ virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) override
+ {
+ AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget);
+ if (!pAtkObject)
+ return;
+ AtkObject *pAtkLabel = pLabel ? gtk_widget_get_accessible(dynamic_cast<GtkInstanceWidget&>(*pLabel).getWidget()) : nullptr;
+ AtkRelationSet *pRelationSet = atk_object_ref_relation_set(pAtkObject);
+ AtkRelation *pRelation = atk_relation_set_get_relation_by_type(pRelationSet, ATK_RELATION_LABELLED_BY);
+ if (pRelation)
+ atk_relation_set_remove(pRelationSet, pRelation);
+ if (pAtkLabel)
+ {
+ AtkObject *obj_array[1];
+ obj_array[0] = pAtkLabel;
+ pRelation = atk_relation_new(obj_array, 1, ATK_RELATION_LABELLED_BY);
+ atk_relation_set_add(pRelationSet, pRelation);
+ }
+ g_object_unref(pRelationSet);
+ }
+
+ virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) override
+ {
+ AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget);
+ if (!pAtkObject)
+ return;
+ AtkObject *pAtkLabeled = pLabeled ? gtk_widget_get_accessible(dynamic_cast<GtkInstanceWidget&>(*pLabeled).getWidget()) : nullptr;
+ AtkRelationSet *pRelationSet = atk_object_ref_relation_set(pAtkObject);
+ AtkRelation *pRelation = atk_relation_set_get_relation_by_type(pRelationSet, ATK_RELATION_LABEL_FOR);
+ if (pRelation)
+ atk_relation_set_remove(pRelationSet, pRelation);
+ if (pAtkLabeled)
+ {
+ AtkObject *obj_array[1];
+ obj_array[0] = pAtkLabeled;
+ pRelation = atk_relation_new(obj_array, 1, ATK_RELATION_LABEL_FOR);
+ atk_relation_set_add(pRelationSet, pRelation);
+ }
+ g_object_unref(pRelationSet);
+ }
+
virtual bool get_extents_relative_to(weld::Widget& rRelative, int& x, int &y, int& width, int &height) override
{
//for toplevel windows this is sadly futile under wayland, so we can't tell where a dialog is in order to allow