<div dir="ltr"><div>Hi,</div><div><br></div><div>Thanks for your reply.</div><div>I am not sure if my understanding is right or not...</div><div><br></div><div>+    ME_GetSelection(This->reOle->editor, &start, &end);</div>

<div>+    nChars = ME_GetCursorOfs(end) - ME_GetCursorOfs(start);</div><div>+    bEOP = (end->pRun->type == diTextEnd);</div>
<div><br></div><div>Here I would like to use ME_GetSelection() to get the end of the selection range. And than judge if it is</div><div>the end of the text buffer and pass bEOP into ME_GetTextW.</div><div>If bEOP is true, ME_GetTextW will append a '\r' in the end of the return string.</div>

<div>But because of bug of ME_GetSelection/ME_SetSelection, I can't got a ME_Cursor of the end of the text buffer.<br></div><div><br></div><div><br></div>
















</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-15 17:23 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 02:18, Jactry Zeng wrote:<br>
> But because of bug of EM_SETSEL or EM_GETSEL, this feature<br>
> still cannot be implemented completely.<br>
> For example:<br>
> When the text in Rich Edit control is: "TestSomeText"<br>
>                                                        01234567890123<br>
> We cannot distinguish between SendMessageA(w, EM_SETSEL, 0, 12) and SendMessageA(w, EM_SETSEL, 0, 13).<br>
> Attachment is the patch, I just added wine_todo for failed tests cause by this bug.<br>
> But I still have no idea about fixing this bug. Could you give me some suggestion?<br>
> Or just mark them as todo now is OK?<br>
<br>
</div>Do you fully understand this bug yet?  In other words under what conditions does the current implementation fail?<br>
It should be trivial to fix up ME_SetSelection().<br>
<span class="HOEnZb"><font color="#888888"><br>
Huw.<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>