summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/a11y
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-02 12:39:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-03 21:55:24 +0200
commit7e64aaebce8667f7ab173ea3807c62f81138b4af (patch)
tree0fe1c975221f32b742a8a09aa05ed431b55f8d9a /vcl/unx/gtk/a11y
parent55fcb23ea5caa509d8254910c581d234f7ec9199 (diff)
weld SvxTextAttrPage
with a a11y rework to be more like the insert special char a11y also, route a11y questions about a custom widgets parent to the gtk toolkits underlying default implementation, keeping only questions about ourself to be handled by the XAccessible focus rectangles in RectCtl work again, seems that got lost somewhere along the way Change-Id: I62237d45668f4438aec6031cc5a48c38de21bf98 Reviewed-on: https://gerrit.libreoffice.org/53767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk/a11y')
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx13
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.hxx3
2 files changed, 14 insertions, 2 deletions
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index 33ec9caabb14..baae426bc6d1 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -468,6 +468,11 @@ static gint
wrapper_get_index_in_parent( AtkObject *atk_obj )
{
AtkObjectWrapper *obj = ATK_OBJECT_WRAPPER (atk_obj);
+
+ //if we're a native GtkDrawingArea with custom a11y, use the default toolkit index in parent
+ if (obj->mpOrig)
+ return atk_object_get_index_in_parent(obj->mpOrig);
+
gint i = -1;
if( obj->mpContext.is() )
@@ -488,6 +493,11 @@ static AtkRelationSet *
wrapper_ref_relation_set( AtkObject *atk_obj )
{
AtkObjectWrapper *obj = ATK_OBJECT_WRAPPER (atk_obj);
+
+ //if we're a native GtkDrawingArea with custom a11y, use the default toolkit relation set impl
+ if (obj->mpOrig)
+ return atk_object_ref_relation_set(obj->mpOrig);
+
AtkRelationSet *pSet = atk_relation_set_new();
if( obj->mpContext.is() )
@@ -797,7 +807,7 @@ atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAc
AtkObject *
atk_object_wrapper_new( const css::uno::Reference< css::accessibility::XAccessible >& rxAccessible,
- AtkObject* parent )
+ AtkObject* parent, AtkObject* orig )
{
g_return_val_if_fail( rxAccessible.get() != nullptr, nullptr );
@@ -818,6 +828,7 @@ atk_object_wrapper_new( const css::uno::Reference< css::accessibility::XAccessib
pWrap->child_about_to_be_removed = nullptr;
pWrap->mpContext = xContext;
+ pWrap->mpOrig = orig;
AtkObject* atk_obj = ATK_OBJECT(pWrap);
atk_obj->role = mapToAtkRole( xContext->getAccessibleRole() );
diff --git a/vcl/unx/gtk/a11y/atkwrapper.hxx b/vcl/unx/gtk/a11y/atkwrapper.hxx
index e8ab83b5c778..0cb3f7b1c907 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.hxx
@@ -43,6 +43,7 @@ namespace com { namespace sun { namespace star { namespace accessibility {
struct AtkObjectWrapper
{
AtkObject aParent;
+ AtkObject* mpOrig; //if we're a GtkDrawingArea acting as a custom LibreOffice widget, this is the toolkit default impl
css::uno::Reference<css::accessibility::XAccessible> mpAccessible;
css::uno::Reference<css::accessibility::XAccessibleContext> mpContext;
@@ -79,7 +80,7 @@ AtkObject * atk_object_wrapper_ref(
AtkObject * atk_object_wrapper_new(
const css::uno::Reference< css::accessibility::XAccessible >& rxAccessible,
- AtkObject* parent = nullptr );
+ AtkObject* parent = nullptr, AtkObject* orig = nullptr );
void atk_object_wrapper_add_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);