Merge "Fix GetHeightForWidth for text controller" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / strikethrough-style-properties.h
index a92f4c2..1a68bbe 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/math/vector4.h>
 
 namespace Dali
@@ -63,7 +64,7 @@ struct StrikethroughStyleProperties
   {
     //The property is similar when both are not defined or when both are defined and have the same value.
     return ((!colorDefined && !other.colorDefined) || ((colorDefined && other.colorDefined) && (color == other.color))) &&
-           ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height)));
+           ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (Dali::Equals(height, other.height))));
   }
 
   bool operator!=(const StrikethroughStyleProperties& other) const
@@ -73,7 +74,47 @@ struct StrikethroughStyleProperties
 
   bool IsHeightEqualTo(const StrikethroughStyleProperties& other) const
   {
-    return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height)));
+    return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (Dali::Equals(height, other.height))));
+  }
+
+  StrikethroughStyleProperties& CopyIfNotDefined(const StrikethroughStyleProperties& other)
+  {
+    //Copy only the defined properties in other and not defined in this from other to this
+
+    if(!heightDefined && other.heightDefined)
+    {
+      height        = other.height;
+      heightDefined = true;
+    }
+
+    if(!colorDefined && other.colorDefined)
+    {
+      color        = other.color;
+      colorDefined = true;
+    }
+
+    // to chain this method
+    return *this;
+  }
+
+  StrikethroughStyleProperties& OverrideByDefinedProperties(const StrikethroughStyleProperties& other)
+  {
+    //Copy only the defined properties in other from other to this
+
+    if(other.heightDefined)
+    {
+      height        = other.height;
+      heightDefined = true;
+    }
+
+    if(other.colorDefined)
+    {
+      color        = other.color;
+      colorDefined = true;
+    }
+
+    // to chain this method
+    return *this;
   }
 
   //Attributes