Prevent Issue fixes
authorVinay Dutt Vyas <vinay.vyas@samsung.com>
Thu, 4 Apr 2013 10:45:46 +0000 (16:15 +0530)
committerVinay Dutt Vyas <vinay.vyas@samsung.com>
Fri, 5 Apr 2013 07:49:02 +0000 (13:19 +0530)
Change-Id: Ib7ed79784a8ebae592106505218a0406b78d506d

src/ui/controls/FUiCtrl_GroupContainer.cpp
src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp
src/ui/controls/FUiCtrl_Progress.cpp
src/ui/controls/FUiCtrl_ProgressPresenter.cpp
src/ui/controls/FUiCtrl_SearchBarPresenter.cpp
src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp

index 5b1dc1e..2142d36 100644 (file)
@@ -389,11 +389,11 @@ _GroupContainer::RemoveControlAt(int rowIndex, int columnIndex)
 
        pChild = GetControlCoreAt(rowIndex, columnIndex);
        r = GetLastResult();
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+       SysTryReturnResult(NID_UI_CTRL, pChild != null, r, "[%s] Propagating.", GetErrorMessage(r));
 
        pChildImpl = static_cast<_ControlImpl*>(pChild->GetUserData());
        r = GetLastResult();
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+       SysTryReturnResult(NID_UI_CTRL, pChildImpl != null, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = __pGroupContainerImpl->GetPublic().RemoveControl(const_cast<Control&>(pChildImpl->GetPublic()));
        SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
index 49b0e88..502acfa 100755 (executable)
@@ -106,9 +106,14 @@ _GroupContainerPresenter::Draw(void)
        float lineWidth = __pGroupContainer->GetLineWidth();
 
        Canvas* pCanvas = __pGroupContainer->GetVisualElement()->GetCanvasN();
+       SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "[E SYSTEM] A system error has occurred. Failed to get the canvas.");
+
+       Canvas* pControlCanvas;
        _Control* pControl = __pGroupContainer->GetSystemChild();
-       Canvas* pControlCanvas = pControl->GetCanvasN();
-       SysTryCatch(NID_UI_CTRL, pCanvas != null, ,E_SYSTEM, "A system error has occurred. Failed to get the canvas.");
+       SysTryCatch(NID_UI_CTRL, pControl != null, ,E_SYSTEM, "[E SYSTEM] A system error has occurred. Failed to get the child control.");
+
+       pControlCanvas = pControl->GetCanvasN();
+       SysTryCatch(NID_UI_CTRL, pControlCanvas != null, ,E_SYSTEM, "[E SYSTEM] A system error has occurred. Failed to get the canvas.");
 
        pCanvas->SetBackgroundColor(__pGroupContainer->GetBackgroundColor());
        pCanvas->Clear();
index f961c39..922d962 100644 (file)
@@ -48,16 +48,6 @@ _Progress::_Progress(void)
        {
                pBase->SetSurfaceOpaque(false);
        }
-
-       if(likely((_AccessibilityManager::IsActivated())))
-       {
-               _AccessibilityContainer* pContainer = GetAccessibilityContainer();
-               if (pContainer)
-               {
-                       pContainer->Activate(true);
-                       InitializeAccessibilityElement();
-               }
-       }
 }
 
 _Progress::~_Progress(void)
@@ -93,6 +83,16 @@ _Progress::CreateProgressN()
        pProgress->AcquireHandle();
        pProgress->SetFocusable(false);
 
+       if (likely((_AccessibilityManager::IsActivated())))
+       {
+               _AccessibilityContainer* pContainer = pProgress->GetAccessibilityContainer();
+               if (pContainer)
+               {
+                       pContainer->Activate(true);
+                       pProgress->InitializeAccessibilityElement();
+               }
+       }
+
        return pProgress;
 
 CATCH:
@@ -107,7 +107,7 @@ _Progress::InitializeAccessibilityElement(void)
 {
        result r = E_SUCCESS;
 
-       if(likely(!(_AccessibilityManager::IsActivated())))
+       if (likely(!(_AccessibilityManager::IsActivated())))
        {
                return r;
        }
index 738f07a..acf48bc 100755 (executable)
@@ -339,7 +339,7 @@ _ProgressPresenter::Draw(void)
        {
                pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pProgress->GetBarBackgroundColor());
                r = GetLastResult();
-               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to get replacement color.", GetErrorMessage(r));
+               SysTryCatch(NID_UI_CTRL, pReplacementBitmap != null, , r, "[%s] Failed to get replacement color.", GetErrorMessage(r));
                delete __pBarBgColorReplacementBitmap;
                __pBarBgColorReplacementBitmap = null;
 
@@ -362,7 +362,7 @@ _ProgressPresenter::Draw(void)
                {
                        pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pProgress->GetBarColor());
                        r = GetLastResult();
-                       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to get replacement color.", GetErrorMessage(r));
+                       SysTryCatch(NID_UI_CTRL, pReplacementBitmap != null, , r, "[%s] Failed to get replacement color.", GetErrorMessage(r));
                        delete __pBarColorReplacementBitmap;
                        __pBarColorReplacementBitmap = null;
 
index 3336cf4..6a46fd3 100755 (executable)
@@ -593,11 +593,14 @@ _SearchBarPresenter::OnBoundsChanged(void)
        }
 
        result r = E_SUCCESS;
