Hi,2014-07-22 18:36 GMT+08:00 Huw Davies <huw@codeweavers.com>:
>
> Before you start implementing the ITextSelection methods, have you
> thought about how the ITextRange returned by
> ITextDocument::GetStoryRanges would work?
>Do you mean ITextRange returned by ITextDocument::Range?ITextRange is returned by ITextDocument::Range and MS's Text Object Modeldidn't implement ITextDocument::GetStoryRanges.[0]I would like to write some helper functions(such as ME_ITextGetText and ME_ITextGetChar)
> It seems to me it would be useful to have a text range object that
> could be used by both, rather than implementing two lots of
> ITextRange methods.and share them between ITextSelection and ITextRange.
https://github.com/Jactry/wine/commit/91e4f9f1510cb71c3c5afe4bf9e4bc8cb6b4388f#diff-7422359fbc8e3da5f16777ae7e94ce42R2524
What ITextSelection is different to ITextRange is range of ITextSelection is changeful. Every timewe call ITextSelection::XXXX() a new range may be returned.So I saved range of ITextRange in ITextRangeImpl. And just calling ME_GetSelection to get range ofITextSelection every time we call ITextSelection::XXX().Is this a right way?Thanks for your comment!--Regards,Jactry Zeng