<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">Hello Huw,</div>2014-07-03 17:34 GMT+08:00 Huw Davies <<a href="mailto:huw@codeweavers.com" target="_blank">huw@codeweavers.com</a>>:<br>> > +    if (!*pbstr)<br>



> > +        return E_OUTOFMEMORY;<br>> > +    /* FIXME: a '\r' should be appended at the end of a story */<br>> > +    ME_GetTextW(This->reOle->editor, *pbstr, nChars, start, nChars, 0);<br>



><br>> Actually, perhaps you could fix the FIXME. GetTextW already has the ability<br>> to add \r\n, so extending this to add just \r shouldn't be too difficult.<br>></div><div class="gmail_extra"><br></div>



<div class="gmail_extra"><div class="gmail_extra">Thanks for your review first!</div><div class="gmail_extra"><br></div><div class="gmail_extra">A few weeks ago, I have made some tests about this problem. And it seem is an unimplement feature of Rich edit control and should not be fixed in ME_GetTextW or ITextSeletction::GetText simply:</div>



<div class="gmail_extra"><br></div><div class="gmail_extra">1. end-of-story is different from end-of-paragraph</div><div class="gmail_extra">From document of ITextDocument::GetStoryCount: Rich edit controls have only one story.[1]</div>



<div class="gmail_extra">So ‘story’ may is an unit like 'paragraph' in Rich edit control. We may need add a MERF_ENDSTORY to implement it.[2]</div><div class="gmail_extra"><br></div><div class="gmail_extra">2. What does the end-of-story looks like?</div>



<div class="gmail_extra">When we run the wordpad with native riched20, we can use ‘ctrl + shitf + →’ to select the ‘space’ at the end of the Rich edit control. But we cannot set the cursor behind it.(a picture here[3])</div>



<div class="gmail_extra">And wine’s riched20 didn’t implement this ‘space’. This 'space' may is the end-of-story.</div><div class="gmail_extra"><br></div><div class="gmail_extra">A crash will happen when we copy the ‘space’ from a native Rich edit control to a builtin one.(backtrace.txt[4])</div>



<div class="gmail_extra"><br></div><div class="gmail_extra">BTW, there is a know bug of EM_SETSEL: cannot select the last character of Rich edit control.[5]</div><div class="gmail_extra"><br></div><div class="gmail_extra">



3.</div><div class="gmail_extra">From the last paragraph of this blog: <a href="http://blogs.msdn.com/b/murrays/archive/2008/11/22/paragraphs-and-paragraph-formatting.aspx" target="_blank">http://blogs.msdn.com/b/murrays/archive/2008/11/22/paragraphs-and-paragraph-formatting.aspx</a></div>



<div class="gmail_extra">It is sure there is a final EOP in a Rich edit control.</div><div class="gmail_extra"><br></div><div class="gmail_extra">There seems to be every indication that we should implement the final EOP of Rich edit control rather than just append a ‘\r’ in ITextSelection::GetText.</div>



</div><div class="gmail_extra">So I just let a FIXME comment there. I am not sure if I am right. </div><div class="gmail_extra">Do you have any suggestion?<br></div><div class="gmail_extra"><br>> Also, in the tests, you leak the BSTRs.<br>


></div><div class="gmail_extra">Thanks again.</div><div class="gmail_extra">
<br>> Huw.<br>><br>><br><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div>
</div></div>