]> git.lyx.org Git - features.git/commitdiff
Parse the picture variant of \framebox correctly (part of bug #6449)
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Sun, 27 Nov 2011 11:57:47 +0000 (11:57 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Sun, 27 Nov 2011 11:57:47 +0000 (11:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40294 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/test/box-color-size-space-align.tex
src/tex2lyx/text.cpp

index 4a6e4be0ead672a8e1729439f027cd8a9966ac04..278a5e1928c60aeac951b1a418adcbb59135d986 100644 (file)
@@ -87,6 +87,7 @@ blabla \makebox[3cm][l]{makebox 3} blabla
 \begin{picture}(8,6)
 \put(0,0){\makebox(0,0)[tr]{AAA}}
 \put(8,0){\makebox(0,0){BBB}}
+\put(0,8){\framebox(0,0){x}}
 \put(1,0){\line(1,0){6}}   
 \end{picture}
 
index 4e39654d2935c9e065418ad3b60c25882a6e9627..71d36a56befa72afe432ede42035bd7ac2ef04aa 100644 (file)
@@ -3606,17 +3606,30 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        parse_outer_box(p, os, FLAG_ITEM, outer, context, t.cs(), "");
 
                else if (t.cs() == "framebox") {
-                       string special = p.getFullOpt();
-                       special += p.getOpt();
-                       parse_outer_box(p, os, FLAG_ITEM, outer, context, t.cs(), special);
+                       if (p.next_token().character() == '(') {
+                               //the syntax is: \framebox(x,y)[position]{content}
+                               string arg = t.asInput();
+                               arg += p.getFullParentheseArg();
+                               arg += p.getFullOpt();
+                               eat_whitespace(p, os, context, false);
+                               handle_ert(os, arg + '{', context);
+                               eat_whitespace(p, os, context, false);
+                               parse_text(p, os, FLAG_ITEM, outer, context);
+                               handle_ert(os, "}", context);
+                       } else {
+                               string special = p.getFullOpt();
+                               special += p.getOpt();
+                               parse_outer_box(p, os, FLAG_ITEM, outer,
+                                               context, t.cs(), special);
+                       }
                }
 
                //\makebox() is part of the picture environment and different from \makebox{}
                //\makebox{} will be parsed by parse_box
                else if (t.cs() == "makebox") {
-                       string arg = t.asInput();
                        if (p.next_token().character() == '(') {
                                //the syntax is: \makebox(x,y)[position]{content}
+                               string arg = t.asInput();
                                arg += p.getFullParentheseArg();
                                arg += p.getFullOpt();
                                eat_whitespace(p, os, context, false);