Revert "Fix Svace: Delete useless comparison systax." 05/150705/1 accepted/tizen/unified/20170921.072318 submit/tizen/20170920.082902
authorWoochan Lee <wc0917.lee@samsung.com>
Mon, 18 Sep 2017 09:24:33 +0000 (18:24 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Mon, 18 Sep 2017 09:25:13 +0000 (18:25 +0900)
It needs for C application.

This reverts commit ce58228abe120a1cd306a3aa11702d0ce76d36ab.

Change-Id: Id38d327f8999392c2576acc1d2f3a767fd9d2502

src/lib/efl/mobile/c/ui_application.cpp
src/lib/efl/mobile/c/ui_tab_view.cpp
src/lib/efl/mobile/c/ui_view.cpp

index e31dffd6f8ce35fa565ef45746c94d21cfaf61b1..68ccb66a46d7f21d13397c928bf72f2c26565366 100644 (file)
@@ -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);
 }
index 2e7820371df4f6a283a96b55198a1b8daf5399ca..95a47d9f44cd4e1eda4cbc58a2a5efbbfcbeb47d 100644 (file)
@@ -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;
index 4658f0577917f552513cd6c233db03b9e6a7d874..05f40a4d314d7ef73957a77c2c48809988d3040b 100644 (file)
@@ -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;