#include "box.h"
#include "language.h"
#include "support/tostr.h"
+#include "support/lstrings.h"
#include "frontends/LyXView.h"
#include "frontends/screen.h"
#include "frontends/Dialogs.h"
}
}
bv()->screen().draw(bv()->text, bv(), new_y);
- if (boost::next(cursor.row()) != rows().end()) {
+
+ RowList::iterator next_row = boost::next(cursor.row());
+ if (next_row != rows().end()) {
LyXCursor cur;
- setCursor(cur, boost::next(cursor.row())->par(),
- boost::next(cursor.row())->pos(), false);
+ setCursor(cur, next_row->par(), next_row->pos(), false);
if (cur.y() < top_y() + bv()->workHeight()) {
cursorDown(true);
}
if (inset) {
bool gotsel = false;
if (lt->selection.set()) {
- lt->cutSelection(true, false);
+ bv->owner()->dispatch(FuncRequest(LFUN_CUT));
gotsel = true;
}
if (bv->insertInset(inset)) {
inset->localDispatch(cmd);
}
if (gotsel && pastesel)
- bv->owner()->dispatch(FuncRequest(LFUN_PASTESELECTION));
+ bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
}
else
delete inset;
// just comment out the line below...
} else {
update();
- cutSelection(bv, true);
+ cutSelection(true, false);
update();
}
moveCursorUpdate(bv, false);
}
} else {
update();
- cutSelection(bv, true);
+ cutSelection(true, false);
}
update();
break;
}
} else {
update();
- cutSelection(bv, true);
+ cutSelection(true, false);
update();
}
bv->owner()->view_state_changed();
}
} else {
update();
- cutSelection(bv, true);
+ cutSelection(true, false);
}
update();
break;
update();
break;
- case LFUN_PASTE:
+ case LFUN_PASTE: {
cmd.message(_("Paste"));
// clear the selection
bv->toggleSelection();
clearSelection();
update();
- pasteSelection();
+ size_t sel_index = 0;
+ string const & arg = cmd.argument;
+ if (isStrUnsignedInt(arg)) {
+ size_t const paste_arg = strToUnsignedInt(arg);
+#warning FIXME Check if the arg is in the domain of available selections.
+ sel_index = paste_arg;
+ }
+ pasteSelection(sel_index);
clearSelection(); // bug 393
update();
bv->switchKeyMap();
break;
+ }
case LFUN_CUT:
update();
- cutSelection(bv, true);
+ cutSelection(true, true);
update();
cmd.message(_("Cut"));
break;
break;
case LFUN_INDEX_PRINT:
- case LFUN_PARENTINSERT:
case LFUN_TOC_INSERT:
case LFUN_HFILL:
// do nothing fancy