>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:

Georg> This is a hack that will bite later. getChar is supposed to
Georg> return the contents of an inset if it can be represented as a
Georg> single character, not some arbitrary character. 

I think I agree.

Georg> What you really want to know is "Can the cursor descend into
Georg> this inset?" We have InsetBase::editable() that exactly answers
Georg> this question, the only disadvantage is that this is not
Georg> implemented in mathed yet.

Yes.

Georg> The attached patch implements that and works for me as well.
Georg> What needs to be done if this should go in is to check for side
Georg> effects everywhere where editable() is used (fortunately only ~
Georg> 3 places), and better testing, but I think that this approach
Georg> is prefereable to the getChar hack.

Only MathNestInset needs this. All the others (including
MathHullInset) derive from that. Actually, you can just check for
asNestInset. 

The following works for me.

JMarc

Index: src/mathed/math_data.C
===================================================================
--- src/mathed/math_data.C	(revision 13268)
+++ src/mathed/math_data.C	(working copy)
@@ -393,7 +393,7 @@
 #endif
 	if (it != begin()) {
 		--it;
-		if (it < end() && (*it)->getChar())
+		if (it < end() && !(*it)->asNestInset())
 			++it;
 	}
 

Reply via email to