]> git.lyx.org Git - features.git/commitdiff
fix bug 1910
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 15 Jul 2005 15:42:44 +0000 (15:42 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 15 Jul 2005 15:42:44 +0000 (15:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10211 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/ChangeLog
src/tex2lyx/text.C

index 8dda46adbd8d39f75a029c14543b22c9263ca113..64e56d7ed84f7bb5430661d784f5582e24b42aa7 100644 (file)
@@ -1,3 +1,10 @@
+2005-07-15  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * 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  <Georg.Baum@post.rwth-aachen.de>
 
        * math.C (is_math_env): Don't hardcode known math environments anymore
index 65e901ee6b23f6374b17b57d3ab76542fc59ba79..8a9f7d23ba2dbba5742aa2c90b6bf4dfca158250 100644 (file)
@@ -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);
        }