See attached. As a bonus it removes an ugly piece of special coding.

Georg, are you working on this? I remember seeing a post to that effect
but cannot find it.

- Martin

Index: tabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/tabular.C,v
retrieving revision 1.221
diff -u -r1.221 tabular.C
--- tabular.C	27 Jan 2005 21:05:33 -0000	1.221
+++ tabular.C	18 Feb 2005 14:26:23 -0000
@@ -625,14 +625,8 @@
 {
 	if (!onlycolumn && isMultiColumn(cell) &&
 		(isFirstCellInRow(cell) || isMultiColumn(cell-1)))
-	{
-		if (cellinfo_of_cell(cell).align_special.empty())
-			return cellinfo_of_cell(cell).left_line;
-		return prefixIs(ltrim(cellinfo_of_cell(cell).align_special), "|");
-	}
-	if (column_info[column_of_cell(cell)].align_special.empty())
-		return column_info[column_of_cell(cell)].left_line;
-	return prefixIs(ltrim(column_info[column_of_cell(cell)].align_special), "|");
+		return cellinfo_of_cell(cell).left_line;
+	return column_info[column_of_cell(cell)].left_line;
 }
 
 
@@ -640,14 +634,8 @@
 {
 	if (!onlycolumn && isMultiColumn(cell) &&
 		(isLastCellInRow(cell) || isMultiColumn(cell + 1)))
-	{
-		if (cellinfo_of_cell(cell).align_special.empty())
-			return cellinfo_of_cell(cell).right_line;
-		return suffixIs(rtrim(cellinfo_of_cell(cell).align_special), "|");
-	}
-	if (column_info[column_of_cell(cell)].align_special.empty())
-		return column_info[right_column_of_cell(cell)].right_line;
-	return suffixIs(rtrim(column_info[column_of_cell(cell)].align_special), "|");
+		return cellinfo_of_cell(cell).right_line;
+	return column_info[right_column_of_cell(cell)].right_line;
 }
 
 
@@ -2016,59 +2004,59 @@
 	else
 		os << "\\begin{tabular}{";
 	for (col_type i = 0; i < columns_; ++i) {
-		if (!column_info[i].align_special.empty()) {
-			os << column_info[i].align_special;
-		} else {
-			if (column_info[i].left_line)
-				os << '|';
-			if (!column_info[i].p_width.zero()) {
-				switch (column_info[i].alignment) {
-				case LYX_ALIGN_LEFT:
-					os << ">{\\raggedright}";
-					break;
-				case LYX_ALIGN_RIGHT:
-					os << ">{\\raggedleft}";
-					break;
-				case LYX_ALIGN_CENTER:
-					os << ">{\\centering}";
-					break;
-				case LYX_ALIGN_NONE:
-				case LYX_ALIGN_BLOCK:
-				case LYX_ALIGN_LAYOUT:
-				case LYX_ALIGN_SPECIAL:
-					break;
-				}
+		if (column_info[i].left_line)
+			os << '|';
+		if (!column_info[i].p_width.zero()) {
+			switch (column_info[i].alignment) {
+			case LYX_ALIGN_LEFT:
+				os << ">{\\raggedright}";
+				break;
+			case LYX_ALIGN_RIGHT:
+				os << ">{\\raggedleft}";
+				break;
+			case LYX_ALIGN_CENTER:
+				os << ">{\\centering}";
+				break;
+			case LYX_ALIGN_NONE:
+			case LYX_ALIGN_BLOCK:
+			case LYX_ALIGN_LAYOUT:
+			case LYX_ALIGN_SPECIAL:
+				break;
+			}
 
-				switch (column_info[i].valignment) {
-				case LYX_VALIGN_TOP:
-					os << 'p';
-					break;
-				case LYX_VALIGN_MIDDLE:
-					os << 'm';
-					break;
-				case LYX_VALIGN_BOTTOM:
-					os << 'b';
-					break;
+			switch (column_info[i].valignment) {
+			case LYX_VALIGN_TOP:
+				os << 'p';
+				break;
+			case LYX_VALIGN_MIDDLE:
+				os << 'm';
+				break;
+			case LYX_VALIGN_BOTTOM:
+				os << 'b';
+				break;
+		}
+			os << '{'
+			   << column_info[i].p_width.asLatexString()
+			   << '}';
+		} else {
+			// Latex string *in addition* to |, lcr:
+			if (!column_info[i].align_special.empty()) {
+				os << column_info[i].align_special;
 			}
-				os << '{'
-				   << column_info[i].p_width.asLatexString()
-				   << '}';
-			} else {
-				switch (column_info[i].alignment) {
-				case LYX_ALIGN_LEFT:
-					os << 'l';
-					break;
-				case LYX_ALIGN_RIGHT:
-					os << 'r';
-					break;
-				default:
-					os << 'c';
-					break;
-				}
+			switch (column_info[i].alignment) {
+			case LYX_ALIGN_LEFT:
+				os << 'l';
+				break;
+			case LYX_ALIGN_RIGHT:
+				os << 'r';
+				break;
+			default:
+				os << 'c';
+				break;
 			}
-			if (column_info[i].right_line)
-				os << '|';
 		}
+		if (column_info[i].right_line)
+			os << '|';
 	}
 	os << "}\n";
 	++ret;

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to