Fix prevent issues
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / builder / builder-impl.cpp
index 5d5e4b9..4ea4aee 100644 (file)
@@ -67,6 +67,8 @@ Integration::Log::Filter* gFilterScript  = Integration::Log::Filter::New(Debug::
 namespace
 {
 
+#define TOKEN_STRING(x) #x
+
 const std::string KEYNAME_STYLES    = "styles";
 const std::string KEYNAME_TYPE      = "type";
 const std::string KEYNAME_ACTORS    = "actors";
@@ -122,11 +124,6 @@ std::string PropertyValueToString( const Property::Value& value )
       ret = ToString( value.Get<int>() );
       break;
     }
-    case Property::UNSIGNED_INTEGER:
-    {
-      ret = ToString( value.Get<unsigned int>() );
-      break;
-    }
     case Property::VECTOR2:
     {
       ret = ToString( value.Get<Vector2>() );
@@ -176,11 +173,6 @@ std::string PropertyValueToString( const Property::Value& value )
       ret = std::string("Map Size=") + ToString( value.Get<Property::Map>().Count() );
       break;
     }
-    case Property::TYPE_COUNT:
-    {
-      ret = "";
-      break;
-    }
   }
 
   return ret;
@@ -721,12 +713,17 @@ FrameBufferImage Builder::GetFrameBufferImage( const std::string &name, const Re
     {
       if( OptionalChild image = IsChild( *images, name ) )
       {
-        Dali::Property::Value propertyMap(Property::MAP);
-        if( SetPropertyFromNode( *image, Property::MAP, propertyMap, constant ) )
+        Dali::Property::Value property(Property::MAP);
+        if( SetPropertyFromNode( *image, Property::MAP, property, constant ) )
         {
-          propertyMap.SetValue(KEYNAME_TYPE, Property::Value(std::string("FrameBufferImage")));
-          ret = FrameBufferImage::DownCast( Dali::Scripting::NewImage( propertyMap ) );
-          mFrameBufferImageLut[ name ] = ret;
+          Property::Map* map = property.GetMap();
+
+          if( map )
+          {
+            (*map)[ KEYNAME_TYPE ] = Property::Value(std::string("FrameBufferImage") );
+            ret = FrameBufferImage::DownCast( Dali::Scripting::NewImage( property ) );
+            mFrameBufferImageLut[ name ] = ret;
+          }
         }
       }
     }
@@ -1361,6 +1358,13 @@ Builder::Builder()
 : mSlotDelegate( this )
 {
   mParser = Dali::Toolkit::JsonParser::New();
+
+  Property::Map defaultDirs;
+  defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ]  = DALI_IMAGE_DIR;
+  defaultDirs[ TOKEN_STRING(DALI_SOUND_DIR) ]  = DALI_SOUND_DIR;
+  defaultDirs[ TOKEN_STRING(DALI_STYLE_DIR) ] = DALI_STYLE_DIR;
+
+  AddConstants( defaultDirs );
 }
 
 Builder::~Builder()