The attached patch for trunk fixes
http://bugzilla.lyx.org/show_bug.cgi?id=2504

http://bugzilla.lyx.org/show_bug.cgi?id=2504#c7
describes what the patch is for.

Jürgen, can this also go into branch?

regards Uwe
Index: text.cpp
===================================================================
--- text.cpp	(revision 24220)
+++ text.cpp	(working copy)
@@ -2345,6 +2345,43 @@
 
 		else if (t.cs() == "parbox")
 			parse_box(p, os, FLAG_ITEM, outer, context, true);
+		
+		//\makebox() is part of the picture environment and different from \makebox{}
+		//\makebox{} will be parsed by parse_box when bug 2956 is fixed
+		else if (t.cs() == "makebox") {
+			if (p.next_token().character() == '(') {
+				//the syntax is: \makebox(x,y)[position]{content}
+				//the content can be left as is, the rest is put into an ERT
+				p.get_token(); // eat '('
+				string xyposition;
+				xyposition = parse_text_snippet(p, FLAG_BRACK_LAST,
+					outer, context);
+				handle_ert(os, "\\makebox(" + xyposition + "]", context);
+			} else {
+				//the syntax is: \makebox[width][position]{content}
+				if (p.next_token().character() == '[') {
+					bool twoargs = false;
+					string width;
+					string position;
+					p.get_token(); // eat '['
+					width = parse_text_snippet(p, FLAG_BRACK_LAST,
+						outer, context);
+					if (p.next_token().character() == '[') {
+						twoargs = true;
+						p.get_token(); // eat '['
+						
+						position = parse_text_snippet(p, FLAG_BRACK_LAST,
+							outer, context);
+					}
+					if (twoargs)
+						handle_ert(os, "\\makebox[" + width + "][" + position + "]", context);
+					else
+						handle_ert(os, "\\makebox[" + width + "]", context);
+				} else if (p.next_token().character() == '{') {
+					handle_ert(os, "\\makebox", context);
+				}
+			}
+		}
 
 		else if (t.cs() == "smallskip" ||
 			 t.cs() == "medskip" ||

Reply via email to