]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Fix bug 4166: Crash when middle button click on inset label
[lyx.git] / src / Text.cpp
index 58c2bb0d660c31b668958848124622f25ed1962c..c149ad7973a26214e48aaf9f34bc8e2feab9addb 100644 (file)
@@ -104,14 +104,14 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
 
                if (par.forcePlainLayout()) {
                        // in this case only the empty layout is allowed
-                       layoutname = tclass.emptyLayoutName();
+                       layoutname = tclass.plainLayoutName();
                } else if (par.usePlainLayout()) {
                        // in this case, default layout maps to empty layout 
                        if (layoutname == tclass.defaultLayoutName())
-                               layoutname = tclass.emptyLayoutName();
+                               layoutname = tclass.plainLayoutName();
                } else { 
                        // otherwise, the empty layout maps to the default
-                       if (layoutname == tclass.emptyLayoutName())
+                       if (layoutname == tclass.plainLayoutName())
                                layoutname = tclass.defaultLayoutName();
                }
 
@@ -202,7 +202,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
        } else if (token == "\\backslash") {
                par.appendChar('\\', font, change);
        } else if (token == "\\LyXTable") {
-               auto_ptr<Inset> inset(new InsetTabular(buf));
+               auto_ptr<Inset> inset(new InsetTabular(const_cast<Buffer &>(buf)));
                inset->read(lex);
                par.insertInset(par.size(), inset.release(), font, change);
        } else if (token == "\\lyxline") {
@@ -382,11 +382,11 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
        if (sensitive) {
                if (cur.pos() == 0)
                        // set to standard-layout
-               //FIXME Check if this should be emptyLayout() in some cases
+               //FIXME Check if this should be plainLayout() in some cases
                        pars_[cpit].applyLayout(tclass.defaultLayout());
                else
                        // set to standard-layout
-                       //FIXME Check if this should be emptyLayout() in some cases
+                       //FIXME Check if this should be plainLayout() in some cases
                        pars_[next_par].applyLayout(tclass.defaultLayout());
        }