Resolve incorrect position for Ellipsis when mixed LTR & RTL languages and set layout...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / markup-processor-color.cpp
index 2fd826d..4fb95ef 100644 (file)
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/color-run.h>
 #include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Text
 {
-
-namespace
+void ProcessColor(const Attribute& attribute, ColorRun& colorRun)
 {
-const std::string XHTML_VALUE_ATTRIBUTE("value");
+  ColorStringToVector4(attribute.valueBuffer, attribute.valueLength, colorRun.color);
 }
 
-void ProcessColorTag( const Tag& tag, ColorRun& colorRun )
+void ProcessColorTag(const Tag& tag, ColorRun& colorRun)
 {
-  for( Vector<Attribute>::ConstIterator it = tag.attributes.Begin(),
-         endIt = tag.attributes.End();
-       it != endIt;
-       ++it )
+  for(Vector<Attribute>::ConstIterator it    = tag.attributes.Begin(),
+                                       endIt = tag.attributes.End();
+      it != endIt;
+      ++it)
   {
-    const Attribute& attribute( *it );
-    if( TokenComparison( XHTML_VALUE_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength ) )
+    const Attribute& attribute(*it);
+    if(TokenComparison(MARKUP::COLOR_ATTRIBUTES::VALUE, attribute.nameBuffer, attribute.nameLength))
     {
-      ColorStringToVector4( attribute.valueBuffer, attribute.valueLength, colorRun.color );
+      ProcessColor(attribute, colorRun);
     }
   }
 }