[java-atk-wrapper] simplify code



commit b36b4031ea941054ed389d26151a80d138631b20
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Wed Jul 10 23:46:29 2019 +0200

    simplify code

 jni/src/jawselection.c | 30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)
---
diff --git a/jni/src/jawselection.c b/jni/src/jawselection.c
index de3e14e..b87e059 100644
--- a/jni/src/jawselection.c
+++ b/jni/src/jawselection.c
@@ -92,11 +92,7 @@ jaw_selection_add_selection (AtkSelection *selection, gint i)
        jboolean jbool = (*jniEnv)->CallBooleanMethod(jniEnv, atk_selection, jmid, (jint)i);
        (*jniEnv)->DeleteGlobalRef(jniEnv, atk_selection);
 
-       if (jbool == JNI_TRUE) {
-               return TRUE;
-       } else {
-               return FALSE;
-       }
+       return jbool;
 }
 
 static gboolean
@@ -115,11 +111,7 @@ jaw_selection_clear_selection (AtkSelection *selection)
        jboolean jbool = (*jniEnv)->CallBooleanMethod(jniEnv, atk_selection, jmid);
        (*jniEnv)->DeleteGlobalRef(jniEnv, atk_selection);
 
-       if (jbool == JNI_TRUE) {
-               return TRUE;
-       } else {
-               return FALSE;
-       }
+       return jbool;
 }
 
 static AtkObject*
@@ -183,11 +175,7 @@ jaw_selection_is_child_selected (AtkSelection *selection, gint i)
        jboolean jbool = (*jniEnv)->CallBooleanMethod(jniEnv, atk_selection, jmid, (jint)i);
        (*jniEnv)->DeleteGlobalRef(jniEnv, atk_selection);
 
-       if (jbool == JNI_TRUE) {
-               return TRUE;
-       } else {
-               return FALSE;
-       }
+       return jbool;
 }
 
 static gboolean
@@ -206,11 +194,7 @@ jaw_selection_remove_selection (AtkSelection *selection, gint i)
        jboolean jbool = (*jniEnv)->CallBooleanMethod(jniEnv, atk_selection, jmid, (jint)i);
        (*jniEnv)->DeleteGlobalRef(jniEnv, atk_selection);
 
-       if (jbool == JNI_TRUE) {
-               return TRUE;
-       } else {
-               return FALSE;
-       }
+       return jbool;
 }
 
 static gboolean
@@ -229,9 +213,5 @@ jaw_selection_select_all_selection (AtkSelection *selection)
        jboolean jbool = (*jniEnv)->CallBooleanMethod(jniEnv, atk_selection, jmid);
        (*jniEnv)->DeleteGlobalRef(jniEnv, atk_selection);
 
-       if (jbool == JNI_TRUE) {
-               return TRUE;
-       } else {
-               return FALSE;
-       }
+       return jbool;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]