summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/a11y/atkwrapper.cxx
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2015-02-03 16:48:01 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2015-02-05 14:06:34 +0100
commit1e6515e64cb4a40071e09d5df000a94f96311ea1 (patch)
tree5a7b91ddd1d8ca6abeefdb8784ff3ae24231b613 /vcl/unx/gtk/a11y/atkwrapper.cxx
parent119d9c33b03790d52d57a27854064ec554a5777c (diff)
tdf#84102: Expose XAccessibleExtendedAttributes through ATK
Those attributes contain a lot of interesting properties, among them the heading level which fixes this bug. Change-Id: I634ef404123cb1b2831563b9b186db4b7e9e7d8b
Diffstat (limited to 'vcl/unx/gtk/a11y/atkwrapper.cxx')
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index 6d972ffba7ab..80f347888f68 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
#include <com/sun/star/accessibility/XAccessibleImage.hpp>
#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
@@ -62,6 +63,7 @@
#include "atkwrapper.hxx"
#include "atkregistry.hxx"
#include "atklistener.hxx"
+#include "atktextattributes.hxx"
#ifdef ENABLE_TRACING
#include <stdio.h>
@@ -395,6 +397,33 @@ wrapper_get_description( AtkObject *atk_obj )
/*****************************************************************************/
+static AtkAttributeSet *
+wrapper_get_attributes( AtkObject *atk_obj )
+{
+ AtkObjectWrapper *obj = ATK_OBJECT_WRAPPER( atk_obj );
+ AtkAttributeSet *pSet = NULL;
+
+ if( obj->mpContext )
+ {
+ uno::Reference< accessibility::XAccessibleContext > xContext( obj->mpContext );
+ try
+ {
+ uno::Reference< accessibility::XAccessibleExtendedAttributes > xExtendedAttrs( xContext,
+ uno::UNO_QUERY );
+ if( xExtendedAttrs.is() )
+ pSet = attribute_set_new_from_extended_attributes( xExtendedAttrs );
+ }
+ catch(const uno::Exception&)
+ {
+ g_warning( "Exception in getAccessibleAttributes()" );
+ }
+ }
+
+ return pSet;
+}
+
+/*****************************************************************************/
+
static gint
wrapper_get_n_children( AtkObject *atk_obj )
{
@@ -601,6 +630,7 @@ atk_object_wrapper_class_init (AtkObjectWrapperClass *klass)
// AtkObject methods
atk_class->get_name = wrapper_get_name;
atk_class->get_description = wrapper_get_description;
+ atk_class->get_attributes = wrapper_get_attributes;
atk_class->get_n_children = wrapper_get_n_children;
atk_class->ref_child = wrapper_ref_child;
atk_class->get_index_in_parent = wrapper_get_index_in_parent;