///
bool gotoLabel(string const & label);
///
- void paste();
- ///
- void cut(bool realcut = true);
- ///
- void copy();
- ///
void pasteEnvironment();
///
void copyEnvironment();
}
-void BufferView::copy()
-{
- if (available()) {
- getLyXText()->copySelection(this);
- owner()->message(_("Copy"));
- }
-}
-
-
-void BufferView::cut(bool realcut)
-{
- if (available()) {
- hideCursor();
- update(text, BufferView::SELECT|BufferView::FITCUR);
- text->cutSelection(this, true, realcut);
- update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
- owner()->message(_("Cut"));
- }
-}
-
-
-void BufferView::paste()
-{
- if (!available())
- return;
-
- owner()->message(_("Paste"));
-
- hideCursor();
- // clear the selection
- toggleSelection();
- text->clearSelection();
- update(text, BufferView::SELECT|BufferView::FITCUR);
-
- // paste
- text->pasteSelection(this);
- // bug 393
- text->clearSelection();
- update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-// why fake a selection only I think it should be a real one and not only
-// a painted one (Jug 20020318).
-#if 0
- // clear the selection
- toggleSelection();
- text->clearSelection();
- update(text, BufferView::SELECT|BufferView::FITCUR);
-#endif
-}
-
-
-/* these functions are for the spellchecker */
+// these functions are for the spellchecker
WordLangTuple const BufferView::nextWord(float & value)
{
if (!available()) {
break;
}
- case LFUN_PASTE:
- bv_->paste();
- switchKeyMap();
- break;
-
- case LFUN_CUT:
- bv_->cut();
- break;
-
- case LFUN_COPY:
- bv_->copy();
- break;
-
case LFUN_LAYOUT_COPY:
bv_->copyEnvironment();
break;
* paragraph.[Ch]: Martin's patch for the \end_deeper bug
+ * BufferView.h:
+ * BufferView2.C:
+ * BufferView_pimpl.C:
+ * text3.C: mun hanfling of LFUN_CUT/COPY/PASTE to LyXText
+
2002-08-25 John Levon <levon@movementarian.org>
* LyXAction.C: fix margin note description
macroModeClose();
if (selection_)
eraseSelection();
-
- array().insert(pos(), ar);
- pos() += ar.size();
-}
-
-/*
-void MathCursor::paste(MathArray const & ar)
-{
- Anchor_ = Cursor_;
- selection_ = true;
array().insert(pos(), ar);
pos() += ar.size();
}
-*/
void MathCursor::paste(MathGridInset const & data)
// just comment out the line below...
bv->showCursor();
} else {
- bv->cut(false);
+ update(bv, false);
+ cutSelection(bv, true);
+ update(bv);
}
bv->moveCursorUpdate(false);
bv->owner()->view_state_changed();
cursorLeft(bv);
Delete(bv);
selection.cursor = cursor;
- update(bv);
}
} else {
Delete(bv);
selection.cursor = cursor;
- update(bv);
}
- } else
- bv->cut(false);
+ } else {
+ update(bv, false);
+ cutSelection(bv, true);
+ }
+ update(bv);
break;
// just comment out the line below...
bv->showCursor();
}
- } else
- bv->cut(false);
+ } else {
+ update(bv, false);
+ cutSelection(bv, true);
+ update(bv);
+ }
bv->owner()->view_state_changed();
bv->switchKeyMap();
break;
cur.par()->params().spacing(),
cur.par()->params().align(),
cur.par()->params().labelWidthString(), 0);
- update(bv);
} else {
backspace(bv);
selection.cursor = cur;
- update(bv);
}
- } else
- bv->cut(false);
+ } else {
+ update(bv, false);
+ cutSelection(bv, true);
+ }
+ update(bv);
break;
case LFUN_BREAKPARAGRAPH:
update(bv);
break;
+ case LFUN_PASTE:
+ cmd.message(_("Paste"));
+ bv->hideCursor();
+ // clear the selection
+ bv->toggleSelection();
+ clearSelection();
+ update(bv, false);
+ pasteSelection(bv);
+ clearSelection(); // bug 393
+ update(bv, false);
+ update(bv);
+ bv->switchKeyMap();
+ break;
+
+ case LFUN_CUT:
+ bv->hideCursor();
+ update(bv, false);
+ cutSelection(bv, true);
+ update(bv);
+ cmd.message(_("Cut"));
+ break;
+
+ case LFUN_COPY:
+ copySelection(bv);
+ cmd.message(_("Copy"));
+ break;
+
case LFUN_BEGINNINGBUFSEL:
if (inset_owner)
return Inset::UNDISPATCHED;