[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 4 commits - offapi/com sw/source vcl/unx
Caolán McNamara
caolanm at redhat.com
Fri Jun 20 03:38:16 PDT 2014
offapi/com/sun/star/accessibility/AccessibleEventId.idl | 7 ++++
sw/source/core/access/accpara.cxx | 11 ++++++
vcl/unx/gtk/a11y/atklistener.cxx | 8 ++++
vcl/unx/gtk/a11y/atkwrapper.cxx | 26 ++++++++++++----
vcl/unx/gtk/a11y/atkwrapper.hxx | 1
5 files changed, 47 insertions(+), 6 deletions(-)
New commits:
commit 6e791a6a1e170bb46765848411bf23d39738e4a3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 6 10:23:03 2014 +0000
coverity#736301 the 2nd arg is a gpointer
Change-Id: I66e57d570c5ae70e69eea2d44812a72a3b67509e
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index 5b4da23..b93f6eb 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -599,7 +599,7 @@ atk_object_wrapper_class_init (AtkObjectWrapperClass *klass)
static void
atk_object_wrapper_init (AtkObjectWrapper *wrapper,
- AtkObjectWrapperClass)
+ AtkObjectWrapperClass*)
{
wrapper->mpAction = NULL;
wrapper->mpComponent = NULL;
commit e9f0fb287cb58d7139bc39e0df89a2b521816aab
Author: Jacobo Aragunde Pérez <jaragunde at igalia.com>
Date: Tue Feb 4 15:07:51 2014 +0100
fdo#35105: notify role change through a new UNO a11y event
A new UNO accessibility event called ROLE_CHANGED has been created.
It should be triggered when an accessible object changes its role and
every accessibility toolkit should use its own methods to make that
change effective.
Code to support the event in ATK has been added.
Change-Id: I132e303bdb148967231334458c3cfa369c36ec8f
Reviewed-on: https://gerrit.libreoffice.org/7853
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/offapi/com/sun/star/accessibility/AccessibleEventId.idl b/offapi/com/sun/star/accessibility/AccessibleEventId.idl
index 7e31996..20d0d05 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 b4baca3..6dcfb8b 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 f1614d8..f13a0a3 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 ab0b275..5b4da23 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 2b018b9..02126cb 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);
commit 3d7a2e3e5b673600f9f68c2e2dd0d040f4333e93
Author: Jacobo Aragunde Pérez <jaragunde at igalia.com>
Date: Tue Feb 4 19:30:53 2014 +0100
fdo#39944: fallback for DOCUMENT_* roles in ATK < 2.1.0
Set fallback to DOCUMENT_FRAME role.
Change-Id: Ib83cd2f9881bcdec7b69a7660cf4166a612aaf60
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index 7da3cbc..ab0b275 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -276,6 +276,11 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
, ATK_ROLE_DOCUMENT_PRESENTATION
, ATK_ROLE_DOCUMENT_SPREADSHEET
, ATK_ROLE_DOCUMENT_TEXT
+#else
+ //older version should fallback to DOCUMENT_FRAME role
+ , ATK_ROLE_DOCUMENT_FRAME
+ , ATK_ROLE_DOCUMENT_FRAME
+ , ATK_ROLE_DOCUMENT_FRAME
#endif
};
commit 00a24a0f67549d7a9bb7ff98f6cb7777fb8d91bf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Feb 4 15:51:14 2014 +0000
have a stab at fixing RHEL-5 build that hasn't got new atk roles
Change-Id: Idbfc9bae9593416564783974ef7237e20e6400b0
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index cdc8076..7da3cbc 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -270,10 +270,13 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
ATK_ROLE_UNKNOWN, // TREE_ITEM - registered below
ATK_ROLE_TREE_TABLE,
ATK_ROLE_SCROLL_PANE, // COMMENT - mapped to atk_role_scroll_pane
- ATK_ROLE_UNKNOWN, // COMMENT_END - mapped to atk_role_unknown
- ATK_ROLE_DOCUMENT_PRESENTATION,
- ATK_ROLE_DOCUMENT_SPREADSHEET,
- ATK_ROLE_DOCUMENT_TEXT
+ ATK_ROLE_UNKNOWN // COMMENT_END - mapped to atk_role_unknown
+#if defined(ATK_CHECK_VERSION)
+ //older ver that doesn't define ATK_CHECK_VERSION doesn't have the following
+ , ATK_ROLE_DOCUMENT_PRESENTATION
+ , ATK_ROLE_DOCUMENT_SPREADSHEET
+ , ATK_ROLE_DOCUMENT_TEXT
+#endif
};
static bool initialized = false;
More information about the Libreoffice-commits
mailing list