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); } }
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); }
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(); } }
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(); } }