Name of Bookmark does not update 20/77020/2
authorm.kawonczyk <m.kawonczyk@samsung.com>
Tue, 28 Jun 2016 09:06:54 +0000 (11:06 +0200)
committerMaciej Kawo?czyk <m.kawonczyk@samsung.com>
Tue, 28 Jun 2016 09:12:41 +0000 (02:12 -0700)
    [Issue]        http://suprem.sec.samsung.net/jira/browse/TSAM-5642
    [Problem]      Folder name wasn't properly changed between utf8
                   and markup.
    [Solution]     Use elm_entry_utf8_to_markup and
                   elm_entry_markup_to_utf8 on text.
    [Verify]       Open Website>MoreMenu>Add to bookmark. Add folder
                   by clicking +. Write some special characters. Check
                   if everything works as intended. Go to bookmark
                   manager, open created folder, click menu > edit
                   folder name. Check if folder name is correctly
                   edited and storred in a database.

Change-Id: Ib5f8704d9d6c6449ace3d9a0046a4dd44cfac082

services/BookmarkFlowUI/BookmarkFlowUI.cpp
services/SimpleUI/InputPopup.cpp

index c4d17bf71809e7c2b452400baadb2880454e9f71..138afeba546f57d8a35399826366b4089be05f0d 100755 (executable)
@@ -210,7 +210,7 @@ void BookmarkFlowUI::setState(bool state)
 void BookmarkFlowUI::setTitle(const std::string& title)
 {
     BROWSER_LOGD("[%s:%d] %s", __PRETTY_FUNCTION__, __LINE__, title.c_str());
-    elm_object_part_text_set(m_entry, "elm.text", title.c_str());
+    elm_object_part_text_set(m_entry, "elm.text", elm_entry_utf8_to_markup(title.c_str()));
 
     if (title.empty()) {
         elm_object_disabled_set(m_save_button, EINA_TRUE);
@@ -235,7 +235,7 @@ void BookmarkFlowUI::setFolder(unsigned int folder_id, const std::string& folder
     m_folder_id = folder_id;
     elm_object_signal_emit(m_contents_area, (m_folder_id == m_special_folder_id)
                            ? "folder_icon_special" : "folder_icon_normal", "ui");
-    elm_object_part_text_set(m_contents_area, "dropdown_text", folder_name.c_str());
+    elm_object_part_text_set(m_contents_area, "dropdown_text", elm_entry_utf8_to_markup(folder_name.c_str()));
     elm_genlist_item_item_class_update(m_map_folders[m_folder_id], m_folder_selected_item_class);
 }
 
@@ -279,7 +279,7 @@ void BookmarkFlowUI::_save_clicked(void * data, Evas_Object *, void *)
         BookmarkFlowUI* bookmarkFlowUI = static_cast<BookmarkFlowUI*>(data);
         BookmarkUpdate update;
         update.folder_id = bookmarkFlowUI->m_folder_id;
-        update.title = elm_object_part_text_get(bookmarkFlowUI->m_entry, "elm.text");
+        update.title = elm_entry_markup_to_utf8(elm_object_part_text_get(bookmarkFlowUI->m_entry, "elm.text"));
         if (!bookmarkFlowUI->m_state)
             bookmarkFlowUI->saveBookmark(update);
         else
@@ -404,7 +404,7 @@ void BookmarkFlowUI::_listCustomFolderClicked(void *data, Evas_Object *, void *)
                 folderData->bookmarkFlowUI->m_folder_custom_item_class);
         folderData->bookmarkFlowUI->m_folder_id = folderData->folder_id;
         elm_object_part_text_set(folderData->bookmarkFlowUI->m_contents_area,
-                                 "dropdown_text", folderData->name.c_str());
+                                 "dropdown_text", elm_entry_utf8_to_markup(folderData->name.c_str()));
         elm_object_signal_emit(folderData->bookmarkFlowUI->m_contents_area,
                                (folderData->bookmarkFlowUI->m_folder_id == folderData->bookmarkFlowUI->m_special_folder_id)
                                ? "folder_icon_special" : "folder_icon_normal", "ui");
