X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=5f1410726b5215f0ba6bda8e2ba46a53b4e1cfb3;hb=03ec50ac4d06ef2b000d87a175d7a149c9abb2bf;hp=b31117d2802bd690b0cabbddb67734d7ea52d6ce;hpb=6cc68a2663d1b86f601e196f1ed34e9685a3f6c6;p=lyx.git diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index b31117d280..5f1410726b 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(); @@ -122,6 +126,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, if (insertion[i].isNewline(j)) { // do not track deletion of newline insertion[i].eraseChar(j, false); + insertion[i].setInsetOwner(target_inset); breakParagraphConservative( buffer.params(), insertion, i, j); @@ -195,7 +200,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, for (pos_type i = 0; i < tmpbuf->size(); ++i) { // do not track deletion of invalid insets if (Inset * inset = tmpbuf->getInset(i)) - if (target_inset->insetAllowed(inset->lyxCode())) + if (!target_inset->insetAllowed(inset->lyxCode())) tmpbuf->eraseChar(i--, false); } @@ -988,7 +993,7 @@ void selClearOrDel(Cursor & cur) if (lyxrc.auto_region_delete) selDel(cur); else - cur.selection() = false; + cur.setSelection(false); }