Fix translation of \pagebreak and \linebreak with optional arguments.

Please don't add new features to tex2lyx without testing.
In this case, the test case was even provided in test-insets.tex.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37051 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2010-12-30 21:03:36 +00:00
parent d6ccb86f15
commit 05bd78904a

View File

@ -2577,8 +2577,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
}
}
else if (t.cs() == "newline"
|| t.cs() == "linebreak") {
else if (t.cs() == "newline" ||
(t.cs() == "linebreak" &&
p.next_token().asInput() != "[")) {
context.check_layout(os);
begin_inset(os, "Newline ");
os << t.cs();
@ -2764,9 +2765,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
}
else if (t.cs() == "newpage" ||
t.cs() == "pagebreak" ||
t.cs() == "clearpage" ||
t.cs() == "cleardoublepage") {
(t.cs() == "pagebreak" &&
p.next_token().asInput() != "[") ||
t.cs() == "clearpage" ||
t.cs() == "cleardoublepage") {
context.check_layout(os);
begin_inset(os, "Newpage ");
os << t.cs();