mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
removed extra paragraph break after footnotes
This commit is contained in:
parent
d552496d2e
commit
a3246a3b98
5 changed files with 30 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.geometerplus.zlibrary.ui.android" android:versionCode="106051" android:versionName="1.6.5" android:installLocation="auto">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.geometerplus.zlibrary.ui.android" android:versionCode="106061" android:versionName="1.6.6" android:installLocation="auto">
|
||||
<uses-sdk android:minSdkVersion="5" android:maxSdkVersion="10"/>
|
||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
===== 1.6.6 (Nov ??, 2012) =====
|
||||
* Fixed 'extra paragraph break after each footnote mark' issue for RTFs (and may be some other formats)
|
||||
|
||||
===== 1.6.5 (Nov 04, 2012) =====
|
||||
* Fixed footnotes processing in rtf's
|
||||
* Updated Czech localization (by Marek Pavelka)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.6.5
|
||||
1.6.6
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
BookReader::BookReader(BookModel &model) : myModel(model) {
|
||||
myCurrentTextModel = 0;
|
||||
|
||||
myTextParagraphExists = false;
|
||||
|
||||
myInsideTitle = false;
|
||||
mySectionContainsRegularContents = false;
|
||||
}
|
||||
|
@ -61,6 +59,18 @@ void BookReader::setFootnoteTextModel(const std::string &id) {
|
|||
}
|
||||
}
|
||||
|
||||
bool BookReader::paragraphIsOpen() const {
|
||||
if (myCurrentTextModel.isNull()) {
|
||||
return false;
|
||||
}
|
||||
for (std::list<shared_ptr<ZLTextModel> >::const_iterator it = myModelsWithOpenParagraphs.begin(); it != myModelsWithOpenParagraphs.end(); ++it) {
|
||||
if (*it == myCurrentTextModel) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void BookReader::unsetTextModel() {
|
||||
myCurrentTextModel = 0;
|
||||
}
|
||||
|
@ -91,19 +101,19 @@ void BookReader::beginParagraph(ZLTextParagraph::Kind kind) {
|
|||
if (!myHyperlinkReference.empty()) {
|
||||
myCurrentTextModel->addHyperlinkControl(myHyperlinkKind, myHyperlinkType, myHyperlinkReference);
|
||||
}
|
||||
myTextParagraphExists = true;
|
||||
myModelsWithOpenParagraphs.push_back(myCurrentTextModel);
|
||||
}
|
||||
}
|
||||
|
||||
void BookReader::endParagraph() {
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
flushTextBufferToParagraph();
|
||||
myTextParagraphExists = false;
|
||||
myModelsWithOpenParagraphs.remove(myCurrentTextModel);
|
||||
}
|
||||
}
|
||||
|
||||
void BookReader::addControl(FBTextKind kind, bool start) {
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
flushTextBufferToParagraph();
|
||||
myCurrentTextModel->addControl(kind, start);
|
||||
}
|
||||
|
@ -113,21 +123,21 @@ void BookReader::addControl(FBTextKind kind, bool start) {
|
|||
}
|
||||
|
||||
void BookReader::addStyleEntry(const ZLTextStyleEntry &entry) {
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
flushTextBufferToParagraph();
|
||||
myCurrentTextModel->addStyleEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
void BookReader::addStyleCloseEntry() {
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
flushTextBufferToParagraph();
|
||||
myCurrentTextModel->addStyleCloseEntry();
|
||||
}
|
||||
}
|
||||
|
||||
void BookReader::addFixedHSpace(unsigned char length) {
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
myCurrentTextModel->addFixedHSpace(length);
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +167,7 @@ void BookReader::addHyperlinkControl(FBTextKind kind, const std::string &label)
|
|||
"hyperlink",
|
||||
" + control (" + type + "): " + label
|
||||
);
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
flushTextBufferToParagraph();
|
||||
myCurrentTextModel->addHyperlinkControl(kind, myHyperlinkType, label);
|
||||
}
|
||||
|
@ -167,7 +177,7 @@ void BookReader::addHyperlinkControl(FBTextKind kind, const std::string &label)
|
|||
void BookReader::addHyperlinkLabel(const std::string &label) {
|
||||
if (!myCurrentTextModel.isNull()) {
|
||||
int paragraphNumber = myCurrentTextModel->paragraphsNumber();
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
--paragraphNumber;
|
||||
}
|
||||
addHyperlinkLabel(label, paragraphNumber);
|
||||
|
@ -185,7 +195,7 @@ void BookReader::addHyperlinkLabel(const std::string &label, int paragraphNumber
|
|||
}
|
||||
|
||||
void BookReader::addData(const std::string &data) {
|
||||
if (!data.empty() && myTextParagraphExists) {
|
||||
if (!data.empty() && paragraphIsOpen()) {
|
||||
if (!myInsideTitle) {
|
||||
mySectionContainsRegularContents = true;
|
||||
}
|
||||
|
@ -240,7 +250,7 @@ void BookReader::insertEndOfTextParagraph() {
|
|||
void BookReader::addImageReference(const std::string &id, short vOffset, bool isCover) {
|
||||
if (myCurrentTextModel != 0) {
|
||||
mySectionContainsRegularContents = true;
|
||||
if (myTextParagraphExists) {
|
||||
if (paragraphIsOpen()) {
|
||||
flushTextBufferToParagraph();
|
||||
myCurrentTextModel->addImage(id, vOffset, isCover);
|
||||
} else {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define __BOOKREADER_H__
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
|
||||
|
@ -89,10 +90,10 @@ private:
|
|||
private:
|
||||
BookModel &myModel;
|
||||
shared_ptr<ZLTextModel> myCurrentTextModel;
|
||||
std::list<shared_ptr<ZLTextModel> > myModelsWithOpenParagraphs;
|
||||
|
||||
std::vector<FBTextKind> myKindStack;
|
||||
|
||||
bool myTextParagraphExists;
|
||||
bool myContentsParagraphExists;
|
||||
std::stack<shared_ptr<ContentsTree> > myContentsTreeStack;
|
||||
|
||||
|
@ -108,10 +109,6 @@ private:
|
|||
shared_ptr<ZLCachedMemoryAllocator> myFootnotesAllocator;
|
||||
};
|
||||
|
||||
inline bool BookReader::paragraphIsOpen() const {
|
||||
return myTextParagraphExists;
|
||||
}
|
||||
|
||||
inline bool BookReader::contentsParagraphIsOpen() const {
|
||||
return myContentsParagraphExists;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue