Fix prevent issues
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-page-path-effect-impl.cpp
index 50d57a1..89268b3 100644 (file)
 // CLASS HEADER
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h>
 
-//INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/property-array.h>
+
+// INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
 
 namespace Dali
@@ -40,20 +43,21 @@ ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& for
   mPathConstrainer.SetProperty( PathConstrainer::Property::FORWARD, forward );
 
   Dali::Property::Value pointsProperty = path.GetProperty(Path::Property::POINTS);
-  Property::Array points;
-  pointsProperty.Get(points);
-  mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, points );
+  mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, pointsProperty );
 
   pointsProperty = path.GetProperty(Path::Property::CONTROL_POINTS);
-  pointsProperty.Get(points);
-  mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, points );
+  mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, pointsProperty );
 
   //Create linear constrainer
-  Property::Array pointsLinearConstrainer;
-  pointsProperty = Property::Value(pointsLinearConstrainer);
-  pointsProperty.AppendItem(0.0f);
-  pointsProperty.AppendItem(1.0f);
-  pointsProperty.AppendItem(0.0f);
+  pointsProperty = Property::Value(Property::ARRAY);
+  Property::Array* array = pointsProperty.GetArray();
+
+  if( array )
+  {
+    array->PushBack(0.0f);
+    array->PushBack(1.0f);
+    array->PushBack(0.0f);
+  }
   mLinearConstrainer = Dali::LinearConstrainer::New();
   mLinearConstrainer.SetProperty( LinearConstrainer::Property::VALUE, pointsProperty );
 }