Added PropertyValue Array as a class
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / slider / slider-impl.cpp
index 94d4bbe..92efa56 100755 (executable)
@@ -355,14 +355,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
 
 void Slider::SetMarks( const MarkList& marks )
 {
-  float value;
-  for( MarkList::const_iterator it = marks.begin(), itEnd = marks.end(); it != itEnd; ++it )
-  {
-    const Property::Value& propertyValue = *it;
-    propertyValue.Get( value );
-
-    mMarks.push_back( value );
-  }
+  mMarks = marks;
 }
 
 const Slider::MarkList& Slider::GetMarks() const
@@ -732,9 +725,9 @@ float Slider::MarkFilter( float value )
   const float MARK_TOLERANCE = GetMarkTolerance();
 
   float mark;
-  for( MarkList::iterator it = mMarks.begin(), itEnd = mMarks.end(); it != itEnd; ++it )
+  for( std::size_t i = 0; i < mMarks.Size(); ++i)
   {
-    const Property::Value& propertyValue = *it;
+    const Property::Value& propertyValue = mMarks[i];
     propertyValue.Get( mark );
     mark = MapValuePercentage( mark );
 
@@ -754,9 +747,9 @@ float Slider::SnapToMark( float value )
   float closestDist = std::numeric_limits<float>::max();
 
   float mark;
-  for( MarkList::iterator it = mMarks.begin(), itEnd = mMarks.end(); it != itEnd; ++it )
+  for( std::size_t i = 0; i < mMarks.Size(); ++i)
   {
-    const Property::Value& propertyValue = *it;
+    const Property::Value& propertyValue = mMarks[i];
     propertyValue.Get( mark );
     mark = MapValuePercentage( mark );
 
@@ -777,7 +770,7 @@ bool Slider::MarkReached( float value, int& outIndex )
 
   // Binary search
   int head = 0,
-      tail = mMarks.size() - 1;
+      tail = mMarks.Size() - 1;
   int current;
   float mark;