]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
don't rm emergency saves ever
[lyx.git] / src / BufferView.C
index fa401e75d7ae2f0138d15b948f643b92552dad2b..5e8763cfc0feb34f1df3749de5ffb0a341946d41 100644 (file)
@@ -223,18 +223,6 @@ int BufferView::workWidth() const
 }
 
 
-void BufferView::showCursor()
-{
-       pimpl_->showCursor();
-}
-
-
-void BufferView::hideCursor()
-{
-       pimpl_->hideCursor();
-}
-
-
 void BufferView::toggleSelection(bool b)
 {
        pimpl_->toggleSelection(b);
@@ -585,7 +573,6 @@ void BufferView::undo()
                return;
 
        owner()->message(_("Undo"));
-       hideCursor();
        beforeChange(text);
        update(text, BufferView::SELECT);
        if (!textUndo(this))
@@ -602,7 +589,6 @@ void BufferView::redo()
                return;
 
        owner()->message(_("Redo"));
-       hideCursor();
        beforeChange(text);
        update(text, BufferView::SELECT);
        if (!textRedo(this))
@@ -631,7 +617,6 @@ void BufferView::selectLastWord()
                return;
 
        LyXCursor cur = text->selection.cursor;
-       hideCursor();
        beforeChange(text);
        text->selection.cursor = cur;
        text->selectSelectedWord();
@@ -644,7 +629,6 @@ void BufferView::endOfSpellCheck()
 {
        if (!available()) return;
 
-       hideCursor();
        beforeChange(text);
        text->selectSelectedWord();
        text->clearSelection();
@@ -658,7 +642,6 @@ void BufferView::replaceWord(string const & replacestring)
                return;
 
        LyXText * tt = getLyXText();
-       hideCursor();
        update(tt, BufferView::SELECT);
 
        // clear the selection (if there is any)
@@ -712,12 +695,12 @@ bool BufferView::lockInset(UpdatableInset * inset)
                        InsetList::iterator end = pit->insetlist.end();
                        for (; it != end; ++it) {
                                if (it.getInset() == inset) {
-                                       text->setCursorIntern(&*pit, it.getPos());
+                                       text->setCursorIntern(pit, it.getPos());
                                        theLockingInset(inset);
                                        return true;
                                }
                                if (it.getInset()->getInsetFromID(id)) {
-                                       text->setCursorIntern(&*pit, it.getPos());
+                                       text->setCursorIntern(pit, it.getPos());
                                        it.getInset()->edit(this);
                                        return theLockingInset()->lockInsetInInset(this, inset);
                                }
@@ -729,44 +712,6 @@ bool BufferView::lockInset(UpdatableInset * inset)
 }
 
 
-void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
-{
-       if (available() && theLockingInset() && !theLockingInset()->nodraw()) {
-               LyXCursor cursor = text->cursor;
-               Inset * locking_inset = theLockingInset()->getLockingInset();
-
-               if ((cursor.pos() - 1 >= 0) &&
-                   cursor.par()->isInset(cursor.pos() - 1) &&
-                   (cursor.par()->getInset(cursor.pos() - 1) ==
-                    locking_inset))
-                       text->setCursor(cursor,
-                                       cursor.par(), cursor.pos() - 1);
-               LyXScreen::Cursor_Shape shape = LyXScreen::BAR_SHAPE;
-               LyXText * txt = getLyXText();
-               if (locking_inset->isTextInset() &&
-                   locking_inset->lyxCode() != Inset::ERT_CODE &&
-                   (txt->real_current_font.language() !=
-                    buffer()->params.language
-                    || txt->real_current_font.isVisibleRightToLeft()
-                    != buffer()->params.language->RightToLeft()))
-                       shape = (txt->real_current_font.isVisibleRightToLeft())
-                               ? LyXScreen::REVERSED_L_SHAPE
-                               : LyXScreen::L_SHAPE;
-               y += cursor.iy() + theLockingInset()->insetInInsetY();
-               screen().showManualCursor(text, x, y, asc, desc,
-                                                 shape);
-       }
-}
-
-
-void BufferView::hideLockedInsetCursor()
-{
-       if (theLockingInset() && available()) {
-               screen().hideCursor();
-       }
-}
-
-
 bool BufferView::fitLockedInsetCursor(int x, int y, int asc, int desc)
 {
        if (theLockingInset() && available()) {
@@ -780,6 +725,12 @@ bool BufferView::fitLockedInsetCursor(int x, int y, int asc, int desc)
 }
 
 
+void BufferView::hideCursor()
+{
+       screen().hideCursor();
+}
+
+
 int BufferView::unlockInset(UpdatableInset * inset)
 {
        if (!inset)
@@ -812,8 +763,8 @@ void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
        if (kind == Undo::EDIT) // in this case insets would not be stored!
                kind = Undo::FINISH;
        setUndo(this, kind,
-               &*text->cursor.par(),
-               text->cursor.par()->next());
+               text->cursor.par(),
+               boost::next(text->cursor.par()));
 }
 
 
@@ -857,7 +808,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
                        if (it.size() == 1) {
                                text->setCursorIntern(par, 0);
                                text->redoParagraphs(text->cursor,
-                                                    text->cursor.par()->next());
+                                                    boost::next(text->cursor.par()));
                                text->fullRebreak();
                        }
                }