leuven edwin wrote:

> patch attached. copy pasting from abdel's. cannot test it here (1.5 does
> not build with cmake for me), perhaps someone else can...

OK, this compiles. However, I wonder why we need to introduce
selIsMultiCell() in Cursor. Tabular::tablemode gives us the same
information. See attached patch.

It works for me, but I'd appreciate some testing before putting it into
branch.

Jürgen
Index: src/insets/InsetTabular.cpp
===================================================================
--- src/insets/InsetTabular.cpp	(Revision 26674)
+++ src/insets/InsetTabular.cpp	(Arbeitskopie)
@@ -3235,6 +3235,10 @@
 				setCursorFromCoordinates(cur, cmd.x, cmd.y);
 				bvcur.setCursor(cur);
 				bvcur.selection() = true;
+	  			if (tablemode(bvcur)) {
+	 				bvcur.pit() = bvcur.lastpit();
+	 				bvcur.pos() = bvcur.lastpos();
+	  			}
 			} else
 				cur.undispatched();
 		}
@@ -3301,6 +3305,11 @@
 			cmd = FuncRequest(LFUN_FINISHED_RIGHT);
 			cur.undispatched();
 		}
+		if (tablemode(cur)) {
+			cur.pit() = cur.lastpit();
+			cur.pos() = cur.lastpos();
+			return;
+		}
 		break;
 
 	case LFUN_UP_SELECT:
@@ -3324,6 +3333,11 @@
 			cmd = FuncRequest(LFUN_UP);
 			cur.undispatched();
 		}
+		if (tablemode(cur)) {
+			cur.pit() = cur.lastpit();
+			cur.pos() = cur.lastpos();
+			return;
+		}
 		break;
 
 //	case LFUN_SCREEN_DOWN: {
@@ -3415,6 +3429,14 @@
 			cell(cur.idx())->dispatch(cur, cmd);
 		break;
 
+	case LFUN_SELF_INSERT:
+		if (tablemode(cur)) {
+			recordUndoInset(cur, Undo::DELETE);
+			cutSelection(cur);
+		}
+		cell(cur.idx())->dispatch(cur, cmd);
+		break;
+
 	case LFUN_COPY:
 		if (!cur.selection())
 			break;
@@ -4003,6 +4025,16 @@
 			return;
 		++cur.idx();
 	}
+ 
+ 	cur.boundary(false);
+ 
+ 	if (tablemode(cur)) {
+ 		cur.pit() = cur.lastpit();
+ 		cur.pos() = cur.lastpos();
+ 		resetPos(cur);
+ 		return;
+ 	}
+
 	cur.pit() = 0;
 	cur.pos() = 0;
 	resetPos(cur);
@@ -4028,6 +4060,14 @@
 			return;
 		--cur.idx();
 	}
+
+	if (tablemode(cur)) {
+		cur.pit() = cur.lastpit();
+		cur.pos() = cur.lastpos();
+		resetPos(cur);
+		return;
+	}
+
 	cur.pit() = cur.lastpit();
 	cur.pos() = cur.lastpos();
 

Reply via email to