[java-atk-wrapper] simplify code



commit 22fcd4ca8cd1e74a2228c75b7dcaff0bb1d8cd16
Author: Giuseppe <giuseppecapaldo93 gmail com>
Date:   Tue Jul 9 01:06:08 2019 +0200

    simplify code

 jni/src/jawtext.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)
---
diff --git a/jni/src/jawtext.c b/jni/src/jawtext.c
index 95e84f5..b944cd8 100644
--- a/jni/src/jawtext.c
+++ b/jni/src/jawtext.c
@@ -507,12 +507,7 @@ jaw_text_add_selection (AtkText *text, gint start_offset, gint end_offset)
                                                   (jint)end_offset);
   (*jniEnv)->DeleteGlobalRef(jniEnv, atk_text);
 
-  if (jresult == JNI_TRUE)
-  {
-    return TRUE;
-  } else {
-    return FALSE;
-  }
+  return jresult;
 }
 
 static gboolean
@@ -538,12 +533,7 @@ jaw_text_remove_selection (AtkText *text, gint selection_num)
                                                   (jint)selection_num);
   (*jniEnv)->DeleteGlobalRef(jniEnv, atk_text);
 
-  if (jresult == JNI_TRUE)
-  {
-    return TRUE;
-  } else {
-    return FALSE;
-  }
+  return jresult;
 }
 
 static gboolean
@@ -567,11 +557,7 @@ jaw_text_set_selection (AtkText *text, gint selection_num, gint start_offset, gi
                                                   (jint)end_offset);
   (*jniEnv)->DeleteGlobalRef(jniEnv, atk_text);
 
-  if (jresult == JNI_TRUE) {
-    return TRUE;
-  } else {
-    return FALSE;
-  }
+  return jresult;
 }
 
 static gboolean
@@ -597,10 +583,5 @@ jaw_text_set_caret_offset (AtkText *text, gint offset)
                                                   (jint)offset);
   (*jniEnv)->DeleteGlobalRef(jniEnv, atk_text);
 
-  if (jresult == JNI_TRUE)
-  {
-    return TRUE;
-  } else {
-    return FALSE;
-  }
+  return jresult;
 }


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