Merge "Fix the warning log in Control causing the wrong position" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / item-view / item-view-impl.cpp
index 23fcd36..a5741ab 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -997,6 +997,8 @@ void ItemView::OnChildAdd(Actor& child)
                                         Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE);
     }
   }
+
+  Scrollable::OnChildAdd( child );
 }
 
 bool ItemView::OnWheelEvent(const WheelEvent& event)
@@ -1765,9 +1767,10 @@ Property::Array ItemView::GetLayoutArray()
 void ItemView::SetLayoutArray( const Property::Array& layouts )
 {
   mlayoutArray = layouts;
-  if(GetLayoutCount() > 0)
+  const int layoutCount = GetLayoutCount();
+  if( layoutCount > 0 )
   {
-    for(unsigned int index = GetLayoutCount() - 1; index >= 0; --index)
+    for(int index = layoutCount - 1; index >= 0; --index)
     {
       RemoveLayout(index);
       if(index == 0) break;