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,22 +447,11 @@ bool HtmlBookReader::tagHandler(const HtmlTag &tag) {
|
||||||
tagData->addEntry(myStyleSheetTable.control(tag.Name, *cls));
|
tagData->addEntry(myStyleSheetTable.control(tag.Name, *cls));
|
||||||
}
|
}
|
||||||
myTagDataStack.push_back(tagData);
|
myTagDataStack.push_back(tagData);
|
||||||
|
} else if (!myTagDataStack.empty()) {
|
||||||
for (std::vector<shared_ptr<TagData> >::const_iterator it = myTagDataStack.begin(); it != myTagDataStack.end(); ++it) {
|
for (int i = myTagDataStack.back()->StyleEntries.size(); i > 0; --i) {
|
||||||
const std::vector<shared_ptr<ZLTextStyleEntry> > &entries = (*it)->StyleEntries;
|
myBookReader.addStyleCloseEntry();
|
||||||
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()) {
|
|
||||||
for (int i = myTagDataStack.back()->StyleEntries.size(); i > 0; --i) {
|
|
||||||
myBookReader.addStyleCloseEntry();
|
|
||||||
}
|
|
||||||
myTagDataStack.pop_back();
|
|
||||||
}
|
}
|
||||||
|
myTagDataStack.pop_back();
|
||||||
}
|
}
|
||||||
const std::string *id = tag.find("id");
|
const std::string *id = tag.find("id");
|
||||||
if (id != 0) {
|
if (id != 0) {
|
||||||
|
@ -475,6 +464,17 @@ bool HtmlBookReader::tagHandler(const HtmlTag &tag) {
|
||||||
}
|
}
|
||||||
action->run(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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue