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:
parent
e8f554c4ca
commit
fed9619767
1 changed files with 5 additions and 1 deletions
|
@ -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) {
|
||||
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;
|
||||
size = std::atoi(toParse.c_str());
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue