Modified bitmap drawing logic on _ListViewItem(N_SE-40563, N_SE-40825)
authorSuhwan Park <suhwan0927.park@samsung.com>
Sat, 8 Jun 2013 06:21:51 +0000 (11:51 +0530)
committerSuhwan Park <suhwan0927.park@samsung.com>
Sat, 8 Jun 2013 06:21:51 +0000 (11:51 +0530)
Change-Id: I69f4e561fc5a429cd05f95b27d30adf06ffa7ffb
Signed-off-by: Suhwan Park <suhwan0927.park@samsung.com>
src/ui/controls/FUiCtrl_ListViewItem.cpp
src/ui/inc/FUiCtrl_ListViewItem.h

index 1498d40..5862ba9 100644 (file)
@@ -193,7 +193,7 @@ _ListViewItem::AddElement(FloatRectangle& rect, int elementId, const String& tex
 }
 
 result
-_ListViewItem::AddElement(FloatRectangle& rect, int elementId, const EnrichedText* pEnrichedText, bool textSliding)
+_ListViewItem::AddElement(FloatRectangle& rect, int elementId, const EnrichedText* pEnrichedText)
 {
        SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG,
                        ("[E_INVALID_ARG] This elementId already exists."));
@@ -221,7 +221,7 @@ _ListViewItem::AddElement(FloatRectangle& rect, int elementId, const EnrichedTex
 
        element.pTextElement->pTextObject = pText;
        element.pTextElement->pEnrichedText = pCloneText;
-       element.pTextElement->textSlidingEnabled = textSliding;
+       element.pTextElement->textSlidingEnabled = false;
 
        GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]);
        GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]);
@@ -1448,36 +1448,23 @@ _ListViewItem::DrawBitmap(FloatRectangle& rect, ListViewItemDrawingStatus status
 
        pBitmap->pVE->SetBounds(rect);
 
-       bool isNinePatchedBitmap = _BitmapImpl::CheckNinePatchedBitmapStrictly(*pDrawBitmap);
-       String imagePath = _BitmapImpl::GetInstance(*pDrawBitmap)->GetFileName();
+       Canvas* pCanvas = pBitmap->pVE->GetCanvasN();
+       SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
+       pCanvas->Clear();
 
-       if (!isNinePatchedBitmap && !imagePath.IsEmpty())
+       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pDrawBitmap))
        {
-               pBitmap->pVE->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f));
-               pBitmap->pVE->SetImageSource(imagePath);
+               pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap);
        }
        else
        {
-               pBitmap->pVE->SetImageSource(L"");
-
-               Canvas* pCanvas = pBitmap->pVE->GetCanvasN();
-               SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-               pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
-               pCanvas->Clear();
-
-               if (isNinePatchedBitmap)
-               {
-                       pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap);
-               }
-               else
-               {
-                       pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap);
-               }
-
-               delete pCanvas;
+               pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap);
        }
 
+       delete pCanvas;
+
        return true;
 }
 
@@ -1678,6 +1665,7 @@ _ListViewItem::ParseCutlinkText(_ListViewItemElementText* pElementText)
 
        // remove all text element in _EnrichedTextImpl
        pElementText->pEnrichedText->RemoveAllTextElements(true);
+       //pTextObject->RemoveAll(true);
 
        while (pTextLinkInfo != null)
        {
index 7d2858d..1c9e1bb 100644 (file)
@@ -146,7 +146,7 @@ public:
 
        result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = false);
 
-       result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::EnrichedText* pEnrichedText, bool textSliding = false);
+       result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::EnrichedText* pEnrichedText);
 
        result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::Bitmap* pNormalBitmap,
                        const Tizen::Graphics::Bitmap* pPressedBitmap = null, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null);