LyXCursor const & cur, int & x, int & y)
{
lyx::pos_type const pos = cur.pos();
- Paragraph /*const*/ & par = *cur.par();
+ ParagraphList::iterator par = cur.par();
- if (pos >= par.size() || !par.isInset(pos))
+ if (pos >= par->size() || !par->isInset(pos))
return 0;
- Inset /*const*/ * inset = par.getInset(pos);
+ Inset /*const*/ * inset = par->getInset(pos);
if (!isEditableInset(inset))
return 0;
// get inset dimensions
- lyx::Assert(par.getInset(pos));
+ lyx::Assert(par->getInset(pos));
- LyXFont const & font = text.getFont(bv->buffer(), &par, pos);
+ LyXFont const & font = text.getFont(bv->buffer(), par, pos);
int const width = inset->width(bv, font);
int const inset_x = font.isVisibleRightToLeft()
return 0;
}
- text.setCursor(&par, pos, true);
+ text.setCursor(par, pos, true);
x -= b.x1;
// The origin of an inset is on the baseline
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;
for (; tmp != end; ++tmp) {
if (tmp->params().startOfAppendix()) {
- setUndo(bv, Undo::EDIT, tmp, boost::next(tmp));
+ setUndo(bv, Undo::EDIT, tmp);
tmp->params().startOfAppendix(false);
int tmpy;
setHeightOfRow(getRow(tmp, 0, tmpy));
}
}
- setUndo(bv, Undo::EDIT, pit, boost::next(pit));
+ setUndo(bv, Undo::EDIT, pit);
pit->params().startOfAppendix(start);
// we can set the refreshing parameters now
&& isHighlyEditableInset(cursor.par()->getInset(cursor.pos()))) {
Inset * tmpinset = cursor.par()->getInset(cursor.pos());
cmd.message(tmpinset->editMessage());
- FuncRequest cmd1(bv, LFUN_INSET_EDIT, is_rtl ? "left" : "right");
+ FuncRequest cmd1(bv, LFUN_INSET_EDIT, is_rtl ? "right" : "left");
tmpinset->localDispatch(cmd1);
break;
}
isHighlyEditableInset(cursor.par()->getInset(cursor.pos()))) {
Inset * tmpinset = cursor.par()->getInset(cursor.pos());
cmd.message(tmpinset->editMessage());
- FuncRequest cmd1(bv, LFUN_INSET_EDIT, is_rtl ? "right" : "left");
+ FuncRequest cmd1(bv, LFUN_INSET_EDIT, is_rtl ? "left" : "right");
tmpinset->localDispatch(cmd1);
break;
}
bv->switchKeyMap();
break;
- case LFUN_PROTECTEDSPACE:
+ case LFUN_SPACE_INSERT:
if (cursor.par()->layout()->free_spacing) {
insertChar(' ');
update();
} else {
- specialChar(this, bv, InsetSpecialChar::PROTECTED_SEPARATOR);
+ doInsertInset(this, cmd, false, false);
}
moveCursorUpdate(bv, false);
break;
break;
case LFUN_INDEX_PRINT:
- case LFUN_PARENTINSERT:
case LFUN_TOC_INSERT:
case LFUN_HFILL:
// do nothing fancy