2014-07-16 19:44 GMT+08:00 Huw Davies <huw@codeweavers.com>: > > Yes. So adding a special case to SetSelection should fix this.
> > 'to' is already setup correctly to len+1, so the problem is > adjusting cursors[0]. MoveCursorChars is clamping the > cursor to len. > > So you have two options, either alter MoveCursorChars
> to allow it to move to len + 1. You'd need to retain the current > behaviour in some circumstances though (such as moving > to the right on right-arrow keys press), so you'd need to pass > a flag or something.
> > Option 2 is just the modify cursor[0] in SetSelection. If this > is the only place where one can select the final EOP, then > this is probably the preferred solution. > > Either way, you probably need to change the 'middle of
> end paragraph run' fix up for cursor[0] at the end of > SetSelection (probably by setting nOffset = run.len). > > Having done this, check the tests still work (and the > todos are fixed). Also play with wordpad for a while
> to see it behaves correctly. > > Does that make sense?