[java-atk-wrapper] JNI: get name before checking for COMBO BOX
- From: Magdalen Berns <mberns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] JNI: get name before checking for COMBO BOX
- Date: Tue, 17 Feb 2015 11:53:09 +0000 (UTC)
commit e5c17822031f22a8ed873777f5c663689fba4d9d
Author: Magdalen Berns <m berns thismagpie com>
Date: Tue Feb 17 11:49:32 2015 +0000
JNI: get name before checking for COMBO BOX
jaw_object_get_name was only getting the name of the object
under certain conditions so if those conditions are not met
the call to jaw_object_get_name would return NULL. Getting
the name before checking for the name of COMBO box child
object means the name will not return NULL in more situations
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=744652
jni/src/jawimpl.c | 1 +
jni/src/jawobject.c | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/jni/src/jawimpl.c b/jni/src/jawimpl.c
index cdf202b..348043a 100644
--- a/jni/src/jawimpl.c
+++ b/jni/src/jawimpl.c
@@ -1,6 +1,7 @@
/*
* Java ATK Wrapper for GNOME
* Copyright (C) 2009 Sun Microsystems Inc.
+ * Copyright (C) 2015 Magdalen Berns <m berns thismagpie com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index 8a08d53..67b845a 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -1,6 +1,7 @@
/*
* Java ATK Wrapper for GNOME
* Copyright (C) 2009 Sun Microsystems Inc.
+ * Copyright (C) 2015 Magdalen Berns <m berns thismagpie com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -38,6 +39,8 @@ static gint jaw_object_get_index_in_parent(AtkObject *atk_obj);
static AtkRole jaw_object_get_role(AtkObject *atk_obj);
static AtkStateSet* jaw_object_ref_state_set(AtkObject *atk_obj);
+static gpointer parent_class = NULL;
+
enum {
ACTIVATE,
CREATE,
@@ -63,6 +66,8 @@ jaw_object_class_init (JawObjectClass *klass)
gobject_class->finalize = jaw_object_finalize;
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+ parent_class = g_type_class_peek_parent (klass);
+
atk_class->get_name = jaw_object_get_name;
atk_class->get_description = jaw_object_get_description;
atk_class->get_n_children = jaw_object_get_n_children;
@@ -234,8 +239,9 @@ jaw_object_get_name (AtkObject *atk_obj)
jobject ac = jaw_obj->acc_context;
JNIEnv *jniEnv = jaw_util_get_jni_env();
- if (atk_object_get_role(atk_obj) ==
- ATK_ROLE_COMBO_BOX &&
+ atk_obj->name = (gchar *)ATK_OBJECT_CLASS (parent_class)->get_name (atk_obj);
+
+ if (atk_object_get_role(atk_obj) == ATK_ROLE_COMBO_BOX &&
atk_object_get_n_accessible_children(atk_obj) == 1)
{
AtkSelection *selection = ATK_SELECTION(atk_obj);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]