]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_funcs.cpp
Paragraph::inInset() shall not be used if the owner inset was not initialized. Make...
[lyx.git] / src / paragraph_funcs.cpp
index 7f2f45d07c167548c93baccf7aface21431161a2..600d361bd720ced8849199e4c97ea6791421702f 100644 (file)
@@ -47,7 +47,7 @@ static bool moveItem(Paragraph & fromPar, pos_type fromPos,
                        tmpInset = fromPar.releaseInset(fromPos);
                }
 
-               if (!toPar.insetAllowed(tmpInset->lyxCode())) {
+               if (!toPar.inInset().insetAllowed(tmpInset->lyxCode())) {
                        delete tmpInset;
                        return false;
                }
@@ -74,10 +74,10 @@ void breakParagraph(BufferParams const & bparams,
        Paragraph & par = pars[par_offset];
 
        // remember to set the inset_owner
-       tmp->setInsetOwner(par.inInset());
+       tmp->setInsetOwner(&par.inInset());
        // without doing that we get a crash when typing <Return> at the
        // end of a paragraph
-       tmp->setEmptyOrDefaultLayout(bparams.documentClass());
+       tmp->setPlainOrDefaultLayout(bparams.documentClass());
 
        // layout stays the same with latex-environments
        if (keep_layout) {
@@ -142,7 +142,7 @@ void breakParagraph(BufferParams const & bparams,
                par.params().clear();
                // do not lose start of appendix marker (bug 4212)
                par.params().startOfAppendix(soa);
-               par.setEmptyOrDefaultLayout(bparams.documentClass());
+               par.setPlainOrDefaultLayout(bparams.documentClass());
        }
 
        // layout stays the same with latex-environments
@@ -162,6 +162,7 @@ void breakParagraphConservative(BufferParams const & bparams,
                                       Paragraph());
        Paragraph & par = pars[par_offset];
 
+       tmp.setInsetOwner(&par.inInset());
        tmp.makeSameLayout(par);
 
        LASSERT(pos <= par.size(), /**/);