summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--offapi/com/sun/star/accessibility/AccessibleEventId.idl7
-rw-r--r--sw/source/core/access/accpara.cxx11
-rw-r--r--vcl/unx/gtk/a11y/atklistener.cxx8
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx8
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.hxx1
5 files changed, 34 insertions, 1 deletions
diff --git a/offapi/com/sun/star/accessibility/AccessibleEventId.idl b/offapi/com/sun/star/accessibility/AccessibleEventId.idl
index 7e31996da099..20d0d0553e58 100644
--- a/offapi/com/sun/star/accessibility/AccessibleEventId.idl
+++ b/offapi/com/sun/star/accessibility/AccessibleEventId.idl
@@ -380,6 +380,13 @@ constants AccessibleEventId
const short PAGE_CHANGED =38;
const short SECTION_CHANGED =39;
const short COLUMN_CHANGED =40;
+
+ /** Constant used to indicate that the role of an accessible object has
+ changed.
+
+ @since LibreOffice 4.3
+ */
+ const short ROLE_CHANGED =41;
};
}; }; }; };
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index b4baca386757..6dcfb8b3e515 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -440,7 +440,16 @@ void SwAccessibleParagraph::_InvalidateContent( sal_Bool bVisibleDataFired )
bIsHeading = bNewIsHeading;
}
- if( bNewIsHeading != bOldIsHeading || rText != sOldText )
+ if( bNewIsHeading != bOldIsHeading )
+ {
+ // The role has changed
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::ROLE_CHANGED;
+
+ FireAccessibleEvent( aEvent );
+ }
+
+ if( rText != sOldText )
{
OUString sNewDesc( GetDescription() );
OUString sOldDesc;
diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx
index f1614d8ed512..f13a0a318601 100644
--- a/vcl/unx/gtk/a11y/atklistener.cxx
+++ b/vcl/unx/gtk/a11y/atklistener.cxx
@@ -549,6 +549,14 @@ void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEven
g_signal_emit_by_name( G_OBJECT( atk_obj ), "property_change::accessible-hypertext-offset");
break;
+ case accessibility::AccessibleEventId::ROLE_CHANGED:
+ {
+ uno::Reference< accessibility::XAccessibleContext > xContext;
+ xContext = getAccessibleContextFromSource( aEvent.Source );
+ atk_object_wrapper_set_role( mpWrapper, xContext->getAccessibleRole() );
+ break;
+ }
+
default:
g_warning( "Unknown event notification %d", aEvent.EventId );
break;
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index ab0b2753fd4e..5b4da2389e38 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -877,6 +877,14 @@ void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child
/*****************************************************************************/
+void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role)
+{
+ AtkObject *atk_obj = ATK_OBJECT( wrapper );
+ atk_object_set_role( atk_obj, mapToAtkRole( role ) );
+}
+
+/*****************************************************************************/
+
#define RELEASE(i) if( i ) { i->release(); i = NULL; }
void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper)
diff --git a/vcl/unx/gtk/a11y/atkwrapper.hxx b/vcl/unx/gtk/a11y/atkwrapper.hxx
index 2b018b92a9fe..02126cbc541f 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.hxx
@@ -84,6 +84,7 @@ AtkObject * atk_object_wrapper_new(
void atk_object_wrapper_add_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
+void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role);
void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper);