From: Georg Baum Date: Fri, 15 Jul 2005 15:42:44 +0000 (+0000) Subject: fix bug 1910 X-Git-Tag: 1.6.10~14121 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2080e33e23de4fa1b29ca26d2afb4495ff0fc947;p=features.git fix bug 1910 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10211 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index 8dda46adbd..64e56d7ed8 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -1,3 +1,10 @@ +2005-07-15 Georg Baum + + * text.C (parse_environment): handle context of unknown environments + correctly (fixes bug 1910) + * text.C (parse_environment): output the end of known environments + (one line disappeared from yesterdays patch) + 2005-07-13 Georg Baum * math.C (is_math_env): Don't hardcode known math environments anymore diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index 65e901ee6b..8a9f7d23ba 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -788,7 +788,12 @@ void parse_environment(Parser & p, ostream & os, bool outer, else if (name == "tabbing") { // We need to remember that we have to handle '\=' specially handle_ert(os, "\\begin{" + name + "}", parent_context); - parse_text_snippet(p, os, FLAG_END | FLAG_TABBING, outer, parent_context); + // FIXME: Try whether parse_text instead of parse_text_snippet + // works. Then no manual layout checking would be needed. + parent_context.check_end_layout(os); + parse_text_snippet(p, os, FLAG_END | FLAG_TABBING, outer, + parent_context); + parent_context.need_layout = true; handle_ert(os, "\\end{" + name + "}", parent_context); } @@ -808,14 +813,25 @@ void parse_environment(Parser & p, ostream & os, bool outer, if (contents == verbatim) handle_ert(os, p.verbatimEnvironment(name), parent_context); - else + else { + // FIXME: Try whether parse_text instead of + // parse_text_snippet works. Then no manual layout + // checking would be needed. + parent_context.check_end_layout(os); parse_text_snippet(p, os, FLAG_END, outer, parent_context); + parent_context.need_layout = true; + } + handle_ert(os, "\\end{" + name + "}", parent_context); } else { handle_ert(os, "\\begin{" + name + "}", parent_context); + // FIXME: Try whether parse_text instead of parse_text_snippet + // works. Then no manual layout checking would be needed. + parent_context.check_end_layout(os); parse_text_snippet(p, os, FLAG_END, outer, parent_context); + parent_context.need_layout = true; handle_ert(os, "\\end{" + name + "}", parent_context); }