Revert "[Tizen] Changed Control::SetLayout to handle empty layouts"
authorSunghyun kim <scholb.kim@samsung.com>
Mon, 2 Jul 2018 06:04:45 +0000 (15:04 +0900)
committerSunghyun kim <scholb.kim@samsung.com>
Mon, 2 Jul 2018 06:04:49 +0000 (15:04 +0900)
This reverts commit 0c1682a0a9fe06d17a86a1de84f4ec2af6237e0d.

Change-Id: I27bd080de67ce32cd6dbb554558f8ab9c96ab9e0

automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h

index fdb1bd2..75b42b8 100644 (file)
@@ -1192,57 +1192,3 @@ int UtcDaliLayouting_RelayoutOnChildOrderChanged(void)
 
   END_TEST;
 }
-
-int UtcDaliLayouting_RemoveLayout01(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliLayouting_RemoveLayout");
-
-  Stage stage = Stage::GetCurrent();
-
-  auto rootControl = Control::New();
-  auto absoluteLayout = AbsoluteLayout::New();
-  DevelControl::SetLayout( rootControl, absoluteLayout );
-  rootControl.SetName( "AbsoluteLayout" );
-  stage.Add( rootControl );
-
-  auto hbox = Control::New();
-  auto hboxLayout = LinearLayout::New();
-  hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
-  DevelControl::SetLayout( hbox, hboxLayout );
-  hbox.SetName( "HBox" );
-
-  std::vector< Control > controls;
-  controls.push_back( CreateLeafControl( 40, 40 ) );
-  controls.push_back( CreateLeafControl( 60, 40 ) );
-
-  for( auto&& iter : controls )
-  {
-    hbox.Add( iter );
-  }
-  hbox.SetParentOrigin( ParentOrigin::CENTER );
-  hbox.SetAnchorPoint( AnchorPoint::CENTER );
-  rootControl.Add( hbox );
-
-  tet_infoline("Layout as normal");
-  application.SendNotification();
-  application.Render();
-
-  tet_infoline("Set an empty layout on hbox container");
-  LinearLayout emptyLayout;
-  DevelControl::SetLayout( hbox, emptyLayout );
-
-  tet_infoline("Run another layout");
-  application.SendNotification();
-  application.Render();
-
-  tet_infoline("Check leaf controls haven't moved");
-
-  DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
-  DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 40.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
-
-  DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
-  DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
-
-  END_TEST;
-}
index a4685ff..29ceb14 100755 (executable)
@@ -133,14 +133,7 @@ void SetLayout( Control control, Toolkit::LayoutItem layout )
 {
   Internal::Control& internalControl = Toolkit::Internal::GetImplementation( control );
   Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
-  if( layout )
-  {
-    controlDataImpl.SetLayout( GetImplementation( layout ) );
-  }
-  else
-  {
-    controlDataImpl.RemoveLayout();
-  }
+  controlDataImpl.SetLayout( GetImplementation( layout ) );
 }
 
 } // namespace DevelControl
index a6d30d9..73769c8 100755 (executable)
@@ -1442,15 +1442,6 @@ void Control::Impl::SetLayout( Toolkit::Internal::LayoutItem& layout )
   mLayout->Initialize( controlHandle, controlHandle.GetTypeName() ); // LayoutGroup takes ownership of existing children
 }
 
-void Control::Impl::RemoveLayout()
-{
-  if( mLayout )
-  {
-    mLayout->Unparent();
-    mLayout.Reset();
-  }
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index d2eb48e..2a06d4c 100755 (executable)
@@ -337,14 +337,6 @@ public:
    */
   void SetLayout( Toolkit::Internal::LayoutItem& layout );
 
-  /**
-   * @brief Remove the layout from this control
-   *
-   * @note This does not remove any children from this control, nor does it strip
-   * layouts from them but it does remove them from the layout hierarchy.
-   */
-  void RemoveLayout();
-
 private:
 
   /**