Jean-Marc Lasgouttes wrote:
> If special code is needed, what about putting it in
> InsetTabular::dispatch, or in some other InsetTabular method?

The attached patch might be more at your goût.

Jürgen
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.313
diff -p -u -r1.313 text3.C
--- text3.C	13 Oct 2005 14:48:27 -0000	1.313
+++ text3.C	13 Oct 2005 18:19:11 -0000
@@ -754,12 +754,19 @@ void LyXText::dispatch(LCursor & cur, Fu
 		break;
 
 	case LFUN_NEXT_INSET_TOGGLE: {
+		FuncRequest fr = cmd;
+		fr.action = LFUN_INSET_TOGGLE;
 		InsetBase * inset = cur.nextInset();
 		if (inset) {
-			cur.clearSelection();
-			FuncRequest fr = cmd;
-			fr.action = LFUN_INSET_TOGGLE;
+			cur.clearSelection();	
 			inset->dispatch(cur, fr);
+		} else {
+			inset = &cur.inset();
+			if (inset) {
+				inset->dispatch(cur, fr);
+				if (inset = cur.nextInset())
+					cur.posRight();
+			}
 		}
 		break;
 	}
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.489
diff -p -u -r1.489 insettabular.C
--- insets/insettabular.C	19 Sep 2005 14:38:13 -0000	1.489
+++ insets/insettabular.C	13 Oct 2005 18:19:17 -0000
@@ -744,6 +744,14 @@ void InsetTabular::doDispatch(LCursor & 
 		cell(cur.idx())->dispatch(cur, cmd);
 		break;
 
+	case LFUN_INSET_TOGGLE: {
+		InsetBase * inset = &cur.inset();
+		// we might be in a collapsable in front of the table
+		if (inset && inset != this)
+			inset->dispatch(cur, cmd);
+		break;
+	}
+
 	case LFUN_EMPH:
 	case LFUN_BOLD:
 	case LFUN_ROMAN:

Reply via email to