]> git.lyx.org Git - features.git/commitdiff
Fix translation of \pagebreak and \linebreak with optional arguments.
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 30 Dec 2010 21:03:36 +0000 (21:03 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 30 Dec 2010 21:03:36 +0000 (21:03 +0000)
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

src/tex2lyx/text.cpp

index d901e18150675ddf9ec3b377b2f27e66a94f5bfe..47d957c31dbba1532c842e220d59c6deee04d67a 100644 (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();