From 768d99bf5ed5e2aa8a32794ca1d40c5f27dc6d8b Mon Sep 17 00:00:00 2001 From: "jaewon7.cho" Date: Tue, 2 Apr 2013 14:08:50 +0900 Subject: [PATCH] Fix b/s defect when OspCompat=True Change-Id: I7d7c3d23cae4277ff7241e8f80654e1ebb3f4dd6 Signed-off-by: jaewon7.cho --- src/ui/FUi_ContainerImpl.cpp | 10 +++++++++- src/ui/FUi_Control.cpp | 10 +++++++++- src/ui/FUi_WindowImpl.cpp | 3 +-- src/ui/inc/FUi_ContainerImpl.h | 2 +- src/ui/inc/FUi_Control.h | 1 + 5 files changed, 21 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/ui/FUi_WindowImpl.cpp diff --git a/src/ui/FUi_ContainerImpl.cpp b/src/ui/FUi_ContainerImpl.cpp index ae15e7a..bfd7111 100755 --- a/src/ui/FUi_ContainerImpl.cpp +++ b/src/ui/FUi_ContainerImpl.cpp @@ -367,10 +367,18 @@ _ContainerImpl::DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild } void -_ContainerImpl::RemoveAllChildren(bool detachSystemChild) +_ContainerImpl::RemoveAllChildren(bool detachSystemChild, bool callOnDetachingFromMaintree) { + if (callOnDetachingFromMaintree && !GetCore().IsPostOrderTraversal()) + { + GetCore().GetControlDelegate().OnDetachingFromMainTree(); + } GetCore().DetachAllChildren(detachSystemChild, true); SysAssert(GetLastResult() == E_SUCCESS); + if (callOnDetachingFromMaintree && GetCore().IsPostOrderTraversal()) + { + GetCore().GetControlDelegate().OnDetachingFromMainTree(); + } ArrayList* pChildrenList = static_cast (GetChildrenPublic()); DeleteAllChildren(this, detachSystemChild, pChildrenList); } diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index be24234..328ade9 100755 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -1432,6 +1432,7 @@ _Control::CallOnDetachingFromMainTree(_Control& control) E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range."); } r = CallOnDetachingFromMainTree(*pChild); + pChild->SetCalledCallAttachingToMainTree(false); pChild->SetCalledCallAttachedToMainTree(false); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -1439,7 +1440,8 @@ _Control::CallOnDetachingFromMainTree(_Control& control) if (__isPostOrderTraversal) { r = control.GetControlDelegate().OnDetachingFromMainTree(); - pChild->SetCalledCallAttachedToMainTree(false); + control.SetCalledCallAttachingToMainTree(false); + control.SetCalledCallAttachedToMainTree(false); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -3917,6 +3919,12 @@ _Control::SetTerminatingOrder(bool postOrderTraversal) __isPostOrderTraversal = postOrderTraversal; } +bool +_Control::IsPostOrderTraversal(void) +{ + return __isPostOrderTraversal; +} + void _Control::SetParent(_Control* pParent) { diff --git a/src/ui/FUi_WindowImpl.cpp b/src/ui/FUi_WindowImpl.cpp old mode 100644 new mode 100755 index afc8919..c820590 --- a/src/ui/FUi_WindowImpl.cpp +++ b/src/ui/FUi_WindowImpl.cpp @@ -383,8 +383,7 @@ _WindowImpl::Destroy(void) _ControlImpl* pImpl = _ControlImpl::GetInstance(*pOwner); pImpl->GetCore().DetachOwnee(GetCore()); } - GetCore().GetControlDelegate().OnDetachingFromMainTree(); - RemoveAllChildren(true); + RemoveAllChildren(true, true); Window* pWindow = &GetPublic(); delete pWindow; pWindow = null; diff --git a/src/ui/inc/FUi_ContainerImpl.h b/src/ui/inc/FUi_ContainerImpl.h index 5f4bda2..f2e3f23 100755 --- a/src/ui/inc/FUi_ContainerImpl.h +++ b/src/ui/inc/FUi_ContainerImpl.h @@ -57,7 +57,7 @@ public: result RemoveControl(int index); result RemoveChild(int index); void DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild = true, Tizen::Base::Collection::ArrayList* pChildrenList = null); - void RemoveAllChildren(bool detachSystemChild = true); + void RemoveAllChildren(bool detachSystemChild = true, bool callOnDetachingFromMainTree = false); result MoveChildToTop(const _ControlImpl& child); result MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child); diff --git a/src/ui/inc/FUi_Control.h b/src/ui/inc/FUi_Control.h index 20ed139..a33f17e 100755 --- a/src/ui/inc/FUi_Control.h +++ b/src/ui/inc/FUi_Control.h @@ -369,6 +369,7 @@ public: void SetDrawWhenVisible(bool draw); bool IsDrawWhenVisible(void); void SetTerminatingOrder(bool postOrderTraversal); + bool IsPostOrderTraversal(void); // Font result SetFont(const Tizen::Base::String& fontName); -- 2.7.4