From c11c5feb64e702156f322ecd24f5b86feb71f76b Mon Sep 17 00:00:00 2001 From: Soonmin Jung Date: Thu, 14 Feb 2013 14:35:02 +0900 Subject: [PATCH] Fix N_SE-25224, drawing memo inserting issue Change-Id: I81aee81e8c44af3ecea9ab705e73fc8681f9b817 --- composer/src/external/msg-ui-composer-external.c | 37 ++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/composer/src/external/msg-ui-composer-external.c b/composer/src/external/msg-ui-composer-external.c index 19d2ade..49a78e0 100755 --- a/composer/src/external/msg-ui-composer-external.c +++ b/composer/src/external/msg-ui-composer-external.c @@ -423,11 +423,12 @@ static void __ug_memo_result_cb(ui_gadget_h ug, service_h result, void *priv) { D_ENTER; - MSG_COMPOSER_VIEW_DATA_S *cd = priv; - Evas_Object *entry; + MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)priv; + Evas_Object *entry = NULL; char *str = NULL; char *tmp_memo = NULL; - char buf[DEF_BUF_LEN_S] = { 0, }; + char *memo_image = NULL; + char buf[DEF_BUF_LEN_S + 1] = {0, }; int img_count = 0; int txt_count = 0; int i; @@ -437,26 +438,26 @@ static void __ug_memo_result_cb(ui_gadget_h ug, service_h result, void *priv) return; } - if (service_get_extra_data(result, MSG_BUNDLE_KEY_PATH, &str) == SERVICE_ERROR_NONE) { - gchar **split_str = NULL; - - split_str = g_strsplit_set(str, "\n", -1); + if (service_get_extra_data(result, MSG_BUNDLE_KEY_IMAGE, &str) == SERVICE_ERROR_NONE) { + if (str) + img_count = atoi(str); + } - if (split_str) { - int count = g_strv_length(split_str); + D_MSG("[MEMO] attach image count : %d", img_count); - for (i = 0; i < count; i++) { - if (split_str[i] && strlen(split_str[i])) { - D_MSG("%dth split_str = (%s)", i, split_str[i]); - cd->attachlist = eina_list_append(cd->attachlist, g_strdup(split_str[i])); - } + /* if image memo then attach image */ + if (img_count > 0) { + for (i = 1; i <= img_count; i++) { + snprintf(buf, sizeof(buf)-1, "image%d", i); + if (service_get_extra_data(result, buf, &memo_image) == SERVICE_ERROR_NONE) { + if (memo_image) + cd->attachlist = eina_list_append(cd->attachlist, g_strdup(memo_image)); } - - g_strfreev(split_str); } - } + str = NULL; + if (service_get_extra_data(result, MSG_BUNDLE_KEY_TEXT, &str) == SERVICE_ERROR_NONE) { if (str) txt_count = atoi(str); @@ -469,7 +470,7 @@ static void __ug_memo_result_cb(ui_gadget_h ug, service_h result, void *priv) COMPOSER_RECP_ADDR_E recp_type = msg_ui_composer_recipient_addr_type_get(cd->recipient); for (i = 1; i <= txt_count; i++) { - char* memo_str = NULL; + char *memo_str = NULL; snprintf(buf, sizeof(buf)-1, "text%d", i); service_get_extra_data(result, buf, &tmp_memo); -- 2.7.4