This is not totally fair. The fact is, it's implementing a well- known, standard, function. To understand it, you probably have to read up on the Bidi algorithm (I've never done it thoroughly, I don't know this code, either, and have been trying to avoid it as much as possible, partly for the reasons you've stated ;) ). But, the fact is that it works, I've yet to see a problem which is due to the heart of the bidi algorithm. (Do you think you have found one, now?)

Yes, more or less. We have two bidi algorithms at the moment. One is inside the Bidi class, the other one in the font setting of Text. They differ, that's the problem. It gives different behavior with asking the font of a position whether it is RTL, and with asking the Bidi class. This happens if you have spaces at the start or beginning of a direction change.

If you find yourself wanting to change things inside it, then chances are that's not the right way to go about it; unless you purposely want to change things from the standard bidi behavior (which I actually think I may want to do, in order to fix the "GUI- backend bidi mismatch" --- I'm not sure it's such a great idea, though). But then that should be done very carefully...

I assume a lot of the deficiencies you describe are due to the fact that the code is really old, I once started trying to trace something in there back, and reached the days when a lot of different parts of LyX were still all in text.C, or whatever it was called then, and finally gave up. And I suspect that people were hesitant about playing around with it later, given that they didn't understand it... And when changes were made, I'm not sure they were always for the better...

My comments mainly were about how things are spread all over the code and the lack of comments. If there is a member variable bidi, which is even public, there should be a good reason for it. Moreover it is changed and accessed from positions so far apart. You remember the bug where we didn't do the computeTable call on the bidi object for the right line and got a crash. It's just hard to keep track of all the places in the code which have to keep a consistent bidi object.

All that said, I must reiterate again: I don't know this code, either...

Didn't want to critisize you, sorry it sounded like that.
Let's improve the mentioned problems for 1.6.

Stefan

Attachment: PGP.sig
Description: Signierter Teil der Nachricht

Reply via email to