From d94ec57cf24973fba24cbcabd3fa6c7d4f243bc9 Mon Sep 17 00:00:00 2001 From: "jaewon7.cho" Date: Tue, 2 Apr 2013 16:19:59 +0900 Subject: [PATCH] Add E_OBJ_NOT_FOUND exception to Container:GetControl() function Change-Id: Icf69ad0cbcdd41f5b5d4c529efca0094532a5f34 Signed-off-by: jaewon7.cho --- src/ui/FUiContainer.cpp | 2 +- src/ui/FUi_ContainerImpl.cpp | 19 +++++++++++-------- src/ui/FUi_ControlImplManager.cpp | 1 - 3 files changed, 12 insertions(+), 10 deletions(-) mode change 100644 => 100755 src/ui/FUiContainer.cpp mode change 100644 => 100755 src/ui/FUi_ControlImplManager.cpp diff --git a/src/ui/FUiContainer.cpp b/src/ui/FUiContainer.cpp old mode 100644 new mode 100755 index 29a9149..05d6332 --- a/src/ui/FUiContainer.cpp +++ b/src/ui/FUiContainer.cpp @@ -347,7 +347,7 @@ Container::OnEvaluateSize(Dimension& evaluatedSize) bool Container::OnEvaluateSize(FloatDimension& evaluatedSize) { - + return false; } void diff --git a/src/ui/FUi_ContainerImpl.cpp b/src/ui/FUi_ContainerImpl.cpp index bfd7111..6e5a9b2 100755 --- a/src/ui/FUi_ContainerImpl.cpp +++ b/src/ui/FUi_ContainerImpl.cpp @@ -213,20 +213,23 @@ _ContainerImpl::RemoveControl(_ControlImpl* pChild, bool deallocate) if (pChildContainer) { _ContainerImpl* pParent = pChildContainer->GetParent(); - if (pParent) - { - r = pParent->RemoveChild(pChildContainer, false); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - } + SysTryReturn(NID_UI, pParent, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The control is not a child of this container."); + + r = pParent->RemoveChild(pChildContainer, false); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); pChildContainer->RemoveAllChildren(true); r = GetLastResult(); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Container* pContainer = &pChildContainer->GetPublic(); - delete pContainer; - pContainer = null; + if (deallocate) + { + Container* pContainer = &pChildContainer->GetPublic(); + delete pContainer; + pContainer = null; + } } else { + SysTryReturn(NID_UI, pChild, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The control is not a child of this container."); r = RemoveChild(pChild, deallocate); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } diff --git a/src/ui/FUi_ControlImplManager.cpp b/src/ui/FUi_ControlImplManager.cpp old mode 100644 new mode 100755 index d2c814d..b2b1cb4 --- a/src/ui/FUi_ControlImplManager.cpp +++ b/src/ui/FUi_ControlImplManager.cpp @@ -318,7 +318,6 @@ OrientationStatus _ControlImplManager::GetFormOrientationStatus(_ControlImpl* pControlImpl) { _FormImpl* pParentImpl = null; - _ControlImpl* pTempControlImpl = pControlImpl; OrientationStatus orientation = ORIENTATION_STATUS_NONE; while(pControlImpl) { -- 2.7.4