<div dir="ltr"><div class="gmail_extra">Hi,</div><div class="gmail_extra">2014-07-22 18:36 GMT+08:00 Huw Davies <<a href="mailto:huw@codeweavers.com" target="_blank">huw@codeweavers.com</a>>:<br>><br>> Before you start implementing the ITextSelection methods, have you<br>





> thought about how the ITextRange returned by<br>> ITextDocument::GetStoryRanges would work?<br>></div><div class="gmail_extra"><br></div><div class="gmail_extra">Do you mean ITextRange returned by ITextDocument::Range?</div>



<div class="gmail_extra">
ITextRange is returned by ITextDocument::Range and MS's Text Object Model</div><div class="gmail_extra">didn't implement ITextDocument::GetStoryRanges.[0]</div><div class="gmail_extra"><br>> It seems to me it would be useful to have a text range object that<br>




> could be used by both, rather than implementing two lots of<br>> ITextRange methods.<br><br>I would like to write some helper functions(such as ME_ITextGetText and ME_ITextGetChar)</div><div class="gmail_extra">and share them between ITextSelection and ITextRange.<br>


<a href="https://github.com/Jactry/wine/commit/91e4f9f1510cb71c3c5afe4bf9e4bc8cb6b4388f#diff-7422359fbc8e3da5f16777ae7e94ce42R2524" target="_blank">https://github.com/Jactry/wine/commit/91e4f9f1510cb71c3c5afe4bf9e4bc8cb6b4388f#diff-7422359fbc8e3da5f16777ae7e94ce42R2524</a><br clear="all">




<div><br></div><div>What ITextSelection is different to ITextRange is range of ITextSelection is changeful. Every time</div><div>we call ITextSelection::XXXX() a new range may be returned.</div><div>So I saved range of ITextRange in ITextRangeImpl. And just calling ME_GetSelection to get range of </div>


<div>ITextSelection every time we call ITextSelection::XXX().</div><div><a href="https://github.com/Jactry/wine/commit/6932adce0d97c3ddbbe737230694444b26b0473e#diff-7422359fbc8e3da5f16777ae7e94ce42R64" target="_blank">https://github.com/Jactry/wine/commit/6932adce0d97c3ddbbe737230694444b26b0473e#diff-7422359fbc8e3da5f16777ae7e94ce42R64</a><br>


</div><div><br></div><div>Is this a right way?</div><div><br></div><div>Thanks for your comment!</div>-- <br><div dir="ltr"><div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div>
</div></div>