Fix b/s defect when OspCompat=True
authorjaewon7.cho <jaewon7.cho@samsung.com>
Tue, 2 Apr 2013 05:08:50 +0000 (14:08 +0900)
committerjaewon7.cho <jaewon7.cho@samsung.com>
Tue, 2 Apr 2013 05:08:50 +0000 (14:08 +0900)
Change-Id: I7d7c3d23cae4277ff7241e8f80654e1ebb3f4dd6
Signed-off-by: jaewon7.cho <jaewon7.cho@samsung.com>
src/ui/FUi_ContainerImpl.cpp
src/ui/FUi_Control.cpp
src/ui/FUi_WindowImpl.cpp [changed mode: 0644->0755]
src/ui/inc/FUi_ContainerImpl.h
src/ui/inc/FUi_Control.h

index ae15e7a..bfd7111 100755 (executable)
@@ -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 <ArrayList*>(GetChildrenPublic());
        DeleteAllChildren(this, detachSystemChild, pChildrenList);
 }
index be24234..328ade9 100755 (executable)
@@ -1432,6 +1432,7 @@ _Control::CallOnDetachingFromMainTree(_Control& control)
                                E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range.");\r
                }\r
                r = CallOnDetachingFromMainTree(*pChild);\r
+               pChild->SetCalledCallAttachingToMainTree(false);\r
                pChild->SetCalledCallAttachedToMainTree(false);\r
                SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
        }\r
@@ -1439,7 +1440,8 @@ _Control::CallOnDetachingFromMainTree(_Control& control)
        if (__isPostOrderTraversal)\r
        {\r
                r = control.GetControlDelegate().OnDetachingFromMainTree();\r
-               pChild->SetCalledCallAttachedToMainTree(false);\r
+               control.SetCalledCallAttachingToMainTree(false);\r
+               control.SetCalledCallAttachedToMainTree(false);\r
                SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
        }\r
 \r
@@ -3917,6 +3919,12 @@ _Control::SetTerminatingOrder(bool postOrderTraversal)
        __isPostOrderTraversal = postOrderTraversal;\r
 }\r
 \r
+bool\r
+_Control::IsPostOrderTraversal(void)\r
+{\r
+       return __isPostOrderTraversal;\r
+}\r
+\r
 void\r
 _Control::SetParent(_Control* pParent)\r
 {\r
old mode 100644 (file)
new mode 100755 (executable)
index afc8919..c820590
@@ -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;
index 5f4bda2..f2e3f23 100755 (executable)
@@ -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);
 
index 20ed139..a33f17e 100755 (executable)
@@ -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);