From: InHong Han Date: Wed, 20 Sep 2017 07:32:50 +0000 (+0900) Subject: Fix issue detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20170921.160406~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F151195%2F3;p=platform%2Fcore%2Fuifw%2Fise-default.git Fix issue detected by static analysis tool Change-Id: Ic0574aa9889ad6824a8f93baaed8419ccebda3db --- diff --git a/src/ise.cpp b/src/ise.cpp index 37cdf6c..66328bd 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -377,8 +377,7 @@ static bool ise_is_emoticons_disabled(void) static Eina_Bool softcandidate_hide_timer_callback(void *data) { - if (g_ui) - set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_HIDE); + set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_HIDE); if (g_candidate) { g_candidate->hide(); @@ -1518,7 +1517,7 @@ ise_hide() } g_input_panel_show = false; - if (g_softcandidate_show && g_ui && g_candidate) + if (g_softcandidate_show && g_candidate) set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_SHOW); #ifdef _WEARABLE hide_indicator_window(); @@ -1593,13 +1592,10 @@ static void ise_floating_mode_changed_cb(const char *key, void *user_data) g_candidate = NULL; create_softcandidate(); - if (g_candidate->get_visible()) { + if (g_candidate && g_candidate->get_visible()) { g_softcandidate_show = true; - if (g_candidate) { - g_candidate->show(); - if (g_ui) - set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_SHOW); - } + g_candidate->show(); + set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_SHOW); return; } } @@ -1757,8 +1753,7 @@ ise_app_candidate_show() g_softcandidate_show = true; if (g_candidate) { g_candidate->show(); - if (g_ui) - set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_SHOW); + set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_SHOW); } } @@ -2033,6 +2028,9 @@ static void update_recent_used_punctuation(const char * key_value) static void set_ime_size(bool floating_mode, ISE_CANDIDATE_REQUEST candidate_req) { + if (!g_ui) + return; + SclSize size_portrait = g_ui->get_input_mode_size(g_ui->get_input_mode(), DISPLAYMODE_PORTRAIT); SclSize size_landscape = g_ui->get_input_mode_size(g_ui->get_input_mode(), DISPLAYMODE_LANDSCAPE);