Fix for N_SE-55652
authorAyush <ayush.sriv@samsung.com>
Mon, 28 Oct 2013 13:50:43 +0000 (19:20 +0530)
committerAyush <ayush.sriv@samsung.com>
Tue, 29 Oct 2013 05:52:31 +0000 (11:22 +0530)
Change-Id: I29e5837fedaaad87ed74ad09f995acb25efcbbbe
Signed-off-by: Ayush <ayush.sriv@samsung.com>
src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp

index 220ec94..1c24548 100644 (file)
@@ -562,10 +562,22 @@ _OptionMenuPresenter::DeleteItemAll(void)
        SysTryReturnResult(NID_UI_CTRL, (__pOptionMenu->GetItemCount() > 0), E_SYSTEM,
                        "A system error has occurred. No items exists.");
 
-       __pOptionMenu->GetScrollPanel()->DetachAllChildren();
+       result r = E_SUCCESS;
+       _OptionMenuItem* pItem = null;
+
+       for (int index = 0; index < __pOptionMenu->GetItemCount(); index++)
+       {
+               pItem = __pModel->GetItem(0);
 
-       result r =  __pModel->RemoveAllItem();
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete all items.");
+               if (pItem != null && pItem->HasParent())
+               {
+                       r = __pOptionMenu->GetScrollPanel()->DetachChild(*pItem);
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to detach item.");
+               }
+
+               r = __pModel->RemoveItem(0);
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to delete item.");
+       }
 
        return r;
 }