On Sat, Feb 25, 2006 at 04:47:31PM +0100, Juergen Spitzmueller wrote: > Also sprach Joost Verburg: > > The main problem is that the math panel doesn't work. Try to insert one > > of the mathbb symbols using the math panel and you get an empty inset > > instead of the symbol. > > I know, I can reproduce that. I just wanted to point out that the bug is IMHO > the same as the one for text->math conversion, viz.a broken LFUN_INSERT_MATH.
I found the reason for the bug, and the story is not pretty. First of all, the bug is unrelated to text->math conversion. You should look at ControlMath.C. There, the command texts associated with each symbol in the math symbol panels, executed when clicking on them, are defined. For blackboard bold R (real numbers) we have "\\mathbb R". When you inspect the code handling this, more precisely ControlMath::dispatchInsert, you see that there is no handling taking place. And in math_nestinset's INSERT_MATH code, the R is silently dropped. I have a vivid recollection that there was code handling this kind of command string. Splitting up the string and submitting the two separately to dispatchFunc. Moreover, I have a strong recollection that I wrote both this code and introduced the command syntax it handles... Angus is marked as being to 'blame' for this part of the code, but that proves little for deletion of code. Somebody decided to do a little clean-up job on code he didn't understand... nice. The eerily familiar looking, reconstructed code that fixes the bug is attached. - Martin
Index: ControlMath.C =================================================================== --- ControlMath.C (revision 13276) +++ ControlMath.C (working copy) @@ -43,7 +43,16 @@ void ControlMath::dispatchInsert(string const & name) const { - dispatchFunc(LFUN_INSERT_MATH, '\\' + name); + // Split name if it contains blank, to handle command strings like + // mathbb R for blackboard bold R: + string::size_type blank = name.find(' '); + if (blank != string::npos) { + string name1 = name.substr(0, blank); + string name2 = name.substr(blank + 1); + dispatchFunc(LFUN_INSERT_MATH, '\\' + name1); + dispatchFunc(LFUN_INSERT_MATH, name2); + } else + dispatchFunc(LFUN_INSERT_MATH, '\\' + name); }
pgp8DewP0iO6t.pgp
Description: PGP signature