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

CSS support (in progress)

This commit is contained in:
Nikolay Pultsin 2012-05-09 03:48:14 +01:00
parent cbf156e8d5
commit c281770998
10 changed files with 100 additions and 74 deletions

View file

@ -508,12 +508,14 @@ bool XHTMLReader::readFile(const ZLFile &file, const std::string &referenceName)
return readDocument(file);
}
void XHTMLReader::addStyleEntry(const std::string tag, const std::string aClass) {
bool XHTMLReader::addStyleEntry(const std::string tag, const std::string aClass) {
shared_ptr<ZLTextStyleEntry> entry = myStyleSheetTable.control(tag, aClass);
if (!entry.isNull()) {
myModelReader.addStyleEntry(*entry);
myStyleEntryStack.push_back(entry);
return true;
}
return false;
}
void XHTMLReader::startElementHandler(const char *tag, const char **attributes) {
@ -548,6 +550,7 @@ void XHTMLReader::startElementHandler(const char *tag, const char **attributes)
shared_ptr<ZLTextStyleEntry> entry = myStyleParser.parseString(style);
myModelReader.addStyleEntry(*entry);
myStyleEntryStack.push_back(entry);
} else {
}
myCSSStack.push_back(myStyleEntryStack.size() - sizeBefore);
}