]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_funcs.cpp
This is the first of a series of commits that will make InsetLayout a real class.
[lyx.git] / src / paragraph_funcs.cpp
index 9e56bd550bd3105df4049dd08ff3d74e4c42ee7e..4dece7ae03eefd46603579a4b2818baacef13bf4 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "BufferParams.h"
 #include "Changes.h"
-#include "support/debug.h"
 #include "InsetList.h"
 #include "Layout.h"
 #include "Paragraph.h"
 #include "Text.h"
 #include "TextClass.h"
 
+#include "support/debug.h"
+
 #include <boost/next_prior.hpp>
 
+using namespace std;
 
 namespace lyx {
 
-using std::endl;
-
-
 static bool moveItem(Paragraph & fromPar, pos_type fromPos,
        Paragraph & toPar, pos_type toPos, BufferParams const & params)
 {
@@ -73,11 +72,14 @@ void breakParagraph(BufferParams const & bparams,
 
        Paragraph & par = pars[par_offset];
 
-       // without doing that we get a crash when typing <Return> at the
-       // end of a paragraph
-       tmp->layout(bparams.getTextClass().defaultLayout());
        // remember to set the inset_owner
        tmp->setInsetOwner(par.inInset());
+       // without doing that we get a crash when typing <Return> at the
+       // end of a paragraph
+       if (par.useEmptyLayout())
+               tmp->layout(bparams.getTextClass().emptyLayout());
+       else
+               tmp->layout(bparams.getTextClass().defaultLayout());
 
        // layout stays the same with latex-environments
        if (keep_layout) {