lyx::dispatch(FuncRequest(LFUN_PASTE, "0"));
// reset first par to default
if (cur.lastpit() != 0 || cur.lastpos() != 0) {
- Layout_ptr const layout =
+ LayoutPtr const layout =
cur.buffer().params().getTextClass().defaultLayout();
cur.text()->paragraphs().begin()->layout(layout);
}
Paragraph & par = cur.paragraph();
pos_type pos = cur.pos();
BufferParams const & bufparams = bv->buffer().params();
- Layout_ptr const & style = par.layout();
+ LayoutPtr const & style = par.layout();
if (!style->pass_thru
&& par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") {
// this avoids a double undo
// reposition the cursor to the caption
cur.pit() = cap_pit;
cur.pos() = 0;
- cur.dispatch(FuncRequest(LFUN_CAPTION_INSERT));
+ // FIXME: This Text/Cursor dispatch handling is a mess!
+ // We cannot use Cursor::dispatch here it needs access to up to
+ // date metrics.
+ cur.text()->dispatch(cur, FuncRequest(LFUN_CAPTION_INSERT));
+ cur.updateFlags(Update::Force);
// FIXME: When leaving the Float (or Wrap) inset we should
// delete any empty paragraph left above or below the
// caption.
break;
case LFUN_CHARSTYLE_INSERT:
code = Inset::CHARSTYLE_CODE;
- if (cur.buffer().params().getTextClass().charstyles().empty())
+ if (cur.buffer().params().getTextClass().insetlayouts().empty())
enable = false;
break;
case LFUN_BOX_INSERT: