From: Georg Baum Date: Thu, 30 Dec 2010 21:03:36 +0000 (+0000) Subject: Fix translation of \pagebreak and \linebreak with optional arguments. X-Git-Tag: 2.0.0~1220 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=05bd78904a2097dd1660161143172c933cecee68;p=features.git 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 --- diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index d901e18150..47d957c31d 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -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();