As promised, here it is. This is the way to do it. It includes our former patch for cursorLeft/Right to avoid boundary magic on RTL- boundaries.

@Dov: For the example where your patch was wrong, make a selection, starting in an RTL paragraph, ending in a LTR paragraph. One of the two sides will "see" the correct RTL setting by looking at the buffer's cursor. The other one (the cursorX call for the anchor) will also look there, but the information in the buffer's cursor has no relation to the that position.

Stefan


Attachment: rtlcursorpos.patch
Description: Binary data


Am 30.05.2007 um 23:36 schrieb Stefan Schimanski:


Am 30.05.2007 um 23:29 schrieb Jean-Marc Lasgouttes:

"Dov" == Dov Feldstern <[EMAIL PROTECTED]> writes:

Dov> Please, could someone respond regarding this patch from Elazar?
Dov> It fixes issue (3) of
Dov> http://bugzilla.lyx.org/show_bug.cgi?id=3551, which is a
Dov> regression.

Dov> It works. The concept makes sense. The implementation -- well, we Dov> don't love it, but we haven't gotten any better suggestions. (The
Dov> question is: how to identify the difference between being "at an
Dov> inset" vs. "inside it".) It's safe --- at the very worst, it will
Dov> only affect bidi users.

I still have the nasty feeling that the correction could be done in
somewhere like coordOffset (bufferview_funcs.cpp), but since I do not
have the energy to actually research it, I think indeed that the patch
could be committed.

Actually, coordOffset is not good because it also handles non-text
insets.

I will make a clean patch tomorrow morning. It adds another return value to cursorPos which tell whether insets in deeper slices will be put to the left or right of the returned position. This will require of course a change in the signature of all the cursorPos implementations is needed. But that's trivial. coordOffset will use that then to compute the right cursor position. I think that that's the right way to implement it. Accessing the bufferview cursor is even wrong, e.g. for selection spanning from an RTL to an LTR paragraph (look at my other patch for a working RTL selection implementation).

If you can wait until tomorrow morning...

Stefan


Attachment: PGP.sig
Description: Signierter Teil der Nachricht

Reply via email to