-void BufferView::undo()
-{
- if (!available())
- return;
-
- owner()->message(_("Undo"));
- text->clearSelection();
- if (!textUndo(this))
- owner()->message(_("No further undo information"));
- update();
- switchKeyMap();
-}
-
-
-void BufferView::redo()
-{
- if (!available())
- return;
-
- owner()->message(_("Redo"));
- text->clearSelection();
- if (!textRedo(this))
- owner()->message(_("No further redo information"));
- update();
- switchKeyMap();
-}
-
-
-void BufferView::replaceWord(string const & replacestring)
-{
- if (!available())
- return;
-
- LyXText * text = getLyXText();
-
- text->replaceSelectionWithString(replacestring);
- text->setSelectionRange(replacestring.length());
-
- // Go back so that replacement string is also spellchecked
- for (string::size_type i = 0; i < replacestring.length() + 1; ++i)
- text->cursorLeft(this);
-
- // FIXME: should be done through LFUN
- buffer()->markDirty();
- update();
-}
-
-
-bool BufferView::fitLockedInsetCursor(int x, int y, int asc, int desc)
-{
- lyxerr << "BufferView::fitLockedInsetCursor x: " << x
- << " y: " << y << std::endl;
- UpdatableInset * tli =
- static_cast<UpdatableInset *>(cursor().innerInset());
- if (tli && available()) {
- lyxerr << " text->cursor.y: " << text->cursor.y() << std::endl;
- lyxerr << " insetInInsetY: " << tli->insetInInsetY() << std::endl;
- y += text->cursor.y() + tli->insetInInsetY();
- if (screen().fitManualCursor(this, text, x, y, asc, desc)) {
- updateScrollbar();
- return true;
- }
- }
- return false;
-}
-
-