X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.C;h=d5306afd315e153d959a6ce4765c403075a11cff;hb=50a869e0e9f1d963421c726dcd1631c0f7eb65d6;hp=4fd63631557655ed072922df7af4c5acb5ebd250;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 4fd6363155..d5306afd31 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -283,7 +283,13 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // temporary set *par as previous of tmpbuf as we might have to realize // the font. tmpbuf->previous(*par); + + // make sure there is no class difference + SwitchLayoutsBetweenClasses(textclass, tc, tmpbuf, + current_view->buffer()->params); + Paragraph::depth_type max_depth = (*par)->getMaxDepthAfter(current_view->buffer()); + while(tmpbuf) { // if we have a negative jump so that the depth would go below // 0 depth then we have to redo the delta to this new max depth @@ -322,10 +328,6 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // now reset it to 0 buf->previous(0); - // make sure there is no class difference - SwitchLayoutsBetweenClasses(textclass, tc, buf, - current_view->buffer()->params); - // make the buf exactly the same layout than // the cursor paragraph buf->makeSameLayout(*par); @@ -400,7 +402,7 @@ int CutAndPaste::nrOfParagraphs() int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1, textclass_type c2, Paragraph * par, - BufferParams const & bparams) + BufferParams const & /*bparams*/) { int ret = 0; if (!par || c1 == c2)