X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=2f1a715d084608ac194fb568e9c93e73cc3a3f72;hb=96007ce5ac7944bbb30366e21730979498ef296c;hp=901b7d7f4a6abafe0d4bcd587e91c64884f10506;hpb=f83a38b3defc997f808539d0dfd618f5ba71e13c;p=lyx.git diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 901b7d7f4a..2f1a715d08 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -97,6 +97,10 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, 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(); @@ -797,7 +801,7 @@ void clearCutStack() 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(); } @@ -911,7 +915,7 @@ void replaceSelectionWithString(Cursor & cur, docstring const & str, bool backwa DocIterator selbeg = cur.selectionBegin(); // Get font setting before we cut - Font const font = + Font const & font = selbeg.paragraph().getFontSettings(cur.buffer().params(), selbeg.pos()); // Insert the new string @@ -989,7 +993,7 @@ void selClearOrDel(Cursor & cur) if (lyxrc.auto_region_delete) selDel(cur); else - cur.selection() = false; + cur.setSelection(false); }