Changes for TCT coverage #2 08/42308/1 accepted/tizen/mobile/20150629.021621 accepted/tizen/tv/20150629.021626 accepted/tizen/wearable/20150629.021634 submit/tizen/20150625.112413 submit/tizen/20150629.005249
authorSungmin Kwak <sungmin.kwak@samsung.com>
Sun, 21 Jun 2015 09:56:50 +0000 (18:56 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 25 Jun 2015 12:19:41 +0000 (21:19 +0900)
Change-Id: Iab8f4963e68731f48641f3d863e0747d6e28d5c8

src/inputmethod.cpp

index d27749b..25a8d0d 100644 (file)
@@ -803,16 +803,16 @@ int ime_update_preedit_string(const char *str, Eina_List *attrs)
 
 int ime_request_surrounding_text(int maxlen_before, int maxlen_after)
 {
-    if (!g_running) {
-        LOGW("IME_ERROR_NOT_RUNNING");
-        return IME_ERROR_NOT_RUNNING;
-    }
-
     if (!g_event_callback.surrounding_text_updated) {
         LOGW("IME_ERROR_NO_CALLBACK_FUNCTION");
         return IME_ERROR_NO_CALLBACK_FUNCTION;
     }
 
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
+        return IME_ERROR_NOT_RUNNING;
+    }
+
     g_core.get_surrounding_text(NULL, maxlen_before, maxlen_after);
 
     return IME_ERROR_NONE;
@@ -884,16 +884,16 @@ int ime_set_size(int portrait_width, int portrait_height, int landscape_width, i
 
 int ime_create_option_window(void)
 {
-    if (!g_running) {
-        LOGW("IME_ERROR_NOT_RUNNING");
-        return IME_ERROR_NOT_RUNNING;
-    }
-
     if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) {
         LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set.");
         return IME_ERROR_NO_CALLBACK_FUNCTION;
     }
 
+    if (!g_running) {
+        LOGW("IME_ERROR_NOT_RUNNING");
+        return IME_ERROR_NOT_RUNNING;
+    }
+
     if (g_core.create_option_window())
         return IME_ERROR_NONE;
     else {
@@ -904,6 +904,11 @@ int ime_create_option_window(void)
 
 int ime_destroy_option_window(Evas_Object *window)
 {
+    if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) {
+        LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set.");
+        return IME_ERROR_NO_CALLBACK_FUNCTION;
+    }
+
     if (!window) {
         LOGW("Window pointer is null.");
         return IME_ERROR_INVALID_PARAMETER;
@@ -914,11 +919,6 @@ int ime_destroy_option_window(Evas_Object *window)
         return IME_ERROR_NOT_RUNNING;
     }
 
-    if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) {
-        LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set.");
-        return IME_ERROR_NO_CALLBACK_FUNCTION;
-    }
-
     g_core.destroy_option_window(window);
 
     return IME_ERROR_NONE;