mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
fixed CSS applying
This commit is contained in:
parent
7e5b019201
commit
82cdca266c
1 changed files with 15 additions and 15 deletions
|
@ -447,23 +447,12 @@ bool HtmlBookReader::tagHandler(const HtmlTag &tag) {
|
|||
tagData->addEntry(myStyleSheetTable.control(tag.Name, *cls));
|
||||
}
|
||||
myTagDataStack.push_back(tagData);
|
||||
|
||||
for (std::vector<shared_ptr<TagData> >::const_iterator it = myTagDataStack.begin(); it != myTagDataStack.end(); ++it) {
|
||||
const std::vector<shared_ptr<ZLTextStyleEntry> > &entries = (*it)->StyleEntries;
|
||||
const bool inheritedOnly = it + 1 != myTagDataStack.end();
|
||||
for (std::vector<shared_ptr<ZLTextStyleEntry> >::const_iterator jt = entries.begin(); jt != entries.end(); ++jt) {
|
||||
shared_ptr<ZLTextStyleEntry> entry = inheritedOnly ? (*jt)->inherited() : *jt;
|
||||
myBookReader.addStyleEntry(*entry);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!myTagDataStack.empty()) {
|
||||
} else if (!myTagDataStack.empty()) {
|
||||
for (int i = myTagDataStack.back()->StyleEntries.size(); i > 0; --i) {
|
||||
myBookReader.addStyleCloseEntry();
|
||||
}
|
||||
myTagDataStack.pop_back();
|
||||
}
|
||||
}
|
||||
const std::string *id = tag.find("id");
|
||||
if (id != 0) {
|
||||
myBookReader.addHyperlinkLabel(*id);
|
||||
|
@ -475,6 +464,17 @@ bool HtmlBookReader::tagHandler(const HtmlTag &tag) {
|
|||
}
|
||||
action->run(tag);
|
||||
|
||||
if (tag.Start) {
|
||||
for (std::vector<shared_ptr<TagData> >::const_iterator it = myTagDataStack.begin(); it != myTagDataStack.end(); ++it) {
|
||||
const std::vector<shared_ptr<ZLTextStyleEntry> > &entries = (*it)->StyleEntries;
|
||||
const bool inheritedOnly = it + 1 != myTagDataStack.end();
|
||||
for (std::vector<shared_ptr<ZLTextStyleEntry> >::const_iterator jt = entries.begin(); jt != entries.end(); ++jt) {
|
||||
shared_ptr<ZLTextStyleEntry> entry = inheritedOnly ? (*jt)->inherited() : *jt;
|
||||
myBookReader.addStyleEntry(*entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue