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

XHTMLReader reused

This commit is contained in:
Nikolay Pultsin 2012-05-11 19:45:05 +01:00
parent e3f3be547b
commit 24d649c9d1
6 changed files with 18 additions and 3 deletions

View file

@ -500,11 +500,17 @@ bool XHTMLReader::readFile(const ZLFile &file, const std::string &referenceName)
myPreformatted = false;
myNewParagraphInProgress = false;
myReadState = READ_NOTHING;
myCurrentParagraphIsEmpty = true;
myStyleSheetTable.clear();
myCSSStack.clear();
myStyleEntryStack.clear();
myStylesToRemove = 0;
myDoPageBreakAfterStack.clear();
myStyleParser = new StyleSheetSingleStyleParser();
myTableParser.reset();
return readDocument(file);
}
@ -547,7 +553,7 @@ void XHTMLReader::startElementHandler(const char *tag, const char **attributes)
const char *style = attributeValue(attributes, "style");
if (style != 0) {
ZLLogger::Instance().println("CSS", std::string("parsing style attribute: ") + style);
shared_ptr<ZLTextStyleEntry> entry = myStyleParser.parseString(style);
shared_ptr<ZLTextStyleEntry> entry = myStyleParser->parseString(style);
myModelReader.addStyleEntry(*entry);
myStyleEntryStack.push_back(entry);
} else {