From: yanjie.hu Date: Wed, 3 Apr 2013 06:13:09 +0000 (+0800) Subject: fix prevent issue X-Git-Tag: 2.1b_release~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b348b981dcf40d58cc22c92a1d18ba00ef5942cb;p=framework%2Fuifw%2Flibscl-ui.git fix prevent issue Change-Id: I4b8efe77d3bfded6c288fb57347b992f030e6ba7 --- diff --git a/scl/sclcontroller.cpp b/scl/sclcontroller.cpp index 4574283..5931940 100644 --- a/scl/sclcontroller.cpp +++ b/scl/sclcontroller.cpp @@ -3001,7 +3001,6 @@ CSCLController::mouse_over(sclwindow window, sclint x, sclint y) CSCLResourceCache *cache = CSCLResourceCache::get_instance(); CSCLActionState *state = CSCLActionState::get_instance(); CSCLWindows *windows = CSCLWindows::get_instance(); - CSCLEvents *events = CSCLEvents::get_instance(); CSCLUtils *utils = CSCLUtils::get_instance(); SclResParserManager *sclres_manager = SclResParserManager::get_instance(); diff --git a/scl/sclresourcecache.cpp b/scl/sclresourcecache.cpp index d544f8c..3283d83 100644 --- a/scl/sclresourcecache.cpp +++ b/scl/sclresourcecache.cpp @@ -775,12 +775,20 @@ CSCLResourceCache::remove_private_key(sclint id) PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame(); + if (sclres_layout_key_coordinate_pointer_frame == NULL) { + return FALSE; + } if (scl_check_arrindex(layout, MAX_SCL_LAYOUT)) { for (sclint loop = 0;loop < MAX_KEY; loop++) { if ((!(mPrivateKeyProperties[id].custom_id.empty())) && mCurBaseLayoutKeyCoordination[loop].custom_id) { if (mPrivateKeyProperties[id].custom_id.compare(mCurBaseLayoutKeyCoordination[loop].custom_id) == 0) { - memcpy((SclLayoutKeyCoordinatePointer)(&mCurBaseLayoutKeyCoordination) + loop, - sclres_layout_key_coordinate_pointer_frame[layout][loop], sizeof(SclLayoutKeyCoordinate)); + SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop]; + if (p == NULL) { + continue; + } + SclLayoutKeyCoordinatePointer the_key = mCurBaseLayoutKeyCoordination + loop; + assert(the_key != NULL); + memcpy(the_key, p, sizeof(SclLayoutKeyCoordinate)); } } @@ -830,7 +838,6 @@ CSCLResourceCache::recompute_layout(sclwindow window) sclres_manager->get_key_coordinate_pointer_frame(); const PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table(); const PSclLabelPropertiesTable sclres_label_properties = sclres_manager->get_label_properties_frame(); - const PSclDefaultConfigure default_configure = sclres_manager->get_default_configure(); assert(sclres_input_mode_configure != NULL); assert(sclres_layout != NULL); assert(sclres_layout_key_coordinate_pointer_frame != NULL); diff --git a/scl/scluiimpl.cpp b/scl/scluiimpl.cpp index a359433..04b3e74 100644 --- a/scl/scluiimpl.cpp +++ b/scl/scluiimpl.cpp @@ -584,11 +584,13 @@ CSCLUIImpl::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode displa const PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table(); const PSclLayout sclres_layout = sclres_manager->get_layout_table(); sclint inputmode = sclres_manager->get_inputmode_id(input_mode); - sclint layout = sclres_manager->get_layout_id( - sclres_input_mode_configure[inputmode].layouts[display_mode]); + if (sclres_input_mode_configure && sclres_layout) { + sclint layout = sclres_manager->get_layout_id( + sclres_input_mode_configure[inputmode].layouts[display_mode]); - ret.width = sclres_layout[layout].width; - ret.height = sclres_layout[layout].height; + ret.width = sclres_layout[layout].width; + ret.height = sclres_layout[layout].height; + } } }