X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Funderline-style-properties.h;h=d75f22b7b0d2fdbe1253d3f3f6da71b558ffe030;hp=5d89f4b4be1c85a8c253c08e8e30252d43fc684b;hb=cee2831414bee408f07923a17cad74671c14d180;hpb=ee33f54bcefdc59971ffa428e6f8e4bdd31b94ed diff --git a/dali-toolkit/internal/text/underline-style-properties.h b/dali-toolkit/internal/text/underline-style-properties.h index 5d89f4b..d75f22b 100644 --- a/dali-toolkit/internal/text/underline-style-properties.h +++ b/dali-toolkit/internal/text/underline-style-properties.h @@ -100,6 +100,80 @@ struct UnderlineStyleProperties return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height))); } + UnderlineStyleProperties& CopyIfNotDefined(const UnderlineStyleProperties& other) + { + //Copy only the defined properties in other and not defined in this from other to this + if(!typeDefined && other.typeDefined) + { + type = other.type; + typeDefined = true; + } + + if(!heightDefined && other.heightDefined) + { + height = other.height; + heightDefined = true; + } + + if(!colorDefined && other.colorDefined) + { + color = other.color; + colorDefined = true; + } + + if(!dashGapDefined && other.dashGapDefined) + { + dashGap = other.dashGap; + dashGapDefined = true; + } + + if(!dashWidthDefined && other.dashWidthDefined) + { + dashWidth = other.dashWidth; + dashWidthDefined = true; + } + + // to chain this method + return *this; + } + + UnderlineStyleProperties& OverrideByDefinedProperties(const UnderlineStyleProperties& other) + { + //Copy only the defined properties in other from other to this + if(other.typeDefined) + { + type = other.type; + typeDefined = true; + } + + if(other.heightDefined) + { + height = other.height; + heightDefined = true; + } + + if(other.colorDefined) + { + color = other.color; + colorDefined = true; + } + + if(other.dashGapDefined) + { + dashGap = other.dashGap; + dashGapDefined = true; + } + + if(other.dashWidthDefined) + { + dashWidth = other.dashWidth; + dashWidthDefined = true; + } + + // to chain this method + return *this; + } + //Attributes Text::Underline::Type type; ///< The type of underline. Vector4 color; ///< The color of underline.