@@ -441,7 +441,7 @@ void BookmarkFlowUI::_entry_changed(void * data, Evas_Object *, void *)
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (data != nullptr) {
         BookmarkFlowUI*  bookmarkFlowUI = static_cast<BookmarkFlowUI*>(data);
-        std::string text = elm_object_part_text_get(bookmarkFlowUI->m_entry, "elm.text");
+        std::string text = elm_entry_markup_to_utf8(elm_object_part_text_get(bookmarkFlowUI->m_entry, "elm.text"));
 
         if (text.empty()) {
             elm_object_signal_emit(bookmarkFlowUI->m_contents_area, "close_icon_hide", "ui");
@@ -644,7 +644,7 @@ char* BookmarkFlowUI::_folder_title_text_get(void *data, Evas_Object *, const ch
         FolderData *folderData = static_cast<FolderData*>(data);
         const char *folder_text = "folder_text";
         if (!strncmp(folder_text, part, strlen(folder_text)))
-            return strdup(folderData->name.c_str());
+            return strdup(elm_entry_utf8_to_markup(folderData->name.c_str()));
     }
     return strdup("");
 }
index ebfb170209a5ee279c9d4ad9ff374f2e4266b7f8..6d55c35a82e32a614abcad0f2da7aafe9cf1db4d 100644 (file)
@@ -145,7 +145,7 @@ void InputPopup::createLayout()
     elm_entry_scrollable_set(m_entry, EINA_TRUE);
     elm_entry_input_panel_layout_set(m_entry, ELM_INPUT_PANEL_LAYOUT_URL);
     elm_object_part_content_set(m_input_area, "input_text_swallow", m_entry);
-    elm_object_part_text_set(m_entry, "elm.text", m_input.c_str());
+    elm_object_part_text_set(m_entry, "elm.text", elm_entry_utf8_to_markup(m_input.c_str()));
 
     evas_object_smart_callback_add(m_entry, "focused", _entry_focused, (void*)this);
     evas_object_smart_callback_add(m_entry, "unfocused", _entry_unfocused, (void*)this);
@@ -166,7 +166,8 @@ void InputPopup::createLayout()
     m_button_left = elm_button_add(m_buttons_box);
     elm_object_style_set(m_button_left, "input-popup-button");
     evas_object_size_hint_weight_set(m_button_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_size_hint_align_set(m_button_left, EVAS_HINT_FILL, EVAS_HINT_FILL);    elm_object_part_text_set(m_button_left, "elm.text", m_cancel_button_text.c_str());
+    evas_object_size_hint_align_set(m_button_left, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_object_part_text_set(m_button_left, "elm.text", m_cancel_button_text.c_str());
     elm_box_pack_end(m_buttons_box, m_button_left);
     evas_object_smart_callback_add(m_button_left, "clicked", _left_button_clicked, (void*)this);
 
@@ -222,7 +223,7 @@ void InputPopup::_entry_changed(void* data, Evas_Object *, void *)
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (data != nullptr) {
         InputPopup*  inputPopup = static_cast<InputPopup*>(data);
-        std::string text = elm_object_part_text_get(inputPopup->m_entry, "elm.text");
+        std::string text = elm_entry_markup_to_utf8(elm_object_part_text_get(inputPopup->m_entry, "elm.text"));
 
         if (text.empty())
             elm_object_signal_emit(inputPopup->m_input_area, "close_icon_hide", "ui");
@@ -263,7 +264,7 @@ void InputPopup::_right_button_clicked(void *data, Evas_Object *, void*)
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     InputPopup *inputPopup = static_cast<InputPopup*>(data);
     if (inputPopup->m_accept_right_left)
-        inputPopup->button_clicked(elm_object_part_text_get(inputPopup->m_entry, "elm.text"));
+        inputPopup->button_clicked(elm_entry_markup_to_utf8(elm_object_part_text_get(inputPopup->m_entry, "elm.text")));
     inputPopup->dismiss();
 }
 
@@ -272,7 +273,7 @@ void InputPopup::_left_button_clicked(void* data, Evas_Object *, void*)
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     InputPopup *inputPopup = static_cast<InputPopup*>(data);
     if (!inputPopup->m_accept_right_left)
-        inputPopup->button_clicked(elm_object_part_text_get(inputPopup->m_entry, "elm.text"));
+        inputPopup->button_clicked(elm_entry_markup_to_utf8(elm_object_part_text_get(inputPopup->m_entry, "elm.text")));
     inputPopup->dismiss();
 }