From fc3171abad615e767102cc320c5cb12064ffd806 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Fri, 3 Jul 2015 13:59:09 +0300 Subject: [PATCH] Ignore "!important" modifier for the "margin" property --- .../fbreader/fbreader/src/formats/css/StyleSheetTable.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fbreader/fbreader/fbreader/src/formats/css/StyleSheetTable.cpp b/fbreader/fbreader/fbreader/src/formats/css/StyleSheetTable.cpp index 17f5fa2..0340f67 100644 --- a/fbreader/fbreader/fbreader/src/formats/css/StyleSheetTable.cpp +++ b/fbreader/fbreader/fbreader/src/formats/css/StyleSheetTable.cpp @@ -213,7 +213,11 @@ shared_ptr StyleSheetTable::createControl(const AttributeMap & } } - const std::vector &margins = values(styles, "margin"); + std::vector margins(values(styles, "margin")); + if (!margins.empty() && margins.back() == "!important") { + // Ignore the "!important" modifier for now + margins.pop_back(); + } switch (margins.size()) { case 1: setLength(*entry, ZLTextStyleEntry::LENGTH_SPACE_BEFORE, margins[0]);