From 1396dc00a5c43e227d18c47d7ee827503829bcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sun, 27 Apr 2008 12:44:09 +0000 Subject: [PATCH] tex2lyx/text.cpp: remove support for \centering and the like as first step to fix the broken paragraph alignment import, see bug 4806 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24520 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/text.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 237019d492..3606f4c65b 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -802,23 +802,28 @@ void parse_environment(Parser & p, ostream & os, bool outer, parse_unknown_environment(p, name, os, FLAG_END, outer, parent_context); - // Alignment settings - else if (name == "center" || name == "flushleft" || name == "flushright" || - name == "centering" || name == "raggedright" || name == "raggedleft") { + // Alignment and spacing settings + // FIXME (bug xxxx): These settings can span multiple paragraphs and + // therefore are totally broken! + // Note that \centering, raggedright, and raggedleft cannot be handled, as + // they are commands not environments. They furthermore are switches that + // can be ended by another switch, but also by commands like \footnote or + // \parbox. So lbetter leave them untouched. + else if (name == "center" || name == "flushleft" || name == "flushright") { eat_whitespace(p, os, parent_context, false); // We must begin a new paragraph if not already done if (! parent_context.atParagraphStart()) { parent_context.check_end_layout(os); parent_context.new_paragraph(os); } - if (name == "flushleft" || name == "raggedright") + if (name == "flushleft") parent_context.add_extra_stuff("\\align left\n"); - else if (name == "flushright" || name == "raggedleft") + else if (name == "flushright") parent_context.add_extra_stuff("\\align right\n"); - else + else if (name == "center") parent_context.add_extra_stuff("\\align center\n"); parse_text(p, os, FLAG_END, outer, parent_context); - // Just in case the environment is empty .. + // Just in case the environment is empty parent_context.extra_stuff.erase(); // We must begin a new paragraph to reset the alignment parent_context.new_paragraph(os);