X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-font-style.cpp;h=b31decb16b764843cd8924227c6143fd18775518;hb=c156fa43a739e26d4d1ad187848968248078839f;hp=681ffc77e74a6ea0ea2c8696032f6a26798e3691;hpb=c8f181e1ca529f7d92ba638ccedadd7dd51be7eb;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-font-style.cpp b/dali-toolkit/internal/text/text-font-style.cpp index 681ffc7..b31decb 100644 --- a/dali-toolkit/internal/text/text-font-style.cpp +++ b/dali-toolkit/internal/text/text-font-style.cpp @@ -22,8 +22,7 @@ #include // INTERNAL INCLUDES -#include -#include +#include namespace Dali { @@ -40,7 +39,6 @@ const std::string STYLE_KEY( "style" ); const std::string WEIGHT_KEY( "weight" ); const std::string WIDTH_KEY( "width" ); const std::string SLANT_KEY( "slant" ); -const std::string EMPTY_STRING( "" ); #if defined(DEBUG_ENABLED) Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS"); @@ -48,62 +46,6 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_C } // namespace -/** - * @brief Creates a map with pairs 'key,value' with the font's style parameters. - * - * @param[in] node Data structure with the font's style parameters. - * @param[out] map A map with the font's style parameters. - * - */ -void CreateFontStyleMap( const TreeNode* const node, Property::Map& map ) -{ - switch( node->GetType() ) - { - case TreeNode::IS_NULL: - case TreeNode::OBJECT: - case TreeNode::ARRAY: // FALL THROUGH - { - break; - } - case TreeNode::STRING: - { - map.Insert( node->GetName(), Property::Value( node->GetString() ) ); - break; - } - case TreeNode::INTEGER: - case TreeNode::FLOAT: - case TreeNode::BOOLEAN: // FALL THROUGH - { - break; - } - } - - for( TreeNode::ConstIterator it = node->CBegin(), endIt = node->CEnd(); it != endIt; ++it ) - { - const TreeNode::KeyNodePair& pair = *it; - CreateFontStyleMap( &pair.second, map ); - } -} - -/** - * @brief Parses the font's style string. - * - * @param[in] style The font's style string. - * @param[out] map A map with the font's style parameters. - * - */ -void ParseFontStyleString( const std::string& style, Property::Map& map ) -{ - Toolkit::JsonParser parser = Toolkit::JsonParser::New(); - - if( parser.Parse( style ) ) - { - const TreeNode* const node = parser.GetRoot(); - - CreateFontStyleMap( node, map ); - } -} - void SetFontStyleProperty( ControllerPtr controller, const Property::Value& value, FontStyle::Type type ) { if( controller ) @@ -129,7 +71,7 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu // Parses and applies the style. Property::Map map; - ParseFontStyleString( style, map ); + ParsePropertyString( style, map ); if( !map.Empty() ) {