fix prevent issue
authoryanjie.hu <yanjie.hu@samsung.com>
Wed, 3 Apr 2013 06:13:09 +0000 (14:13 +0800)
committeryanjie.hu <yanjie.hu@samsung.com>
Wed, 3 Apr 2013 06:19:58 +0000 (14:19 +0800)
Change-Id: I4b8efe77d3bfded6c288fb57347b992f030e6ba7

scl/sclcontroller.cpp
scl/sclresourcecache.cpp
scl/scluiimpl.cpp

index 4574283..5931940 100644 (file)
@@ -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();
 
index d544f8c..3283d83 100644 (file)
@@ -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);
index a359433..04b3e74 100644 (file)
@@ -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;
+            }
         }
     }