+       float cancelButtonWidth = 0.0f;
 
        if (__pCancelButton != null)
        {
                r = __pSearchBar->ResizeCancelButton();
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.",GetErrorMessage(r));
+
+               cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
        }
 
        r = __pEdit->SetBounds(__searchFieldBounds);
@@ -608,8 +611,7 @@ _SearchBarPresenter::OnBoundsChanged(void)
                float buttonWidth = 0.0f;
                _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
                GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
-               float cancelButtonWidth = 0.0f;
-               cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
+
                if (cancelButtonWidth > buttonWidth)
                {
                        __pSearchBar->RecalculateButtonBounds();
index 397e014..4c6e94a 100644 (file)
@@ -1083,29 +1083,27 @@ _SplitPanelPresenter::AnimatePaneParent(int destination)
        FloatRectangle secondPaneEndBounds(0.0f, 0.0f, 0.0f, 0.0f);
 
        pFirstPane = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+       SysTryReturnResult(NID_UI_CTRL, pFirstPane != null, GetLastResult(), "Propagating.");
+
        pSecondPane = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_SECOND);
+       SysTryReturnResult(NID_UI_CTRL, pSecondPane != null, GetLastResult(), "Propagating.");
 
-       if (pFirstPane)
-       {
-               pVEFirstPane = pFirstPane->GetVisualElement();
-               SysTryReturnResult(NID_UI_CTRL, pVEFirstPane != null, GetLastResult(), "Propagating.");
+       pVEFirstPane = pFirstPane->GetVisualElement();
+       SysTryReturnResult(NID_UI_CTRL, pVEFirstPane != null, GetLastResult(), "Propagating.");
 
-               pVEFirstPane->RemoveAllAnimations();
-       }
+       pVEFirstPane->RemoveAllAnimations();
 
-       if (pSecondPane)
-       {
-               pVESecondPane = pSecondPane->GetVisualElement();
-               SysTryReturnResult(NID_UI_CTRL, pVESecondPane != null, GetLastResult(), "Propagating.");
+       pVESecondPane = pSecondPane->GetVisualElement();
+       SysTryReturnResult(NID_UI_CTRL, pVESecondPane != null, GetLastResult(), "Propagating.");
 
-               pVESecondPane->RemoveAllAnimations();
-       }
+       pVESecondPane->RemoveAllAnimations();
 
        pAnimationFirstPane = GetVisualElementAnimation(L"bounds");
        SysTryReturnResult(NID_UI_CTRL, pAnimationFirstPane != null, GetLastResult(), "Propagating.");
 
        pAnimationSecondPane = GetVisualElementAnimation(L"bounds");
-       SysTryReturnResult(NID_UI_CTRL, pAnimationSecondPane != null, GetLastResult(), "Propagating.");
+       r = GetLastResult();
+       SysTryCatch(NID_UI_CTRL, pAnimationSecondPane != null, , r, "[%s] Propagating.", GetErrorMessage(r));
 
        clientBounds = __pSplitPanel->GetBoundsF();
        firstPaneBounds = pFirstPane->GetBoundsF();
@@ -1177,39 +1175,29 @@ _SplitPanelPresenter::AnimatePaneParent(int destination)
                break;
        }
 
-       if (pFirstPane)
-       {
-               r = pAnimationFirstPane->SetStartValue(firstPaneStartBounds);
-               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+       //Animate first pane
+       r = pAnimationFirstPane->SetStartValue(firstPaneStartBounds);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
 
-               r = pAnimationFirstPane->SetEndValue(firstPaneEndBounds);
-               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+       r = pAnimationFirstPane->SetEndValue(firstPaneEndBounds);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
 
-               pFirstPane->SetBounds(firstPaneEndBounds);
+       pFirstPane->SetBounds(firstPaneEndBounds);
 
-               if (pVEFirstPane)
-               {
-                       pVEFirstPane->AddAnimation(L"Bounds", *pAnimationFirstPane);
-                       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
-               }
-       }
+       pVEFirstPane->AddAnimation(L"Bounds", *pAnimationFirstPane);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
 
-       if (pSecondPane)
-       {
-               r = pAnimationSecondPane->SetStartValue(secondPaneStartBounds);
-               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+       //Animate second pane
+       r = pAnimationSecondPane->SetStartValue(secondPaneStartBounds);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
 
-               r = pAnimationSecondPane->SetEndValue(secondPaneEndBounds);
-               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+       r = pAnimationSecondPane->SetEndValue(secondPaneEndBounds);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
 
-               pSecondPane->SetBounds(secondPaneEndBounds);
+       pSecondPane->SetBounds(secondPaneEndBounds);
 
-               if (pVESecondPane)
-               {
-                       pVESecondPane->AddAnimation(L"Bounds", *pAnimationSecondPane);
-                       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
-               }
-       }
+       pVESecondPane->AddAnimation(L"Bounds", *pAnimationSecondPane);
+       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
 
 CATCH: