1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

fixed '0' value processing for lengths in CSS

This commit is contained in:
Nikolay Pultsin 2014-09-18 05:38:52 +01:00
parent e8f554c4ca
commit fed9619767

View file

@ -50,7 +50,11 @@ void StyleSheetTable::addMap(const std::string &tag, const std::string &aClass,
} }
static bool parseLength(const std::string &toParse, short &size, ZLTextStyleEntry::SizeUnit &unit) { static bool parseLength(const std::string &toParse, short &size, ZLTextStyleEntry::SizeUnit &unit) {
if (ZLStringUtil::stringEndsWith(toParse, "%")) { if (toParse == "0") {
unit = ZLTextStyleEntry::SIZE_UNIT_PIXEL;
size = 0;
return true;
} else if (ZLStringUtil::stringEndsWith(toParse, "%")) {
unit = ZLTextStyleEntry::SIZE_UNIT_PERCENT; unit = ZLTextStyleEntry::SIZE_UNIT_PERCENT;
size = std::atoi(toParse.c_str()); size = std::atoi(toParse.c_str());
return true; return true;