]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Oops...
[lyx.git] / src / buffer.C
index 8e3e03e3d91f5a73078f0f2c05cbffd68357f071..d091ac51e867a2cec56a97b67b30cc5bf48342df 100644 (file)
@@ -1015,7 +1015,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
 
 // needed to insert the selection
 void Buffer::insertStringAsLines(Paragraph *& par, pos_type & pos,
-                                LyXFont const & fn,string const & str) const
+                                LyXFont const & fn,string const & str)
 {
        LyXLayout_ptr const & layout = par->layout();
 
@@ -1030,7 +1030,7 @@ void Buffer::insertStringAsLines(Paragraph *& par, pos_type & pos,
            cit != str.end(); ++cit) {
                if (*cit == '\n') {
                        if (autobreakrows && (!par->empty() || layout->keepempty)) {
-                               breakParagraph(params, par, pos,
+                               breakParagraph(this, par, pos,
                                               layout->isEnvironment());
                                par = par->next();
                                pos = 0;
@@ -1135,7 +1135,6 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
                        inset = new InsetParent(inscmd, *this);
                }
        } else {
-               bool alreadyread = false;
                if (tmptok == "Quotes") {
                        inset = new InsetQuotes;
                } else if (tmptok == "External") {
@@ -1144,16 +1143,8 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
                        inset = new InsetFormulaMacro;
                } else if (tmptok == "Formula") {
                        inset = new InsetFormula;
-               } else if (tmptok == "Figure") { // Backward compatibility
-//                     inset = new InsetFig(100, 100, *this);
-                       inset = new InsetGraphics;
                } else if (tmptok == "Graphics") {
                        inset = new InsetGraphics;
-               } else if (tmptok == "Info") {// backwards compatibility
-                       inset = new InsetNote(this,
-                                             lex.getLongString("\\end_inset"),
-                                             true);
-                       alreadyread = true;
                } else if (tmptok == "Note") {
                        inset = new InsetNote(params);
                } else if (tmptok == "Include") {
@@ -1193,7 +1184,8 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
                        inset = new InsetFloatList;
                }
 
-               if (inset && !alreadyread) inset->read(this, lex);
+               if (inset)
+                       inset->read(this, lex);
        }
 
        if (inset) {
@@ -1786,7 +1778,7 @@ void Buffer::makeLaTeXFile(ostream & os,
                texrow.newline();
        }
 
-       latexParagraphs(os, &*(paragraphs.begin()), 0, texrow);
+       latexParagraphs(os, paragraphs.begin(), paragraphs.end(), texrow);
 
        // add this just in case after all the paragraphs
        os << endl;
@@ -1824,8 +1816,10 @@ void Buffer::makeLaTeXFile(ostream & os,
 //
 // LaTeX all paragraphs from par to endpar, if endpar == 0 then to the end
 //
-void Buffer::latexParagraphs(ostream & ofs, Paragraph * par,
-                            Paragraph * endpar, TexRow & texrow,
+void Buffer::latexParagraphs(ostream & ofs,
+                            ParagraphList::iterator par,
+                            ParagraphList::iterator endpar,
+                            TexRow & texrow,
                             bool moving_arg) const
 {
        bool was_title = false;
@@ -1873,12 +1867,12 @@ void Buffer::latexParagraphs(ostream & ofs, Paragraph * par,
                        if (layout->isEnvironment() ||
                                !par->params().leftIndent().zero())
                        {
-                               par = par->TeXEnvironment(this, params, ofs, texrow);
+                               par = TeXEnvironment(this, params, par, ofs, texrow);
                        } else {
-                               par = par->TeXOnePar(this, params, ofs, texrow, moving_arg);
+                               par = TeXOnePar(this, params, par, ofs, texrow, moving_arg);
                        }
                } else {
-                       par = par->TeXOnePar(this, params, ofs, texrow, moving_arg);
+                       par = TeXOnePar(this, params, par, ofs, texrow, moving_arg);
                }
        }
        // It might be that we only have a title in this document