diff options
Diffstat (limited to 'libs/litehtml/src/el_before_after.cpp')
| -rw-r--r-- | libs/litehtml/src/el_before_after.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/libs/litehtml/src/el_before_after.cpp b/libs/litehtml/src/el_before_after.cpp index 3bb806ba60..39fa646cea 100644 --- a/libs/litehtml/src/el_before_after.cpp +++ b/libs/litehtml/src/el_before_after.cpp @@ -18,53 +18,54 @@ void litehtml::el_before_after_base::add_style(const style& style) m_children.clear(); const auto& content_property = style.get_property(_content_); - if(content_property.m_type == prop_type_string && !content_property.m_string.empty()) + if(content_property.is<string>() && !content_property.get<string>().empty()) { - int idx = value_index(content_property.m_string, content_property_string); + const string& str = content_property.get<string>(); + int idx = value_index(str, content_property_string); if(idx < 0) { string fnc; string::size_type i = 0; - while(i < content_property.m_string.length() && i != string::npos) + while(i < str.length() && i != string::npos) { - if(content_property.m_string.at(i) == '"' || content_property.m_string.at(i) == '\'') + if(str.at(i) == '"' || str.at(i) == '\'') { - auto chr = content_property.m_string.at(i); + auto chr = str.at(i); fnc.clear(); i++; - string::size_type pos = content_property.m_string.find(chr, i); + string::size_type pos = str.find(chr, i); string txt; if(pos == string::npos) { - txt = content_property.m_string.substr(i); + txt = str.substr(i); i = string::npos; } else { - txt = content_property.m_string.substr(i, pos - i); + txt = str.substr(i, pos - i); i = pos + 1; } add_text(txt); - } else if(content_property.m_string.at(i) == '(') + } else if(str.at(i) == '(') { i++; litehtml::trim(fnc); litehtml::lcase(fnc); - string::size_type pos = content_property.m_string.find(')', i); + string::size_type pos = str.find(')', i); string params; if(pos == string::npos) { - params = content_property.m_string.substr(i); + params = str.substr(i); i = string::npos; } else { - params = content_property.m_string.substr(i, pos - i); + params = str.substr(i, pos - i); i = pos + 1; } add_function(fnc, params); fnc.clear(); } else { - fnc += content_property.m_string.at(i); + fnc += str.at(i); i++; } } |
