The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 269a942294ba02ab1ad0550ff4cd3545da7994d1
Author: Georg Baum <[email protected]>
Date:   Sat Oct 6 15:23:36 2012 +0200

    Fix wrong parsing of \framebox[3in][s]{...}
    
    s is a valid horizontal position for framebox (as well as for makebox, which
    was already parsed correctly). There was even a test case, but with a wrong
    reference.

diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx
index a0ddb99..81b5ee0 100644
--- a/src/tex2lyx/test/test.lyx.lyx
+++ b/src/tex2lyx/test/test.lyx.lyx
@@ -131,7 +131,7 @@ status collapsed
 
 \begin_inset Box Boxed
 position "c"
-hor_pos "c"
+hor_pos "s"
 has_inner_box 0
 inner_pos "c"
 use_parbox 0
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 71379fd..7f7603c 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -814,8 +814,18 @@ void parse_box(Parser & p, ostream & os, unsigned 
outer_flags,
                        if (inner_type != "makebox") {
                                latex_height = p.getArg('[', ']');
                                translate_box_len(latex_height, height_value, 
height_unit, height_special);
-                       } else
-                               hor_pos = p.getArg('[', ']');
+                       } else {
+                               string const opt = p.getArg('[', ']');
+                               if (!opt.empty()) {
+                                       hor_pos = opt;
+                                       if (hor_pos != "l" && hor_pos != "c" &&
+                                           hor_pos != "r" && hor_pos != "s") {
+                                               cerr << "invalid hor_pos " << 
hor_pos
+                                                    << " for " << inner_type 
<< endl;
+                                               hor_pos = "c";
+                                       }
+                               }
+                       }
 
                        if (p.hasOpt()) {
                                inner_pos = p.getArg('[', ']');
@@ -839,7 +849,7 @@ void parse_box(Parser & p, ostream & os, unsigned 
outer_flags,
                        if (!opt.empty()) {
                                hor_pos = opt;
                                if (hor_pos != "l" && hor_pos != "c" &&
-                                   hor_pos != "r") {
+                                   hor_pos != "r" && hor_pos != "s") {
                                        cerr << "invalid hor_pos " << hor_pos
                                             << " for " << outer_type << endl;
                                        hor_pos = "c";

-----------------------------------------------------------------------

Summary of changes:
 src/tex2lyx/test/test.lyx.lyx |    2 +-
 src/tex2lyx/text.cpp          |   16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to