[dali_1.0.14] Merge branch 'tizen'
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / table-view / table-view-impl.cpp
index b6ff462..ef2935d 100644 (file)
 
 // CLASS HEADER
 #include <dali-toolkit/internal/controls/table-view/table-view-impl.h>
-#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
-#include <dlog.h>
 #include <sstream>
+#include <dali/public-api/object/ref-object.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
 
 using namespace Dali;
 using namespace std;
@@ -70,8 +72,8 @@ struct RelativeToWidthOrHeight
 // debugging support, very useful when new features are added or bugs are hunted down
 // currently not called from code so compiler will optimize these away, kept here for future debugging
 
-#define TABLEVIEW_TAG "DALI Toolkit::TableView"
-#define TV_LOG(fmt, args...) LOG(LOG_INFO, TABLEVIEW_TAG, fmt, ## args)
+#define TABLEVIEW_TAG "DALI Toolkit::TableView "
+#define TV_LOG(fmt, args...) Debug::LogMessage(Debug::DebugInfo, TABLEVIEW_TAG fmt, ## args)
 
 void PrintArray( Array2d<Dali::Toolkit::Internal::TableView::CellData>& array )
 {
@@ -1158,13 +1160,14 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
   if( Property::MAP == value.GetType() )
   {
     Property::Map map = value.Get<Property::Map>();
-    unsigned int rowIndex;
-    for( Property::Map::const_iterator iter = map.begin(); iter != map.end(); iter++)
+    unsigned int rowIndex(0);
+    for ( unsigned int i = 0, count = map.Count(); i < count; ++i )
     {
-      if( istringstream(iter->first) >> rowIndex  // the key is a number
-          && Property::MAP == (iter->second).GetType())
+      Property::Value& item = map.GetValue(i);
+
+      if( istringstream(map.GetKey(i)) >> rowIndex  // the key is a number
+          && Property::MAP == item.GetType())
       {
-        Property::Value item = iter->second;
         if( item.HasKey( "policy" ) && item.HasKey( "value" ) )
         {
           Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<string>(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
@@ -1210,19 +1213,19 @@ void TableView::GetMapPropertyValue( const std::vector<float>& fixedSize, const
     {
       Property::StringValuePair valuePair( "value", fixedSize[index] );
       Property::Map item;
-      item.push_back( fixedPolicyPair );
-      item.push_back( valuePair );
+      item[ fixedPolicyPair.first ] = fixedPolicyPair.second;
+      item[ valuePair.first ] = valuePair.second;
 
-      map.push_back(  Property::StringValuePair( static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str(), item ) );
+      map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
     }
     else if( ! EqualsZero( relativeSize[index] ) )
     {
       Property::StringValuePair valuePair( "value", relativeSize[index] );
       Property::Map item;
-      item.push_back( relativePolicyPair );
-      item.push_back( valuePair );
+      item[ relativePolicyPair.first ] = relativePolicyPair.second;
+      item[ valuePair.first ] = valuePair.second;
 
-      map.push_back(  Property::StringValuePair( static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str(), item ) );
+      map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
     }
   }
 }