Fixed UTs Crash in GroupedList & SlidableGroupedList.
authorSyed Khaja Moinuddin <moinuddin.s@samsung.com>
Mon, 1 Apr 2013 07:15:00 +0000 (16:15 +0900)
committerSyed Khaja Moinuddin <moinuddin.s@samsung.com>
Mon, 1 Apr 2013 07:16:00 +0000 (16:16 +0900)
Signed-off-by: Syed Khaja Moinuddin <moinuddin.s@samsung.com>
Change-Id: Ib70f58c44cc23e91e2f0bf69f8e979c5ca74a08a

src/ui/controls/FUiCtrl_CustomListItemImpl.cpp

index 6825722..001a0fc 100644 (file)
@@ -460,34 +460,54 @@ _CustomListItemImpl::GetElementViewById(int elementId) const
 void
 _CustomListItemImpl::SetNormalItemBackgroundBitmap(const Bitmap& bitmap)
 {
-       SetBackgroundBitmap(bitmap, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
+       TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;\r
+\r
+       if (__pBitmaps[status])\r
+       {\r
+               delete __pBitmaps[status];\r
+       }\r
+\r
+       __pBitmaps[status] = _BitmapImpl::CloneN(bitmap);\r
+\r
+       SetBackgroundBitmap(bitmap, status);\r
        return;
 }
 
 void
 _CustomListItemImpl::SetFocusedItemBackgroundBitmap(const Bitmap& bitmap)
 {
-       SetBackgroundBitmap(bitmap, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
+       TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;\r
+\r
+       if (__pBitmaps[status])\r
+       {\r
+               delete __pBitmaps[status];\r
+       }\r
+\r
+       __pBitmaps[status] = _BitmapImpl::CloneN(bitmap);\r
+\r
+       SetBackgroundBitmap(bitmap, status);\r
        return;
 }
 
 void
 _CustomListItemImpl::SetHighlightedItemBackgroundBitmap(const Bitmap& bitmap)
 {
-       SetBackgroundBitmap(bitmap, TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED);
-       return;
-}
+       TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED;\r
 
-void
-_CustomListItemImpl::SetBackgroundBitmap(const Bitmap& bitmap, TableViewItemDrawingStatus status)
-{
        if (__pBitmaps[status])
        {
-               delete __pBitmaps[status];
+               delete __pBitmaps[status];\r
        }
 
        __pBitmaps[status] = _BitmapImpl::CloneN(bitmap);
 
+       SetBackgroundBitmap(bitmap, status);\r
+       return;\r
+}\r
+\r
+void\r
+_CustomListItemImpl::SetBackgroundBitmap(const Bitmap& bitmap, TableViewItemDrawingStatus status)\r
+{\r
        if (__pTableViewItemData)
        {
                bool returnValue = __pTableViewItemData->SetBackgroundBitmap(__pBitmaps[status], status);