<div dir="ltr">Hi Huw,<div><br></div><div>Is this the right way?</div><div>Testbot result: <a href="https://testbot.winehq.org/JobDetails.pl?Key=8030">https://testbot.winehq.org/JobDetails.pl?Key=8030</a></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">2014-07-16 19:44 GMT+08:00 Huw Davies <span dir="ltr"><<a href="mailto:huw@codeweavers.com" target="_blank">huw@codeweavers.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="">On 15 Jul 2014, at 14:43, Jactry Zeng wrote:<br>
2014-07-15 21:29 GMT+08:00 Huw Davies <<a href="mailto:huw@codeweavers.com">huw@codeweavers.com</a>>:<br>
> ><br>
> > Can you at least point to a test that shows this bug?<br>
><br>
> Do you mean tests about bug of S/GetSelection?<br>
> It seem is a known bug:<br>
> <a href="http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/riched20/tests/editor.c#l4366" target="_blank">http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/riched20/tests/editor.c#l4366</a><br>
<br>
</div>Yes.  So adding a special case to SetSelection should fix this.<br>
<br>
'to' is already setup correctly to len+1, so the problem is<br>
adjusting cursors[0].  MoveCursorChars is clamping the<br>
cursor to len.<br>
<br>
So you have two options, either alter MoveCursorChars<br>
to allow it to move to len + 1. You'd need to retain the current<br>
behaviour in some circumstances though (such as moving<br>
to the right on right-arrow keys press), so you'd need to pass<br>
a flag or something.<br>
<br>
Option 2 is just the modify cursor[0] in SetSelection.  If this<br>
is the only place where one can select the final EOP, then<br>
this is probably the preferred solution.<br>
<br>
Either way, you probably need to change the 'middle of<br>
end paragraph run' fix up for cursor[0] at the end of<br>
SetSelection (probably by setting nOffset = run.len).<br>
<br>
Having done this, check the tests still work (and the<br>
todos are fixed). Also play with wordpad for a while<br>
to see it behaves correctly.<br>
<br>
Does that make sense?<br>
<span class="HOEnZb"><font color="#888888"><br>
Huw.<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div>
</div>