summaryrefslogtreecommitdiff
path: root/src/examples/ecore
diff options
context:
space:
mode:
authorJihoon Kim <imfine98@gmail.com>2013-01-26 03:01:12 +0000
committerJihoon Kim <imfine98@gmail.com>2013-01-26 03:01:12 +0000
commit782a3f0a1abb7e9d1957fcd16b0f515d62bfbd73 (patch)
tree75e4f78a359ef7fc615b6e79f89e9093f993f5c5 /src/examples/ecore
parent0753ec709deca039ba8c07d891050a9972d795f3 (diff)
ecore_imf_example: add parameter NULL checking
SVN revision: 83340
Diffstat (limited to 'src/examples/ecore')
-rw-r--r--src/examples/ecore/ecore_imf_example.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/examples/ecore/ecore_imf_example.c b/src/examples/ecore/ecore_imf_example.c
index aaa364116d..922b2ee365 100644
--- a/src/examples/ecore/ecore_imf_example.c
+++ b/src/examples/ecore/ecore_imf_example.c
@@ -182,7 +182,7 @@ _ecore_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx, void
182 Evas_Textblock_Cursor *del_start, *del_end; 182 Evas_Textblock_Cursor *del_start, *del_end;
183 int cursor_pos; 183 int cursor_pos;
184 184
185 if (!en) return; 185 if ((!en) || (!ev)) return;
186 186
187 // get the current cursor position 187 // get the current cursor position
188 cursor_pos = evas_textblock_cursor_pos_get(en->cursor); 188 cursor_pos = evas_textblock_cursor_pos_get(en->cursor);
@@ -317,8 +317,7 @@ _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
317 Eina_Bool control, alt, shift; 317 Eina_Bool control, alt, shift;
318 Eina_Bool multiline; 318 Eina_Bool multiline;
319 Eina_Bool cursor_changed; 319 Eina_Bool cursor_changed;
320 if (!en) return; 320 if ((!en) || (!ev->key)) return;
321 if (!ev->key) return;
322 321
323 if (en->imf_context) 322 if (en->imf_context)
324 { 323 {
@@ -430,6 +429,10 @@ create_input_field(Evas *evas, Entry *en, Evas_Coord x, Evas_Coord y, Evas_Coord
430{ 429{
431 if (!en) return; 430 if (!en) return;
432 431
432 en->have_preedit = EINA_FALSE;
433 en->preedit_start = NULL;
434 en->preedit_end = NULL;
435
433 // create the background for text input field 436 // create the background for text input field
434 en->rect = evas_object_rectangle_add(evas); 437 en->rect = evas_object_rectangle_add(evas);
435 evas_object_color_set(en->rect, 150, 150, 150, 255); // gray color 438 evas_object_color_set(en->rect, 150, 150, 150, 255); // gray color
@@ -479,10 +482,6 @@ create_input_field(Evas *evas, Entry *en, Evas_Coord x, Evas_Coord y, Evas_Coord
479 evas_object_event_callback_add(en->rect, EVAS_CALLBACK_FOCUS_IN, _entry_focus_in_cb, en); 482 evas_object_event_callback_add(en->rect, EVAS_CALLBACK_FOCUS_IN, _entry_focus_in_cb, en);
480 evas_object_event_callback_add(en->rect, EVAS_CALLBACK_FOCUS_OUT, _entry_focus_out_cb, en); 483 evas_object_event_callback_add(en->rect, EVAS_CALLBACK_FOCUS_OUT, _entry_focus_out_cb, en);
481 484
482 en->have_preedit = EINA_FALSE;
483 en->preedit_start = NULL;
484 en->preedit_end = NULL;
485
486 // register retrieve surrounding callback 485 // register retrieve surrounding callback
487 ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, _ecore_imf_retrieve_surrounding_cb, en); 486 ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, _ecore_imf_retrieve_surrounding_cb, en);
488 487