2 #include "css_length.h"
4 void litehtml::css_length::fromString( const tstring& str, const tstring& predefs, int defValue )
6 // TODO: Make support for calc
7 if(str.substr(0, 4) == _t("calc"))
9 m_is_predefined = true;
14 int predef = value_index(str.c_str(), predefs.c_str(), -1);
17 m_is_predefined = true;
21 m_is_predefined = false;
26 for(tstring::const_iterator chr = str.begin(); chr != str.end(); chr++)
30 if(t_isdigit(*chr) || *chr == _t('.') || *chr == _t('+') || *chr == _t('-'))
45 m_value = (float) t_strtod(num.c_str(), 0);
46 m_units = (css_units) value_index(un.c_str(), css_units_strings, css_units_none);
49 // not a number so it is predefined
50 m_is_predefined = true;