pit_type pit = cur.pit();
pos_type pos = cur.pos();
InsetText * target_inset = cur.inset().asInsetText();
+ if (!target_inset) {
+ InsetTabular * it = cur.inset().asInsetTabular();
+ target_inset = it? it->cell(cur.idx())->asInsetText() : 0;
+ }
LASSERT(target_inset, return make_pair(PitPosPair(pit, pos), pit));
ParagraphList & pars = target_inset->paragraphs();
docstring selection(size_t sel_index)
{
return sel_index < theCuts.size()
- ? theCuts[sel_index].first.back().asString(AS_STR_INSETS)
+ ? theCuts[sel_index].first.back().asString(AS_STR_INSETS | AS_STR_NEWLINES)
: docstring();
}
cur.recordUndo();
DocIterator selbeg = cur.selectionBegin();
- // Get font setting before we cut
+ // Get font setting before we cut, we need a copy here, not a bare reference.
Font const font =
selbeg.paragraph().getFontSettings(cur.buffer().params(), selbeg.pos());
if (lyxrc.auto_region_delete)
selDel(cur);
else
- cur.selection() = false;
+ cur.setSelection(false);
}