From: Vinay Dutt Vyas Date: Thu, 4 Apr 2013 10:45:46 +0000 (+0530) Subject: Prevent Issue fixes X-Git-Tag: accepted/tizen_2.1/20130425.033138~426^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5978ccc0c189ae3a148cc25573112b0d514b025;p=platform%2Fframework%2Fnative%2Fuifw.git Prevent Issue fixes Change-Id: Ib7ed79784a8ebae592106505218a0406b78d506d --- diff --git a/src/ui/controls/FUiCtrl_GroupContainer.cpp b/src/ui/controls/FUiCtrl_GroupContainer.cpp index 5b1dc1e..2142d36 100644 --- a/src/ui/controls/FUiCtrl_GroupContainer.cpp +++ b/src/ui/controls/FUiCtrl_GroupContainer.cpp @@ -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(pChildImpl->GetPublic())); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp b/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp index 49b0e88..502acfa 100755 --- a/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp +++ b/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp @@ -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(); diff --git a/src/ui/controls/FUiCtrl_Progress.cpp b/src/ui/controls/FUiCtrl_Progress.cpp index f961c39..922d962 100644 --- a/src/ui/controls/FUiCtrl_Progress.cpp +++ b/src/ui/controls/FUiCtrl_Progress.cpp @@ -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; } diff --git a/src/ui/controls/FUiCtrl_ProgressPresenter.cpp b/src/ui/controls/FUiCtrl_ProgressPresenter.cpp index 738f07a..acf48bc 100755 --- a/src/ui/controls/FUiCtrl_ProgressPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPresenter.cpp @@ -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; diff --git a/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp b/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp index 3336cf4..6a46fd3 100755 --- a/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp @@ -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(); diff --git a/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp b/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp index 397e014..4c6e94a 100644 --- a/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp @@ -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: