示例#1
0
void StyleSet::DebugCheckSanity() const {
	for (int i = CatFIRST; i < CatEND; i++) {
		StyleCategories cat = (StyleCategories) i;
		StyleAttrib     val = Get(cat);
		XO_DEBUG_ASSERT(val.IsNull() || val.Category == cat);
	}
}
示例#2
0
bool DomNode::StyleParsef(const char* t, ...) {
	char    buff[8192];
	va_list va;
	va_start(va, t);
	uint32_t r = vsnprintf(buff, arraysize(buff), t, va);
	va_end(va);
	buff[arraysize(buff) - 1] = 0;
	if (r < arraysize(buff)) {
		return StyleParse(buff);
	} else {
		String str = String(t);
		str.Z[50]  = 0;
		ParseFail("Parse string is too long for StyleParsef: %s...", str.Z);
		XO_DEBUG_ASSERT(false);
		return false;
	}
}