From a5bf3f142f7142de361b63b82b8f51fa4325ca42 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 23 Jun 2004 15:11:23 +0000 Subject: [PATCH] fix bug 1446 (tex2lyx nesting) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8822 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/ChangeLog | 5 +++++ src/tex2lyx/text.C | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index 72dcf2c355..45c5055753 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -1,3 +1,8 @@ +2004-06-23 Georg Baum + + * text.C (output_command_layout, parse_environment): fix bug 1446 + by passing parent_context.deeper_paragraph to the child context + 2004-06-18 Georg Baum * preamble.C, text.C: s/wether/whether/g diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index 93425ec676..b37e42cbda 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -323,6 +323,12 @@ void output_command_layout(ostream & os, Parser & p, bool outer, parent_context.check_end_layout(os); Context context(true, parent_context.textclass, newlayout, parent_context.layout); + if (parent_context.deeper_paragraph) { + // We are beginning a nested environment after a + // deeper paragraph inside the outer list environment. + // Therefore we don't need to output a "begin deeper". + context.need_end_deeper = true; + } context.check_deeper(os); context.check_layout(os); if (context.layout->optionalargs > 0) { @@ -338,6 +344,11 @@ void output_command_layout(ostream & os, Parser & p, bool outer, } parse_text_snippet(p, os, FLAG_ITEM, outer, context); context.check_end_layout(os); + if (parent_context.deeper_paragraph) { + // We must suppress the "end deeper" because we + // suppressed the "begin deeper" above. + context.need_end_deeper = false; + } context.check_end_deeper(os); // We don't need really a new paragraph, but // we must make sure that the next item gets a \begin_layout. @@ -589,6 +600,12 @@ void parse_environment(Parser & p, ostream & os, bool outer, newlayout->isEnvironment()) { Context context(true, parent_context.textclass, newlayout, parent_context.layout); + if (parent_context.deeper_paragraph) { + // We are beginning a nested environment after a + // deeper paragraph inside the outer list environment. + // Therefore we don't need to output a "begin deeper". + context.need_end_deeper = true; + } parent_context.check_end_layout(os); switch (context.layout->latextype) { case LATEX_LIST_ENVIRONMENT: @@ -606,6 +623,11 @@ void parse_environment(Parser & p, ostream & os, bool outer, context.check_deeper(os); parse_text(p, os, FLAG_END, outer, context); context.check_end_layout(os); + if (parent_context.deeper_paragraph) { + // We must suppress the "end deeper" because we + // suppressed the "begin deeper" above. + context.need_end_deeper = false; + } context.check_end_deeper(os); parent_context.new_paragraph(os); } -- 2.39.2