diff --git a/ChangeLog b/ChangeLog index de49985cfa..1cb2e447ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-07-21 Lars Gullik Bjønnes + + * src/paragraph.C (SimpleTeXOnePar): NEW_INSETS: move some #ifdef + to correct place. + + * src/buffer.C (parseSingleLyXformat2Token: NEW_INSETS: fix the + planemet in reading of old style floats, fix the \end_deeper + problem when reading old style floats. + 2000-07-20 Lars Gullik Bjønnes * src/paragraph.C (writeFile): NEW_INSETS: move a misplaced #endif diff --git a/src/buffer.C b/src/buffer.C index e33f44ae51..d2f3303e7d 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -404,6 +404,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, //lyxerr << "old float: " << tmptok << endl; Inset * inset = 0; + string old_float; if (tmptok == "footnote") { inset = new InsetFoot; @@ -411,31 +412,53 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, inset = new InsetMarginal; } else if (tmptok == "fig") { inset = new InsetFloat("figure"); - //inset = new InsetFigure; + old_float += "placement htbp\n"; } else if (tmptok == "tab") { inset = new InsetFloat("table"); - //inset = new InsetTable; + old_float += "placement htbp\n"; } else if (tmptok == "alg") { inset = new InsetFloat("algorithm"); - //inset = new InsetAlgorithm; + old_float += "placement htbp\n"; } else if (tmptok == "wide-fig") { InsetFloat * tmp = new InsetFloat("figure"); tmp->wide(true); inset = tmp; - //inset = new InsetFigure(true); + old_float += "placement htbp\n"; } else if (tmptok == "wide-tab") { InsetFloat * tmp = new InsetFloat("table"); tmp->wide(true); inset = tmp; - //inset = new InsetTable(true); + old_float += "placement htbp\n"; } if (!inset) return false; // no end read yet - string old_float = "\ncollapsed true\n"; + old_float += "collapsed true\n"; + + // Here we need to check for \end_deeper and handle that + // before we do the footnote parsing. + // This _is_ a hack! (Lgb) + while(true) { + lex.next(); + string tmp = lex.GetString(); + if (tmp == "\\end_deeper") { + lyxerr << "\\end_deeper caught!" << endl; + if (!depth) { + lex.printError("\\end_deeper: " + "depth is already null"); + } else + --depth; + + } else { + old_float += tmp; + old_float += ' '; + break; + } + } + old_float += lex.getLongString("\\end_float"); old_float += "\n\\end_inset\n"; - lyxerr << "float body: " << old_float << endl; + //lyxerr << "float body: " << old_float << endl; #ifdef HAVE_SSTREAM istringstream istr(old_float.c_str()); diff --git a/src/paragraph.C b/src/paragraph.C index 0a3cf91754..d739e5f6a8 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -2576,17 +2576,15 @@ bool LyXParagraph::SimpleTeXOnePar(Buffer const * buf, // Fully instantiated font LyXFont font = getFont(bparams, i); +#ifndef NEW_INSETS LyXParagraph * p = 0; if (i == 0 -#ifndef NEW_INSETS && previous && previous->footnoteflag != LyXParagraph::NO_FOOTNOTE && (p = PreviousBeforeFootnote()) != 0) -#else - && (p = previous)) -#endif last_font = p->getFont(bparams, p->size() - 1); else +#endif last_font = running_font; // Spaces at end of font change are simulated to be