Fix text outline property related native TCT
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-effects-style.cpp
index 8b71d30..ea1b3cf 100755 (executable)
@@ -507,13 +507,26 @@ bool SetOutlineProperties( ControllerPtr controller, const Property::Value& valu
 
         bool empty = true;
 
-        if ( !propertiesMap.Empty() )
+        if ( propertiesMap.Empty() )
+        {
+           // Map empty so check if a string provided
+           // This is purely to maintain backward compatibility, but we don't parse the string to be a property map.
+           const std::string propertyString = value.Get<std::string>();
+
+           // Stores the default outline's properties string to be recovered by the GetOutlineProperties() function.
+           controller->SetDefaultOutlineProperties( propertyString );
+
+           controller->OutlineSetByString( true );
+        }
+        else
         {
            empty = ParseOutlineProperties( propertiesMap,
                                            colorDefined,
                                            color,
                                            widthDefined,
                                            width );
+
+           controller->OutlineSetByString( false );
         }
 
         if( !empty )
@@ -563,22 +576,30 @@ void GetOutlineProperties( ControllerPtr controller, Property::Value& value, Eff
     {
       case EffectStyle::DEFAULT:
       {
-        const Vector4& color = controller->GetOutlineColor();
-        const float width = controller->GetOutlineWidth();
+        if ( controller->IsOutlineSetByString() )
+        {
+          value = controller->GetDefaultOutlineProperties();
+          break;
+        }
+        else
+        {
+          const Vector4& color = controller->GetOutlineColor();
+          const float width = controller->GetOutlineWidth();
 
-        Property::Map map;
+          Property::Map map;
 
-        std::string colorStr;
-        Vector4ToColorString( color, colorStr );
-        map.Insert( COLOR_KEY, colorStr );
+          std::string colorStr;
+          Vector4ToColorString( color, colorStr );
+          map.Insert( COLOR_KEY, colorStr );
 
-        std::string widthStr;
-        FloatToString( width, widthStr );
-        map.Insert( WIDTH_KEY, widthStr );
+          std::string widthStr;
+          FloatToString( width, widthStr );
+          map.Insert( WIDTH_KEY, widthStr );
 
-        value = map;
+          value = map;
 
-        break;
+          break;
+        }
       }
       case EffectStyle::INPUT:
       {