fix bug 1446 (tex2lyx nesting)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8822 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2004-06-23 15:11:23 +00:00
parent 3dceaedfa2
commit a5bf3f142f
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-06-23 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* 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 <Georg.Baum@post.rwth-aachen.de> 2004-06-18 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* preamble.C, text.C: s/wether/whether/g * preamble.C, text.C: s/wether/whether/g

View File

@ -323,6 +323,12 @@ void output_command_layout(ostream & os, Parser & p, bool outer,
parent_context.check_end_layout(os); parent_context.check_end_layout(os);
Context context(true, parent_context.textclass, newlayout, Context context(true, parent_context.textclass, newlayout,
parent_context.layout); 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_deeper(os);
context.check_layout(os); context.check_layout(os);
if (context.layout->optionalargs > 0) { 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); parse_text_snippet(p, os, FLAG_ITEM, outer, context);
context.check_end_layout(os); 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); context.check_end_deeper(os);
// We don't need really a new paragraph, but // We don't need really a new paragraph, but
// we must make sure that the next item gets a \begin_layout. // 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()) { newlayout->isEnvironment()) {
Context context(true, parent_context.textclass, newlayout, Context context(true, parent_context.textclass, newlayout,
parent_context.layout); 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); parent_context.check_end_layout(os);
switch (context.layout->latextype) { switch (context.layout->latextype) {
case LATEX_LIST_ENVIRONMENT: case LATEX_LIST_ENVIRONMENT:
@ -606,6 +623,11 @@ void parse_environment(Parser & p, ostream & os, bool outer,
context.check_deeper(os); context.check_deeper(os);
parse_text(p, os, FLAG_END, outer, context); parse_text(p, os, FLAG_END, outer, context);
context.check_end_layout(os); 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); context.check_end_deeper(os);
parent_context.new_paragraph(os); parent_context.new_paragraph(os);
} }