fix prevent issue
authorwoo <s-w.woo@samsung.com>
Sun, 14 Apr 2013 11:52:47 +0000 (20:52 +0900)
committerwoo <s-w.woo@samsung.com>
Sun, 14 Apr 2013 11:56:47 +0000 (20:56 +0900)
Change-Id: I9baca263ccb9fdd56062f5d16e380a23018a7616
Signed-off-by: woo <s-w.woo@samsung.com>
src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp
src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp
src/ui/controls/FUiCtrl_ListViewImpl.cpp
src/ui/controls/FUiCtrl_PanelImpl.cpp
src/ui/controls/FUiCtrl_TabBarPresenter.cpp
src/ui/controls/FUiCtrl_TableViewItem.cpp

index 449ea55..904c7c9 100755 (executable)
@@ -309,26 +309,25 @@ _GroupContainerPresenter::DrawBackgroundEffectBitmapForSystemChild(Canvas* pCanv
 Color
 _GroupContainerPresenter::GetParentColor(void) const
 {
-       Color parentBgColor = Color(0, 0, 0, 0);
-       _Form* pForm = null;
-
        _Control* pParentControl = __pGroupContainer->GetParent();
-
-       if (pParentControl)
+       if (!pParentControl)
        {
-               parentBgColor = pParentControl->GetBackgroundColor();
-               pForm = dynamic_cast<_Form*>(pParentControl);
+               return Color(0, 0, 0, 0);
        }
 
+       Color parentBgColor = pParentControl->GetBackgroundColor();
+       _Form* pForm = dynamic_cast<_Form*>(pParentControl);
+
        while (pForm == null && parentBgColor.GetAlpha() == 0x00)
        {
                pParentControl = pParentControl->GetParent();
-
-               if (pParentControl)
+               if (!pParentControl)
                {
-                       pForm = dynamic_cast<_Form*>(pParentControl);
-                       parentBgColor = pParentControl->GetBackgroundColor();
+                       break;
                }
+
+               pForm = dynamic_cast<_Form*>(pParentControl);
+               parentBgColor = pParentControl->GetBackgroundColor();
        }
 
        return parentBgColor;
index 3fcb6f8..2faf4c9 100644 (file)
@@ -75,14 +75,15 @@ public:
                , __pLongPressedGesture(null)
        {
                __pTouchManager = _TouchManager::GetInstance();
-               SysTryReturnVoidResult(NID_UI, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
+               SysTryReturnVoidResult(NID_UI_CTRL, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
 
                // Add _TouchLongPressGestureDetector
                __pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector();
                SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
                __core.AddGestureDetector(*__pLongPressedGesture);
-               __pLongPressedGesture->AddGestureListener(*this);
+               result r = __pLongPressedGesture->AddGestureListener(*this);
+               SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] propagating.", GetErrorMessage(r));
        }
 
        virtual ~_GroupedListViewPropagatedTouchEventListener(void)
@@ -1113,7 +1114,7 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType
                        memset(&itemStatus, 0, sizeof(_ListViewItemStatus));
                        bool needChangeEventTarget = false;
 
-                       if (pListViewItem->IsItemSelected())
+                       if (pListViewItem != null && pListViewItem->IsItemSelected())
                        {
                                needChangeEventTarget = true;
                        }
index 970e24a..2f00bb4 100644 (file)
@@ -73,14 +73,15 @@ public:
                , __pLongPressedGesture(null)
        {
                __pTouchManager = _TouchManager::GetInstance();
-               SysTryReturnVoidResult(NID_UI, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
+               SysTryReturnVoidResult(NID_UI_CTRL, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
 
                // Add _TouchLongPressGestureDetector
                __pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector();
                SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
 
                __core.AddGestureDetector(*__pLongPressedGesture);
-               __pLongPressedGesture->AddGestureListener(*this);
+               result r = __pLongPressedGesture->AddGestureListener(*this);
+               SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] propagating.", GetErrorMessage(r));
        }
 
        virtual ~_ListViewPropagatedTouchEventListener(void)
@@ -1086,7 +1087,7 @@ _ListViewImpl::RefreshList(int index, ListRefreshType type, bool needFlush)
                        memset(&itemStatus, 0, sizeof(_ListViewItemStatus));
                        bool needChangeEventTarget = false;
 
-                       if (pListViewItem->IsItemSelected())
+                       if (pListViewItem != null && pListViewItem->IsItemSelected())
                        {
                                needChangeEventTarget = true;
                        }
index 583b14c..922c8eb 100644 (file)
@@ -202,7 +202,12 @@ _PanelImpl::OnAttachedToMainTree(void)
                                controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
                                GetBuilderBoundsF(controlOrientation, builderBounds);
                        }
-                       SetBounds(builderBounds);
+                       result r = SetBounds(builderBounds);
+                       if (r != E_SUCCESS)
+                       {
+                               SysLogException(NID_UI_CTRL, r, "[%s] SetBounds failed", GetErrorMessage(r));
+                       }
+
                        SetChildBuilderBouds(this, controlOrientation);
                }
        }
index a1a1aca..b4b853a 100755 (executable)
@@ -995,6 +995,14 @@ _TabBarPresenter::SetAllAccessibilityElement(void)
                for (int i = 0; i < itemCount; i++)
                {
                        _TabBarItem* pItem = __pTabBarModel->GetItemAt(i);
+                       if (pItem == null)
+                       {
+                               result r = GetLastResult();
+                               SysLogException(NID_UI_CTRL, r, "[%s] The current value of pItem is null", GetErrorMessage(r));
+
+                               continue;
+                       }
+
                        _AccessibilityElement* pElement = pItem->GetAccessibilityElement();
                        if (pElement == null)
                        {
index d9b89b4..6d1f0d6 100644 (file)
@@ -2715,23 +2715,26 @@ _TableViewItem::DrawAnnexOnOffHandler(float position)
                handlerBounds.x = backgroundBounds.x + annexMargin;
        }
 
-       nextHandlerBounds = handlerBounds.x + (position - __annexOnOffTouchPosition);
-       annexAbsoluteBoundsStart = __pItemAnnex->GetBoundsF().x;
-       annexAbsoluteBoundsEnd = __pItemAnnex->GetBoundsF().x + __pItemAnnex->GetBoundsF().width + annexMargin;
-
-       if((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width)  < annexAbsoluteBoundsEnd &&
-               (annexAbsoluteBoundsStart + nextHandlerBounds) > annexAbsoluteBoundsStart)
-       {
-               handlerBounds.x = nextHandlerBounds;
-               __annexOnOffHandlerLastPosition = annexAbsoluteBoundsStart + nextHandlerBounds;
-       }
-       else if(_FloatCompareGE((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width), annexAbsoluteBoundsEnd))
+       if (__pItemAnnex != null)
        {
-               handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
-       }
-       else if(_FloatCompareLE((annexAbsoluteBoundsStart + nextHandlerBounds), annexAbsoluteBoundsStart))
-       {
-               handlerBounds.x = backgroundBounds.x + annexMargin;
+               nextHandlerBounds = handlerBounds.x + (position - __annexOnOffTouchPosition);
+               annexAbsoluteBoundsStart = __pItemAnnex->GetBoundsF().x;
+               annexAbsoluteBoundsEnd = __pItemAnnex->GetBoundsF().x + __pItemAnnex->GetBoundsF().width + annexMargin;
+
+               if((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width)  < annexAbsoluteBoundsEnd &&
+                       (annexAbsoluteBoundsStart + nextHandlerBounds) > annexAbsoluteBoundsStart)
+               {
+                       handlerBounds.x = nextHandlerBounds;
+                       __annexOnOffHandlerLastPosition = annexAbsoluteBoundsStart + nextHandlerBounds;
+               }
+               else if(_FloatCompareGE((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width), annexAbsoluteBoundsEnd))
+               {
+                       handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
+               }
+               else if(_FloatCompareLE((annexAbsoluteBoundsStart + nextHandlerBounds), annexAbsoluteBoundsStart))
+               {
+                       handlerBounds.x = backgroundBounds.x + annexMargin;
+               }
        }
 
        DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler);