From: Woochan Lee Date: Mon, 18 Sep 2017 09:24:33 +0000 (+0900) Subject: Revert "Fix Svace: Delete useless comparison systax." X-Git-Tag: submit/tizen/20170920.082902^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F150705%2F1;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git Revert "Fix Svace: Delete useless comparison systax." It needs for C application. This reverts commit ce58228abe120a1cd306a3aa11702d0ce76d36ab. Change-Id: Id38d327f8999392c2576acc1d2f3a767fd9d2502 --- diff --git a/src/lib/efl/mobile/c/ui_application.cpp b/src/lib/efl/mobile/c/ui_application.cpp index e31dffd..68ccb66 100644 --- a/src/lib/efl/mobile/c/ui_application.cpp +++ b/src/lib/efl/mobile/c/ui_application.cpp @@ -142,9 +142,19 @@ EAPI int ui_application_run(int argc, char **argv, ui_application_event_s *event LOGE("Event Count is %d, Application have to implement app event at least 1(app_create).", count); return TIZEN_ERROR_INVALID_PARAMETER; } + int ret = UI_VIEWMGR_ERROR_NONE; for (int i = 0; i < count; i++) - app->set_event_cb(events[i].event_type, events[i].event_cb, user_data); + { + if (events[i].event_type < UI_APPLICATION_EVENT_CREATE) { + LOGE("events[%d] is invalid(%d)", i, events[i].event_type); + ret = UI_VIEWMGR_ERROR_INVALID_PARAMETER; + } else { + app->set_event_cb(events[i].event_type, events[i].event_cb, user_data); + } + } + + if (ret != UI_VIEWMGR_ERROR_NONE) return ret; return app->run(argc, argv); } diff --git a/src/lib/efl/mobile/c/ui_tab_view.cpp b/src/lib/efl/mobile/c/ui_tab_view.cpp index 2e78203..95a47d9 100644 --- a/src/lib/efl/mobile/c/ui_tab_view.cpp +++ b/src/lib/efl/mobile/c/ui_tab_view.cpp @@ -248,7 +248,7 @@ EAPI int ui_tab_view_set_event_cb(ui_tab_view *view, ui_tab_view_event_type_e ev UiTabViewCapi *capi_view = validate_view(view); if (!capi_view) return UI_VIEWMGR_ERROR_INVALID_PARAMETER; - if (event_type >= _NUM_OF_UI_TAB_VIEW_EVENT_TYPE) + if (event_type < UI_TAB_ACTIVATED || event_type >= _NUM_OF_UI_TAB_VIEW_EVENT_TYPE) { LOGE("This view(%p) event_type is invalid(%d)", view, event_type); return UI_VIEWMGR_ERROR_INVALID_PARAMETER; diff --git a/src/lib/efl/mobile/c/ui_view.cpp b/src/lib/efl/mobile/c/ui_view.cpp index 4658f05..05f40a4 100644 --- a/src/lib/efl/mobile/c/ui_view.cpp +++ b/src/lib/efl/mobile/c/ui_view.cpp @@ -233,7 +233,7 @@ EAPI int ui_view_set_event_cb(ui_view *view, ui_view_event_type_e event_type, ui int ret = validate_view(view); if (ret != UI_VIEWMGR_ERROR_NONE) return ret; - if (event_type >= _NUM_OF_UI_VIEW_EVENT_TYPE) + if (event_type < UI_VIEW_EVENT_LOAD || event_type >= _NUM_OF_UI_VIEW_EVENT_TYPE) { LOGE("This view(%p) event_type is invalid(%d)", view, event_type); return UI_VIEWMGR_ERROR_INVALID_PARAMETER;