On Tue, Jul 22, 2014 at 06:11:07PM +0800, Jactry Zeng wrote:
dlls/riched20/richole.c | 13 +++++++++-- dlls/riched20/tests/richole.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-)
Before you start implementing the ITextSelection methods, have you thought about how the ITextRange returned by ITextDocument::GetStoryRanges would work?
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.
Huw.
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 Model didn't implement ITextDocument::GetStoryRanges.[0]
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.
I would like to write some helper functions(such as ME_ITextGetText and ME_ITextGetChar) and share them between ITextSelection and ITextRange. https://github.com/Jactry/wine/commit/91e4f9f1510cb71c3c5afe4bf9e4bc8cb6b438...
What ITextSelection is different to ITextRange is range of ITextSelection is changeful. Every time we 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 of ITextSelection every time we call ITextSelection::XXX(). https://github.com/Jactry/wine/commit/6932adce0d97c3ddbbe737230694444b26b047...
Is this a right way?
Thanks for your comment!
[0] http://msdn.microsoft.com/en-us/library/windows/desktop/bb774062(v=vs.85).as...
2014-07-23 14:57 GMT+08:00 Jactry Zeng jactry92@gmail.com:
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 Model didn't implement ITextDocument::GetStoryRanges.[0]
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.
I would like to write some helper functions(such as ME_ITextGetText and ME_ITextGetChar) and share them between ITextSelection and ITextRange.
https://github.com/Jactry/wine/commit/91e4f9f1510cb71c3c5afe4bf9e4bc8cb6b438...
What ITextSelection is different to ITextRange is range of ITextSelection is changeful. Every time we 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 of ITextSelection every time we call ITextSelection::XXX().
https://github.com/Jactry/wine/commit/6932adce0d97c3ddbbe737230694444b26b047...
Is this a right way?
Thanks for your comment!
Regards, Jactry Zeng
On 23 Jul 2014, at 07:57, Jactry Zeng wrote:
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 Model didn't implement ITextDocument::GetStoryRanges.[0]
Yes, sorry, I meant ITextDocument:Range.
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.
I would like to write some helper functions(such as ME_ITextGetText and ME_ITextGetChar) and share them between ITextSelection and ITextRange. https://github.com/Jactry/wine/commit/91e4f9f1510cb71c3c5afe4bf9e4bc8cb6b438...
Using helpers is fine too. Though I don't like the name, range_GetText might be better.
Huw.
2014-07-23 17:15 GMT+08:00 Huw Davies huw@codeweavers.com:
Using helpers is fine too. Though I don't like the name, range_GetText
might be better.
I have sent a newer version.
Thanks again!