diff --git a/ChangeLog b/ChangeLog index 700d24f08..36a5d6c6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +===== 1.5.1 (May ??, 2012) ===== +* Fixed pt/px measured font size processing for CSS's +* Fixed ToC in some ePubs (e.g. for ePubs from project Gutenberg) + ===== 1.5 (May 13, 2012) ===== * New faster engine got ePub files * Improved cover support for ePubs diff --git a/jni/NativeFormats/fbreader/src/formats/oeb/OEBBookReader.cpp b/jni/NativeFormats/fbreader/src/formats/oeb/OEBBookReader.cpp index 4f1d27615..46de50113 100644 --- a/jni/NativeFormats/fbreader/src/formats/oeb/OEBBookReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/oeb/OEBBookReader.cpp @@ -216,7 +216,7 @@ void OEBBookReader::generateTOC(const XHTMLReader &xhtmlReader) { size_t level = 0; for (std::map::const_iterator it = navigationMap.begin(); it != navigationMap.end(); ++it) { const NCXReader::NavPoint &point = it->second; - int index = myModelReader.model().label(xhtmlReader.fileAlias(point.ContentHRef)).ParagraphNumber; + int index = myModelReader.model().label(xhtmlReader.normalizedReference(point.ContentHRef)).ParagraphNumber; while (level > point.Level) { myModelReader.endContentsParagraph(); --level; diff --git a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp index 1da5d3140..8b526295a 100644 --- a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp @@ -349,12 +349,7 @@ void XHTMLTagHyperlinkAction::doAtStart(XHTMLReader &reader, const char **xmlatt if (link[0] == '#') { link = reader.myReferenceAlias + link; } else { - const size_t index = link.find('#'); - if (index == std::string::npos) { - link = reader.fileAlias(reader.myReferenceDirName + link); - } else { - link = reader.fileAlias(reader.myReferenceDirName + link.substr(0, index)) + link.substr(index); - } + link = reader.normalizedReference(reader.myReferenceDirName + link); } } myHyperlinkStack.push(hyperlinkType); @@ -687,6 +682,15 @@ bool XHTMLReader::processNamespaces() const { return true; } +const std::string XHTMLReader::normalizedReference(const std::string &reference) const { + const size_t index = reference.find('#'); + if (index == std::string::npos) { + return fileAlias(reference); + } else { + return fileAlias(reference.substr(0, index)) + reference.substr(index); + } +} + const std::string &XHTMLReader::fileAlias(const std::string &fileName) const { std::map::const_iterator it = myFileNumbers.find(fileName); if (it != myFileNumbers.end()) { diff --git a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.h b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.h index 3b5d47a90..0a513f358 100644 --- a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.h +++ b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.h @@ -62,6 +62,7 @@ public: XHTMLReader(BookReader &modelReader); bool readFile(const ZLFile &file, const std::string &referenceName); const std::string &fileAlias(const std::string &fileName) const; + const std::string normalizedReference(const std::string &reference) const; private: void startElementHandler(const char *tag, const char **attributes);