Fix for TDIS-4976 in SGL (in tizen)
authorkatpaga.a <katpaga.a@samsung.com>
Mon, 27 May 2013 08:20:13 +0000 (13:50 +0530)
committerkatpaga.a <katpaga.a@samsung.com>
Mon, 27 May 2013 08:20:13 +0000 (13:50 +0530)
Change-Id: If6074c4a7f7812723708e81b8d7d076545032a53
Signed-off-by: katpaga.a <katpaga.a@samsung.com>
src/ui/controls/FUiCtrl_SlidableGroupedListImpl.cpp
src/ui/controls/FUiCtrl_SlidableListImpl.cpp
src/ui/inc/FUiCtrl_SlidableGroupedListImpl.h

index 2565fbe..e578235 100644 (file)
@@ -480,7 +480,11 @@ _SlidableGroupedListItemProvider::CreateItem(int groupIndex, int itemIndex, int
 bool
 _SlidableGroupedListItemProvider::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
 {
-       if (__pListImpl->__directDelete == false)
+       if (__pListImpl->__isUnloading == true)
+       {
+               __pListImpl->RemoveFromItemsList(groupIndex, (itemIndex - __pListImpl->GetTopItemIndex(groupIndex)));
+       }
+       else if (__pListImpl->__directDelete == false)
        {
                if (((groupIndex == __pListImpl->__topGroup) && (itemIndex <= __pListImpl->GetTopItemIndex(__pListImpl->__topGroup))) || (__pListImpl->__forceScroll == true))
                {
@@ -578,6 +582,7 @@ _SlidableGroupedListImpl::_SlidableGroupedListImpl(Control* pList, _TableView* p
        , __groupItemHeight(0)
        , __itemCacheSize(0)
        , __pItemFormat(null)
+       , __isUnloading(false)
 {
 }
 
@@ -1373,17 +1378,17 @@ _SlidableGroupedListImpl::UnloadAllItems(void)
        SysTryReturn(NID_UI_CTRL, __pItemProvider, E_SYSTEM, E_SYSTEM,
                                "[E_SYSTEM] A system error has occurred. ISlidableGroupedListEventListener not set.");
 
-       __directDelete = true;
-
        for (groupCount = __groupsList.GetCount() - 1; groupCount >= 0; groupCount--)
        {
                itemCount = GetSubItemCountAt(groupCount);
 
                for (itemIndex = itemCount - 1; itemIndex >= 0; itemIndex--)
                {
-                       RemoveFromItemsList(groupCount, itemIndex);
+                       __isUnloading = true;
+
+                       r = GetCore().RefreshTableView(groupCount, (itemIndex + GetTopItemIndex(groupCount)), TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);
 
-                       r = GetCore().RefreshTableView(groupCount, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);
+                       __isUnloading = false;
                        if (r != E_SUCCESS)
                        {
                                SysLog(NID_UI_CTRL, "Group item with index %d not removed successFully.", groupCount);
@@ -1402,8 +1407,6 @@ _SlidableGroupedListImpl::UnloadAllItems(void)
                }
        }
 
-       __directDelete = false;
-
        return E_SUCCESS;
 }
 
index 3e867c9..4795aa1 100644 (file)
@@ -286,8 +286,8 @@ _SlidableListItemProvider::DeleteItem(int index, TableViewItem* pItem)
                SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove an item.");
        }
 
-       _TableViewItemData* pTableViewItemData = dynamic_cast<_TableViewItemData*>(pItem);
-       delete pTableViewItemData;
+       delete pItem;
+       pItem = null;
 
        return true;
 }
index 6b7f67d..2d53f43 100644 (file)
@@ -281,6 +281,7 @@ private:
        _SlidableGroupedListItemProvider* __pItemProvider;
        Tizen::Base::Collection::LinkedList __slidableListenersList;
        Tizen::Base::Collection::LinkedList __itemListenersList;
+       bool __isUnloading;
        bool __directDelete;
        bool __forceScroll;
        bool __isCreating;