Пример #1
0
void BookTextView::gotoParagraph(int num, bool last) {
	if (!empty()) {
		if (!myLockUndoStackChanges) {
			if (myPositionStack.size() > myCurrentPointInStack) {
				myPositionStack.erase(myPositionStack.begin() + myCurrentPointInStack, myPositionStack.end());
			}
			pushCurrentPositionIntoStack(false);
			myCurrentPointInStack = myPositionStack.size();
		}

		FBView::gotoParagraph(num, last);
	}
}
Пример #2
0
void BookTextView::gotoParagraph(int num, bool end) {
	if (textArea().isEmpty()) {
		return;
	}

	if (!myLockUndoStackChanges) {
		if (myPositionStack.size() > myCurrentPointInStack) {
			myPositionStack.erase(myPositionStack.begin() + myCurrentPointInStack, myPositionStack.end());
			myStackChanged = true;
		}
		pushCurrentPositionIntoStack(false);
		myCurrentPointInStack = myPositionStack.size();
	}

	FBView::gotoParagraph(num, end);
}
Пример #3
0
void BookTextView::undoPageMove() {
	if (canUndoPageMove()) {
		if (myCurrentPointInStack == myPositionStack.size()) {
			if (!pushCurrentPositionIntoStack(false)) {
				-- myCurrentPointInStack;
			}
		} else {
			replaceCurrentPositionInStack();
		}

		--myCurrentPointInStack;
		Position &pos = myPositionStack[myCurrentPointInStack];
		myLockUndoStackChanges = true;
		gotoPosition(pos.Paragraph, pos.Word, pos.Character);
		myLockUndoStackChanges = false;

		FBReader::Instance().refreshWindow();
	}
}
Пример #4
0
void BookTextView::undoPageMove() {
	if (canUndoPageMove()) {
		if (myCurrentPointInStack == myPositionStack.size()) {
			if (!pushCurrentPositionIntoStack(false)) {
				-- myCurrentPointInStack;
			}
		} else {
			replaceCurrentPositionInStack();
		}

		--myCurrentPointInStack;
		Position &pos = myPositionStack[myCurrentPointInStack];
		myLockUndoStackChanges = true;
		gotoPosition(pos.first, pos.second, 0);
		myLockUndoStackChanges = false;

		application().refreshWindow();
	}
}