diff --git a/lib/ChangeLog b/lib/ChangeLog index ef311d5f57..42f3bcbd13 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-07-28 José Matos + + * lyx2lyx/lyx_convert224.py (layout2begin_layout): + \layout -> \begin_layout. + 2003-07-28 José Matos * lyx2lyx/lyx_convert224.py (add_end_layout): fix logic. diff --git a/lib/lyx2lyx/lyxconvert_224.py b/lib/lyx2lyx/lyxconvert_224.py index 18c41b13fe..a64fc7be2a 100644 --- a/lib/lyx2lyx/lyxconvert_224.py +++ b/lib/lyx2lyx/lyxconvert_224.py @@ -68,19 +68,19 @@ def add_end_layout(lines): lines.insert(i, "\\end_layout") return -## def layout2begin_layout(lines): -## i = 0 -## while 1: -## i = find_token(lines, '\\layout', i) -## if i == -1: -## return +def layout2begin_layout(lines): + i = 0 + while 1: + i = find_token(lines, '\\layout', i) + if i == -1: + return -## lines[i]= replace(lines[i], '\\layout', '\\begin_layout') -## i = i + 1 + lines[i]= replace(lines[i], '\\layout', '\\begin_layout') + i = i + 1 def convert(header, body): add_end_layout(body) -## layout2begin_layout(body) + layout2begin_layout(body) if __name__ == "__main__": pass diff --git a/po/POTFILES.in b/po/POTFILES.in index 87864eb78a..b03accf318 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -179,6 +179,7 @@ src/mathed/ref_inset.C src/paragraph.C src/paragraph_funcs.C src/rowpainter.C +src/support/path_defines.C src/text.C src/text2.C src/text3.C diff --git a/src/ChangeLog b/src/ChangeLog index dacc8eae5f..04e50276f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-07-28 José Matos + + * buffer.C (readParagraph): + * params_func (readParToken, readParagraph): + * paragraph.C (write): \layout -> \begin_layout. + 2003-07-28 Lars Gullik Bjønnes * lyxlex_pimpl.C (setFile): clean up slightly. diff --git a/src/buffer.C b/src/buffer.C index 9ac61660dc..95fc968d37 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -348,7 +348,7 @@ int Buffer::readParagraph(LyXLex & lex, string const & token, static Change current_change; int unknown = 0; - if (token == "\\layout") { + if (token == "\\begin_layout") { lex.pushToken(token); Paragraph par; diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 1df6c2c94c..1b0149868a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-07-28 José Matos + + * insetert.C (write): \layout -> \begin_layout. + Add missing \end_layout. + 2003-07-28 Jean-Marc Lasgouttes * insettabular.C (write): remove extra space diff --git a/src/insets/insetert.C b/src/insets/insetert.C index e15b070d04..86aa7b7bef 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -205,7 +205,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const ParagraphList::iterator par = inset.paragraphs.begin(); ParagraphList::iterator end = inset.paragraphs.end(); for (; par != end; ++par) { - os << "\n\\layout " << layout << "\n"; + os << "\n\\begin_layout " << layout << "\n"; pos_type siz = par->size(); for (pos_type i = 0; i < siz; ++i) { Paragraph::value_type c = par->getChar(i); @@ -227,6 +227,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const break; } } + os << "\n\\end_layout\n"; } } diff --git a/src/paragraph.C b/src/paragraph.C index f6982c75aa..5579d6deee 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -156,7 +156,7 @@ void Paragraph::write(Buffer const * buf, ostream & os, } // First write the layout - os << "\n\\layout " << layout()->name() << '\n'; + os << "\n\\begin_layout " << layout()->name() << '\n'; params().write(os); diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index b10f4e31d4..c3eaec30cd 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -793,7 +793,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok for (; cit != token.end(); ++cit) { par.insertChar(par.size(), (*cit), font, change); } - } else if (token == "\\layout") { + } else if (token == "\\begin_layout") { lex.eatLine(); string layoutname = lex.getString(); @@ -828,7 +828,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok } else if (token == "\\end_layout") { lyxerr << "Solitary \\end_layout in line " << lex.getLineNo() << "\n" - << "Missing \\layout?.\n"; + << "Missing \\begin_layout?.\n"; } else if (token == "\\end_inset") { lyxerr << "Solitary \\end_inset in line " << lex.getLineNo() << "\n" << "Missing \\begin_inset?.\n"; @@ -988,7 +988,7 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex) lyxerr[Debug::PARSER] << "Handling paragraph token: `" << token << '\'' << endl; - if (token == "\\layout" || token == "\\the_end" + if (token == "\\begin_layout" || token == "\\the_end" || token == "\\end_inset" || token == "\\begin_deeper" || token == "\\end_deeper") { lex.pushToken(token); diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index 81c7d1614f..f7eff69173 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -1,3 +1,10 @@ +2003-07-28 José Matos + + * text.C: + * tex2lyx.C: + * preamble.C: + * table.C: \layout -> \begin_layout. + 2003-07-28 Jean-Marc Lasgouttes * text.C (parse_text): read environment from layout file too. Now, diff --git a/src/tex2lyx/preamble.C b/src/tex2lyx/preamble.C index a51be6160a..bdcafa22eb 100644 --- a/src/tex2lyx/preamble.C +++ b/src/tex2lyx/preamble.C @@ -166,7 +166,7 @@ void end_preamble(ostream & os, LyXTextClass const & textclass) << "\\papersides " << h_papersides << "\n" << "\\paperpagestyle " << h_paperpagestyle << "\n" << "\\tracking_changes " << h_tracking_changes << "\n" - << "\\end_header\n\n\\layout Standard\n"; + << "\\end_header\n\n\\begin_layout Standard\n"; } diff --git a/src/tex2lyx/table.C b/src/tex2lyx/table.C index 0d00c8e4fb..cf3d0cbfa9 100644 --- a/src/tex2lyx/table.C +++ b/src/tex2lyx/table.C @@ -490,7 +490,7 @@ void handle_tabular(Parser & p, ostream & os, os << " usebox=\"none\"" << ">" << "\n\\begin_inset Text" - << "\n\n\\layout Standard\n\n" + << "\n\n\\begin_layout Standard\n\n" << cell.content << "\n\\end_inset \n" << "\n"; diff --git a/src/tex2lyx/tex2lyx.C b/src/tex2lyx/tex2lyx.C index 9412dfec02..ddfdd11083 100644 --- a/src/tex2lyx/tex2lyx.C +++ b/src/tex2lyx/tex2lyx.C @@ -121,7 +121,7 @@ void clean_layouts(istream & is, ostream & os) bool eating = false; while (getline(is, line)) { string tline = trim(line, " "); - if (line.substr(0, 8) == "\\layout ") { + if (line.substr(0, 8) == "\\begin_layout ") { //cerr << "layout: " << line << "\n"; last = line; eating = true; diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index 22a0c570b0..10bc1a911e 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -100,7 +100,7 @@ void skip_braces(Parser & p) void handle_ert(ostream & os, string const & s) { begin_inset(os, "ERT"); - os << "\nstatus Collapsed\n\n\\layout Standard\n\n"; + os << "\nstatus Collapsed\n\n\\begin_layout Standard\n\n"; for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) { if (*it == '\\') os << "\n\\backslash \n"; @@ -115,7 +115,7 @@ void handle_par(ostream & os) { if (active_environments.empty()) return; - os << "\n\\layout "; + os << "\n\\begin_layout "; string s = active_environment(); if (s == "document" || s == "table") os << "Standard\n\n"; @@ -156,19 +156,19 @@ void output_layout(ostream & os, LyXLayout_ptr const & layout_ptr, Parser & p, bool outer, LyXTextClass const & textclass) { string name = layout_ptr->name(); - os << "\n\n\\layout " << name << "\n\n"; + os << "\n\n\\begin_layout " << name << "\n\n"; if (layout_ptr->optionalargs > 0) { string s; if (p.next_token().character() == '[') { p.get_token(); // eat '[' begin_inset(os, "OptArg\n"); - os << "collapsed true\n\n\\layout Standard\n\n"; + os << "collapsed true\n\n\\begin_layout Standard\n\n"; parse_text(p, os, FLAG_BRACK_LAST, outer, textclass); end_inset(os); } } parse_text(p, os, FLAG_ITEM, outer, textclass); - os << "\n\n\\layout Standard\n\n"; + os << "\n\n\\begin_layout Standard\n\n"; } } // anonymous namespace @@ -327,7 +327,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } os << "wide " << tostr(is_starred) << "\ncollapsed false\n\n" - << "\\layout Standard\n"; + << "\\begin_layout Standard\n"; parse_text(p, os, FLAG_END, outer, textclass); end_inset(os); @@ -344,7 +344,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, || s == "lyxlist"; if (deeper) os << "\n\\begin_deeper"; - os << "\n\\layout " << layout_ptr->name() + os << "\n\\begin_layout " << layout_ptr->name() << "\n\n"; switch (layout_ptr->latextype) { case LATEX_LIST_ENVIRONMENT: @@ -438,7 +438,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "footnote") { begin_inset(os, "Foot\n"); - os << "collapsed true\n\n\\layout Standard\n\n"; + os << "collapsed true\n\n\\begin_layout Standard\n\n"; parse_text(p, os, FLAG_ITEM, false, textclass); end_inset(os); } @@ -453,7 +453,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "marginpar") { begin_inset(os, "Marginal\n"); - os << "collapsed true\n\n\\layout Standard\n\n"; + os << "collapsed true\n\n\\begin_layout Standard\n\n"; parse_text(p, os, FLAG_ITEM, false, textclass); end_inset(os); } @@ -523,7 +523,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } else if (t.cs() == "bibitem") { - os << "\n\\layout Bibliography\n\\bibitem "; + os << "\n\\begin_layout Bibliography\n\\bibitem "; os << p.getOpt(); os << '{' << p.verbatim_item() << '}' << "\n"; }