[at-spi2-core] Fix atspi_accessible_get_index_in_parent when the parent is not cached
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Fix atspi_accessible_get_index_in_parent when the parent is not cached
- Date: Mon, 19 Nov 2012 21:33:25 +0000 (UTC)
commit 09915497d014e3ea9a146fa6ef8eb4fa94756708
Author: Mike Gorse <mgorse suse com>
Date: Mon Nov 19 15:34:26 2012 -0600
Fix atspi_accessible_get_index_in_parent when the parent is not cached
Atspi_accessible_get_index_in_parent was returning -1 if the object's
parent is NULL, regardless of whether the accessible_parent field is
currently valid.
https://bugzilla.gnome.org/show_bug.cgi?id=688057
atspi/atspi-accessible.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 92f74e7..7971bd3 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -489,8 +489,11 @@ atspi_accessible_get_index_in_parent (AtspiAccessible *obj, GError **error)
gint i = 0;
g_return_val_if_fail (obj != NULL, -1);
- if (!obj->accessible_parent) return -1;
- if (!_atspi_accessible_test_cache (obj->accessible_parent,
+ if (_atspi_accessible_test_cache (obj, ATSPI_CACHE_PARENT) &&
+ !obj->accessible_parent)
+ return -1;
+ if (!obj->accessible_parent ||
+ !_atspi_accessible_test_cache (obj->accessible_parent,
ATSPI_CACHE_CHILDREN))
{
dbus_int32_t ret = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]