diff options
author | Silenio Quarti <silenio> | 2010-05-05 14:10:36 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2010-05-05 14:10:36 +0000 |
commit | a896a1d080919093476f9155512306f58bc5f15c (patch) | |
tree | 314443ed5c941b6e324782be3cf0c65f7cfe36d6 /bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java | |
parent | 63e6a9034a307eba9a992e157a5a508d5e41c943 (diff) | |
download | eclipse.platform.swt-a896a1d080919093476f9155512306f58bc5f15c.tar.gz eclipse.platform.swt-a896a1d080919093476f9155512306f58bc5f15c.tar.xz eclipse.platform.swt-a896a1d080919093476f9155512306f58bc5f15c.zip |
Bug 311632 - AccessibleObject interfering with default accessibility of Text (with Orca)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java index f8209c93cb..cf46b71e81 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java @@ -2209,6 +2209,9 @@ class AccessibleObject { if (text != null && text.length () > event.offset && text.length() >= event.offset + event.length) { return getStringPtr (text.substring(event.offset, event.offset + event.length)); } + if (iface != null && iface.get_text != 0) { + return ATK.call (iface.get_text, atkObject, event.offset, event.offset + event.length); + } return 0; } } @@ -2246,6 +2249,10 @@ class AccessibleObject { return getStringPtr (text); } } + AtkTextIface iface = getTextIface (atkObject); + if (iface != null && iface.get_text != 0) { + return ATK.call (iface.get_text, atkObject, start_offset, end_offset); + } return 0; } @@ -2441,6 +2448,10 @@ class AccessibleObject { return getStringPtr (text); } } + AtkTextIface iface = getTextIface (atkObject); + if (iface != null && iface.get_text_after_offset != 0) { + return ATK.call (iface.get_text_after_offset, atkObject, offset_value, boundary_type, start_offset, end_offset); + } return 0; } @@ -2579,6 +2590,10 @@ class AccessibleObject { return getStringPtr (text); } } + AtkTextIface iface = getTextIface (atkObject); + if (iface != null && iface.get_text_at_offset != 0) { + return ATK.call (iface.get_text_at_offset, atkObject, offset_value, boundary_type, start_offset, end_offset); + } return 0; } @@ -2722,6 +2737,10 @@ class AccessibleObject { return getStringPtr (text); } } + AtkTextIface iface = getTextIface (atkObject); + if (iface != null && iface.get_text_before_offset != 0) { + return ATK.call (iface.get_text_before_offset, atkObject, offset_value, boundary_type, start_offset, end_offset); + } return 0; } @@ -2884,22 +2903,21 @@ class AccessibleObject { } String getText () { - int /*long*/ parentResult = 0; - String parentText = ""; //$NON-NLS-1$ - AtkTextIface iface = getTextIface (handle); - if (iface != null && iface.get_character_count != 0) { - int /*long*/ characterCount = ATK.call (iface.get_character_count, handle); - if (characterCount > 0 && iface.get_text != 0) { - parentResult = ATK.call (iface.get_text, handle, 0, characterCount); - if (parentResult != 0) { - parentText = getString (parentResult); - OS.g_free(parentResult); - } - } - } Vector listeners = accessible.accessibleControlListeners; int length = listeners.size(); if (length > 0) { + String parentText = ""; //$NON-NLS-1$ + AtkTextIface iface = getTextIface (handle); + if (iface != null && iface.get_character_count != 0) { + int /*long*/ characterCount = ATK.call (iface.get_character_count, handle); + if (characterCount > 0 && iface.get_text != 0) { + int /*long*/ parentResult = ATK.call (iface.get_text, handle, 0, characterCount); + if (parentResult != 0) { + parentText = getString (parentResult); + OS.g_free(parentResult); + } + } + } AccessibleControlEvent event = new AccessibleControlEvent (accessible); event.childID = id; event.result = parentText; @@ -2909,7 +2927,7 @@ class AccessibleObject { } return event.result; } - return parentText; + return null; } static int /*long*/ gObjectClass_finalize (int /*long*/ atkObject) { |