The attached patch seems to put multicolumn handling into a workable state 
again. Is it really that simple? I would appreciate it if somebody could 
answer the FIXME question.


Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/ChangeLog lyx-1.4-cvs/src/insets/ChangeLog
--- lyx-1.4-clean/src/insets/ChangeLog	2004-11-23 09:17:43.000000000 +0100
+++ lyx-1.4-cvs/src/insets/ChangeLog	2004-11-23 20:44:11.000000000 +0100
@@ -1,3 +1,7 @@
+2004-11-23  Georg Baum  <[EMAIL PROTECTED]>
+
+	* insettabular.C (tabularFeatures): fix multicolumn handling
+
 2004-11-16  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* insetoptarg.C (latexOptional): return number of lines instead of
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/insettabular.C lyx-1.4-cvs/src/insets/insettabular.C
--- lyx-1.4-clean/src/insets/insettabular.C	2004-11-18 13:54:00.000000000 +0100
+++ lyx-1.4-cvs/src/insets/insettabular.C	2004-11-23 20:42:43.000000000 +0100
@@ -1326,10 +1333,9 @@ void InsetTabular::tabularFeatures(LCurs
 				   _("You cannot set multicolumn vertically."));
 			return;
 		}
-#if 0
-		// just multicol for one Single Cell
-		if (!hasSelection()) {
-			// check whether we are completly in a multicol
+		if (!cur.selection()) {
+			// just multicol for one single cell
+			// check whether we are completely in a multicol
 			if (tabular.isMultiColumn(cur.idx()))
 				tabular.unsetMultiColumn(cur.idx());
 			else
@@ -1341,6 +1347,12 @@ void InsetTabular::tabularFeatures(LCurs
 		int s_start;
 		int s_end;
 
+		CursorSlice::idx_type const sel_cell_start = cur.selBegin().idx();
+		CursorSlice::idx_type const sel_cell_end = cur.selEnd().idx();
+		// FIXME: Is this really necessary?
+		// I would think that 
+		// sel_cell_start > sel_cell_end
+		// is always false. (gb 2004-11-23)
 		if (sel_cell_start > sel_cell_end) {
 			s_start = sel_cell_end;
 			s_end = sel_cell_start;
@@ -1352,7 +1364,6 @@ void InsetTabular::tabularFeatures(LCurs
 		cur.idx() = s_start;
 		cur.par() = 0;
 		cur.pos() = 0;
-#endif
 		cur.selection() = false;
 		break;
 	}

Reply via email to