mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
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
This commit is contained in:
parent
04911c0462
commit
1396dc00a5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user