Rollback - Change deleting order of Controls
authorjaewon7.cho <jaewon7.cho@samsung.com>
Sat, 23 Mar 2013 04:28:52 +0000 (13:28 +0900)
committerjaewon7.cho <jaewon7.cho@samsung.com>
Sat, 23 Mar 2013 04:28:52 +0000 (13:28 +0900)
Change-Id: I09dd29f08d8c608c5d2c047cdfbb3f8eae08b378
Signed-off-by: jaewon7.cho <jaewon7.cho@samsung.com>
src/ui/FUi_ContainerImpl.cpp
src/ui/inc/FUi_ContainerImpl.h

index ba60f00..b4c13a0 100644 (file)
@@ -246,54 +246,6 @@ _ContainerImpl::RemoveChild(int index)
 }
 
 void
-_ContainerImpl::DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild)
-{
-       ArrayList* pList = static_cast <ArrayList*>(pChild->GetChildrenPublic());
-       int count = pList->GetCount();
-       for (int index = 0; index < count; index++)
-       {
-               Container* pContainer = dynamic_cast <Container*>(pList->GetAt(index));
-               result r = GetLastResult();
-               if (IsFailed(r))
-               {
-                       SysAssert(r == E_OUT_OF_RANGE);
-                       SysLogException(NID_UI,
-                                        E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range (index = %d, count = %d.)",
-                                        index, GetChildCount());
-                       return;
-               }
-
-               if (pContainer)
-               {
-                       _ContainerImpl* pContainerImpl = _ContainerImpl::GetInstance(*pContainer);
-                       DeleteAllChildren(pContainerImpl, detachSystemChild);
-                       pContainer->Destroy();
-               }
-               else
-               {
-                       Control* pControl = static_cast <Control*>(pList->GetAt(index));
-                       result r = GetLastResult();
-                       if (IsFailed(r))
-                       {
-                               SysAssert(r == E_OUT_OF_RANGE);
-                               SysLogException(NID_UI,
-                                                E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range (index = %d, count = %d.)",
-                                                index, GetChildCount());
-                               return;
-                       }
-                       _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
-                       if (pControlImpl)
-                       {
-                               if (detachSystemChild || pControlImpl->GetCore().GetArea() != _CONTROL_AREA_SYSTEM)
-                               {
-                                       pControl->Destroy();
-                               }
-                       }
-               }
-       }
-}
-
-void
 _ContainerImpl::RemoveAllChildren(bool detachSystemChild)
 {
        ClearLastResult();
@@ -301,11 +253,10 @@ _ContainerImpl::RemoveAllChildren(bool detachSystemChild)
 
        GetCore().DetachAllChildren(detachSystemChild);
        SysAssert(GetLastResult() == E_SUCCESS);
-       DeleteAllChildren(this, detachSystemChild);
 
        if (detachSystemChild)
        {
-               __controlPublics.RemoveAll(false);
+               __controlPublics.RemoveAll(true);
        }
        else
        {
@@ -321,11 +272,10 @@ _ContainerImpl::RemoveAllChildren(bool detachSystemChild)
                                continue;
                        }
 
-                       r = __controlPublics.Remove(pControl->GetPublic(), false);
+                       r = __controlPublics.Remove(pControl->GetPublic(), true);
                        SysAssert(r == E_SUCCESS);
                }
        }
-
 }
 
 result
index 28d04dc..fb82ca1 100644 (file)
@@ -53,7 +53,6 @@ public:
        result AddChild(_ControlImpl* pChild, bool transferOwnership = true);
        result RemoveChild(_ControlImpl* pChild, bool deallocate = true);
        result RemoveChild(int index);
-       void DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild = true);
        void RemoveAllChildren(bool detachSystemChild = true);
        result MoveChildToTop(const _ControlImpl& child);
        result MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child);