-#ifndef NO_COMPABILITY
- }
-#endif
-#ifndef NO_COMPABILITY
- } else if (token == "\\begin_float") {
- insertErtContents(par, pos);
- //insertErtContents(par, pos, false);
- //ert_stack.push(ert_comp);
- //ert_comp = ErtComp();
-
- // This is the compability reader. It can be removed in
- // LyX version 1.3.0. (Lgb)
- lex.next();
- string const tmptok = lex.getString();
- //lyxerr << "old float: " << tmptok << endl;
-
- Inset * inset = 0;
- stringstream old_float;
-
- if (tmptok == "footnote") {
- inset = new InsetFoot(params);
- old_float << "collapsed true\n";
- } else if (tmptok == "margin") {
- inset = new InsetMarginal(params);
- old_float << "collapsed true\n";
- } else if (tmptok == "fig") {
- inset = new InsetFloat(params, "figure");
- old_float << "wide false\n"
- << "collapsed false\n";
- } else if (tmptok == "tab") {
- inset = new InsetFloat(params, "table");
- old_float << "wide false\n"
- << "collapsed false\n";
- } else if (tmptok == "alg") {
- inset = new InsetFloat(params, "algorithm");
- old_float << "wide false\n"
- << "collapsed false\n";
- } else if (tmptok == "wide-fig") {
- inset = new InsetFloat(params, "figure");
- //InsetFloat * tmp = new InsetFloat("figure");
- //tmp->wide(true);
- //inset = tmp;
- old_float << "wide true\n"
- << "collapsed false\n";
- } else if (tmptok == "wide-tab") {
- inset = new InsetFloat(params, "table");
- //InsetFloat * tmp = new InsetFloat("table");
- //tmp->wide(true);
- //inset = tmp;
- old_float << "wide true\n"
- << "collapsed false\n";
- }
-
- if (!inset) {
- return false; // no end read yet
- }
-
- // 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 const 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 << ' ';
- break;
- }
- }
-
- old_float << lex.getLongString("\\end_float")
- << "\n\\end_inset\n";
- //lyxerr << "Float Body:\n" << old_float.str() << endl;
- // That this does not work seems like a bug
- // in stringstream. (Lgb)
- istringstream istr(old_float.str());
- LyXLex nylex(0, 0);
- nylex.setStream(istr);
- inset->read(this, nylex);
- par->insertInset(pos, inset, font);
- ++pos;
- insertErtContents(par, pos);
-
- // we have to reset the font as in the old format after a float
- // the font was automatically reset!
- font = LyXFont(LyXFont::ALL_INHERIT, params.language);
-#endif