Rebase against dedbd1883611b1c72abeb05d9f93cd5ac8af2e90.

This commit is contained in:
Sebastian Lackner
2015-06-16 22:35:05 +02:00
parent 50b37c2d7e
commit 0bef3b01c4
6 changed files with 55 additions and 186 deletions

View File

@@ -1,18 +1,18 @@
From 4cbf20d7de172a442808f0c9a78d360ea2e57e5b Mon Sep 17 00:00:00 2001
From 1d213a01d28a273c2b1b46dac6b606864cc88321 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Wed, 13 Aug 2014 17:17:14 +0800
Subject: riched20: Implement ITextRange::SetRange.
---
dlls/riched20/richole.c | 42 +++++++++++++++++++++++++-----------------
dlls/riched20/richole.c | 41 +++++++++++++++++++++++++----------------
dlls/riched20/tests/richole.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 17 deletions(-)
2 files changed, 60 insertions(+), 16 deletions(-)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index c309292..8aea23e 100644
index cc1a3c9..e432c79 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -1990,14 +1990,36 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG Unit, LONG Inde
@@ -2003,6 +2003,23 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG unit, LONG inde
return E_NOTIMPL;
}
@@ -33,25 +33,25 @@ index c309292..8aea23e 100644
+ *cp1 = *cp2 = len - 1;
+}
+
static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG cpActive, LONG cpOther)
static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG active)
{
ITextRangeImpl *This = impl_from_ITextRange(me);
@@ -2012,7 +2029,13 @@ static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG ac
if (!This->child.reole)
return CO_E_RELEASED;
- FIXME("not implemented %p\n", This);
- return E_NOTIMPL;
+ cp2range(This->child.reole->editor, &cpActive, &cpOther);
+ if (cpActive == This->start && cpOther == This->end)
+ cp2range(This->child.reole->editor, &anchor, &active);
+ if (anchor == This->start && active == This->end)
+ return S_FALSE;
+
+ This->start = cpActive;
+ This->end = cpOther;
+ This->start = anchor;
+ This->end = active;
+ return S_OK;
}
static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *ret)
@@ -4198,26 +4220,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2,
@@ -4263,26 +4286,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2,
ITextRange** ppRange)
{
IRichEditOleImpl *This = impl_from_ITextDocument(me);
@@ -133,5 +133,5 @@ index 051d9fe..6e00b21 100644
test_IOleWindow_GetWindow();
test_IOleInPlaceSite_GetWindow();
--
2.4.2
2.4.3