X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-impl.cpp;h=5a18bef4a46705dfdcc1c3b38f29f720488efd95;hb=baef46c4babda42017ab2d5fbd362ae9e11be95b;hp=4a23ed1fe74dd10f867fa80b0537252da0472867;hpb=d26f555fd84d43b0a3e650c66a0e626e841dd9c6;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index 4a23ed1..5a18bef 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -202,7 +202,12 @@ void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::U } } - if( !mParser.Parse( data ) ) + if( mParser.Parse( data ) ) + { + // Drop the styles and get them to be rebuilt against the new parse tree as required. + mStyles.Clear(); + } + else { DALI_LOG_WARNING( "JSON Parse Error:%d:%d:'%s'\n", mParser.GetErrorLineNumber(), @@ -213,8 +218,8 @@ void Builder::LoadFromString( std::string const& data, Dali::Toolkit::Builder::U } } - DUMP_PARSE_TREE(parser); // This macro only writes out if DEBUG is enabled and the "DUMP_TREE" constant is defined in the stylesheet. - DUMP_TEST_MAPPINGS(parser); + DUMP_PARSE_TREE(mParser); // This macro only writes out if DEBUG is enabled and the "DUMP_TREE" constant is defined in the stylesheet. + DUMP_TEST_MAPPINGS(mParser); DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Cannot parse JSON"); }