Rebase against 78f74446b9806f63a27c2d643b8e29156b5bdcbe

This commit is contained in:
Alistair Leslie-Hughes
2019-06-11 08:44:55 +10:00
parent 5681cd5466
commit 9afb244a8e
11 changed files with 318 additions and 737 deletions

View File

@@ -1,172 +0,0 @@
From ad837ef7c71cdca27ce947100107bfe5c6982ff7 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Fri, 8 Aug 2014 21:32:57 +0800
Subject: [PATCH] riched20: Implement IText{Selection, Range}::Set{Start, End}.
---
dlls/riched20/tests/richole.c | 135 ++++++++++++++++++++++++++++++++++
1 file changed, 135 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 70646202f04..77f93a55c14 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -3808,6 +3808,137 @@ static void test_MoveEnd(void)
ITextRange_Release(range);
}
+static void test_ITextRange_SetStart(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextRange *txtRge = NULL;
+ HRESULT hres;
+ LONG first, lim, start, end;
+ static const CHAR test_text1[] = "TestSomeText";
+
+ create_interfaces(&w, &reOle, &txtDoc, NULL);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ first = 4, lim = 8;
+ ITextDocument_Range(txtDoc, first, lim, &txtRge);
+ hres = ITextRange_SetStart(txtRge, first);
+ ok(hres == S_FALSE, "ITextRange_SetStart\n");
+
+#define TEST_TXTRGE_SETSTART(cp, expected_start, expected_end) \
+ hres = ITextRange_SetStart(txtRge, cp); \
+ ok(hres == S_OK, "ITextRange_SetStart\n"); \
+ ITextRange_GetStart(txtRge, &start); \
+ ITextRange_GetEnd(txtRge, &end); \
+ ok(start == expected_start, "got wrong start value: %d\n", start); \
+ ok(end == expected_end, "got wrong end value: %d\n", end);
+
+ TEST_TXTRGE_SETSTART(2, 2, 8)
+ TEST_TXTRGE_SETSTART(-1, 0, 8)
+ TEST_TXTRGE_SETSTART(13, 12, 12)
+
+ release_interfaces(&w, &reOle, &txtDoc, NULL);
+}
+
+static void test_ITextRange_SetEnd(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextRange *txtRge = NULL;
+ HRESULT hres;
+ LONG first, lim, start, end;
+ static const CHAR test_text1[] = "TestSomeText";
+
+ create_interfaces(&w, &reOle, &txtDoc, NULL);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ first = 4, lim = 8;
+ ITextDocument_Range(txtDoc, first, lim, &txtRge);
+ hres = ITextRange_SetEnd(txtRge, lim);
+ ok(hres == S_FALSE, "ITextRange_SetEnd\n");
+
+#define TEST_TXTRGE_SETEND(cp, expected_start, expected_end) \
+ hres = ITextRange_SetEnd(txtRge, cp); \
+ ok(hres == S_OK, "ITextRange_SetEnd\n"); \
+ ITextRange_GetStart(txtRge, &start); \
+ ITextRange_GetEnd(txtRge, &end); \
+ ok(start == expected_start, "got wrong start value: %d\n", start); \
+ ok(end == expected_end, "got wrong end value: %d\n", end);
+
+ TEST_TXTRGE_SETEND(6, 4, 6)
+ TEST_TXTRGE_SETEND(14, 4, 13)
+ TEST_TXTRGE_SETEND(-1, 0, 0)
+
+ ITextRange_Release(txtRge);
+ release_interfaces(&w, &reOle, &txtDoc, NULL);
+}
+
+static void test_ITextSelection_SetStart(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextSelection *txtSel = NULL;
+ HRESULT hres;
+ LONG first, lim, start, end;
+ static const CHAR test_text1[] = "TestSomeText";
+
+ create_interfaces(&w, &reOle, &txtDoc, &txtSel);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ first = 4, lim = 8;
+ SendMessageA(w, EM_SETSEL, first, lim);
+ hres = ITextSelection_SetStart(txtSel, first);
+ ok(hres == S_FALSE, "ITextSelection_SetStart\n");
+
+#define TEST_TXTSEL_SETSTART(cp, expected_start, expected_end) \
+ hres = ITextSelection_SetStart(txtSel, cp); \
+ ok(hres == S_OK, "ITextSelection_SetStart\n"); \
+ SendMessageA(w, EM_GETSEL, (LPARAM)&start, (WPARAM)&end); \
+ ok(start == expected_start, "got wrong start value: %d\n", start); \
+ ok(end == expected_end, "got wrong end value: %d\n", end);
+
+ TEST_TXTSEL_SETSTART(2, 2, 8)
+ TEST_TXTSEL_SETSTART(-1, 0, 8)
+ TEST_TXTSEL_SETSTART(13, 12, 12)
+
+ release_interfaces(&w, &reOle, &txtDoc, &txtSel);
+}
+
+static void test_ITextSelection_SetEnd(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextSelection *txtSel = NULL;
+ HRESULT hres;
+ LONG first, lim, start, end;
+ static const CHAR test_text1[] = "TestSomeText";
+
+ create_interfaces(&w, &reOle, &txtDoc, &txtSel);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ first = 4, lim = 8;
+ SendMessageA(w, EM_SETSEL, first, lim);
+ hres = ITextSelection_SetEnd(txtSel, lim);
+ ok(hres == S_FALSE, "ITextSelection_SetEnd\n");
+
+#define TEST_TXTSEL_SETEND(cp, expected_start, expected_end) \
+ hres = ITextSelection_SetEnd(txtSel, cp); \
+ ok(hres == S_OK, "ITextSelection_SetEnd\n"); \
+ SendMessageA(w, EM_GETSEL, (LPARAM)&start, (WPARAM)&end); \
+ ok(start == expected_start, "got wrong start value: %d\n", start); \
+ ok(end == expected_end, "got wrong end value: %d\n", end);
+
+ TEST_TXTSEL_SETEND(6, 4, 6)
+ TEST_TXTSEL_SETEND(14, 4, 13)
+ TEST_TXTSEL_SETEND(-1, 0, 0)
+
+ release_interfaces(&w, &reOle, &txtDoc, &txtSel);
+}
+
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -3820,6 +3951,8 @@ START_TEST(richole)
test_GetText();
test_ITextSelection_GetChar();
test_ITextSelection_GetStart_GetEnd();
+ test_ITextSelection_SetStart();
+ test_ITextSelection_SetEnd();
test_ITextSelection_Collapse();
test_ITextDocument_Range();
test_ITextRange_GetChar();
@@ -3827,6 +3960,8 @@ START_TEST(richole)
test_ITextRange_GetStart_GetEnd();
test_ITextRange_SetRange();
test_ITextRange_GetDuplicate();
+ test_ITextRange_SetStart();
+ test_ITextRange_SetEnd();
test_ITextRange_Collapse();
test_GetClientSite();
test_IOleWindow_GetWindow();
--
2.20.1

View File

@@ -1,191 +0,0 @@
From c1711e301579aa2469cad8b0d3ba5567edc4611b Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Mon, 11 Aug 2014 13:51:55 +0800
Subject: riched20: Stub for ITextFont interface and implement
ITextRange::GetFont and ITextSelection::GetFont.
---
dlls/riched20/richole.c | 20 ++++++++++
dlls/riched20/tests/richole.c | 93 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 1013e67..9e7d853 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -2654,6 +2654,10 @@ static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
FIXME("(%p)->(%p): stub\n", This, pFont);
+
+ if (This->range && !get_range_reole(This->range))
+ return CO_E_RELEASED;
+
return E_NOTIMPL;
}
@@ -2661,6 +2665,10 @@ static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
FIXME("(%p)->(%p): stub\n", This, ret);
+
+ if (This->range && !get_range_reole(This->range))
+ return CO_E_RELEASED;
+
return E_NOTIMPL;
}
@@ -2668,6 +2676,10 @@ static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG *
{
ITextFontImpl *This = impl_from_ITextFont(iface);
FIXME("(%p)->(%p %p): stub\n", This, font, ret);
+
+ if (This->range && !get_range_reole(This->range))
+ return CO_E_RELEASED;
+
return E_NOTIMPL;
}
@@ -2841,6 +2853,10 @@ static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
FIXME("(%p)->(%p): stub\n", This, value);
+
+ if (This->range && !get_range_reole(This->range))
+ return CO_E_RELEASED;
+
return E_NOTIMPL;
}
@@ -2848,6 +2864,10 @@ static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
FIXME("(%p)->(%d): stub\n", This, value);
+
+ if (This->range && !get_range_reole(This->range))
+ return CO_E_RELEASED;
+
return E_NOTIMPL;
}
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 8047f4b..851ae9a 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -3528,6 +3528,97 @@ static void test_ITextSelection_SetEnd(void)
release_interfaces(&w, &reOle, &txtDoc, &txtSel);
}
+static void test_ITextRange_GetFont(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextRange *txtRge = NULL;
+ ITextFont *txtFont = NULL, *txtFont1 = NULL;
+ HRESULT hres;
+ int first, lim;
+ int refcount;
+ static const CHAR test_text1[] = "TestSomeText";
+ LONG value;
+
+ create_interfaces(&w, &reOle, &txtDoc, NULL);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ first = 4, lim = 4;
+ ITextDocument_Range(txtDoc, first, lim, &txtRge);
+ refcount = get_refcount((IUnknown *)txtRge);
+ ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+
+ hres = ITextRange_GetFont(txtRge, &txtFont);
+ ok(hres == S_OK, "ITextRange_GetFont\n");
+ refcount = get_refcount((IUnknown *)txtFont);
+ ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+ refcount = get_refcount((IUnknown *)txtRge);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+
+ hres = ITextRange_GetFont(txtRge, &txtFont1);
+ ok(hres == S_OK, "ITextRange_GetFont\n");
+ ok(txtFont1 != txtFont, "A new pointer should be return\n");
+ refcount = get_refcount((IUnknown *)txtFont1);
+ ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+ ITextFont_Release(txtFont1);
+ refcount = get_refcount((IUnknown *)txtRge);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+
+ ITextRange_Release(txtRge);
+ release_interfaces(&w, &reOle, &txtDoc, NULL);
+
+ hres = ITextFont_GetOutline(txtFont, &value);
+ ok(hres == CO_E_RELEASED, "ITextFont after ITextDocument destroyed\n");
+
+ ITextFont_Release(txtFont);
+}
+
+static void test_ITextSelection_GetFont(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextSelection *txtSel = NULL;
+ ITextFont *txtFont = NULL, *txtFont1 = NULL;
+ HRESULT hres;
+ int first, lim;
+ int refcount;
+ static const CHAR test_text1[] = "TestSomeText";
+ LONG value;
+
+ create_interfaces(&w, &reOle, &txtDoc, &txtSel);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ first = 4, lim = 4;
+ SendMessageA(w, EM_SETSEL, first, lim);
+ refcount = get_refcount((IUnknown *)txtSel);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+
+ hres = ITextSelection_GetFont(txtSel, &txtFont);
+ ok(hres == S_OK, "ITextSelection_GetFont\n");
+ refcount = get_refcount((IUnknown *)txtFont);
+ ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+ refcount = get_refcount((IUnknown *)txtSel);
+ ok(refcount == 3, "got wrong ref count: %d\n", refcount);
+
+ hres = ITextSelection_GetFont(txtSel, &txtFont1);
+ ok(hres == S_OK, "ITextSelection_GetFont\n");
+ ok(txtFont1 != txtFont, "A new pointer should be return\n");
+ refcount = get_refcount((IUnknown *)txtFont1);
+ ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+ ITextFont_Release(txtFont1);
+ refcount = get_refcount((IUnknown *)txtSel);
+ ok(refcount == 3, "got wrong ref count: %d\n", refcount);
+
+ release_interfaces(&w, &reOle, &txtDoc, &txtSel);
+
+ hres = ITextFont_GetOutline(txtFont, &value);
+ ok(hres == CO_E_RELEASED, "ITextFont after ITextDocument destroyed\n");
+
+ ITextFont_Release(txtFont);
+}
+
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -3543,6 +3634,7 @@ START_TEST(richole)
test_ITextSelection_SetStart();
test_ITextSelection_SetEnd();
test_ITextSelection_Collapse();
+ test_ITextSelection_GetFont();
test_ITextDocument_Range();
test_ITextRange_GetChar();
test_ITextRange_ScrollIntoView();
@@ -3551,6 +3643,7 @@ START_TEST(richole)
test_ITextRange_SetStart();
test_ITextRange_SetEnd();
test_ITextRange_Collapse();
+ test_ITextRange_GetFont();
test_GetClientSite();
test_IOleWindow_GetWindow();
test_IOleInPlaceSite_GetWindow();
--
2.7.1

View File

@@ -1,68 +0,0 @@
From ce774a2b82262619fb882649ca02802e943ce404 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Wed, 13 Aug 2014 15:40:11 +0800
Subject: riched20: Implement ITextRange::GetText.
---
dlls/riched20/tests/richole.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index c148034..051d9fe 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -3519,6 +3519,43 @@ static void test_ITextRange_GetPara(void)
ITextPara_Release(txtPara);
}
+static void test_ITextRange_GetText(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextRange *txtRge = NULL;
+ HRESULT hres;
+ BSTR bstr = NULL;
+ static const CHAR test_text1[] = "TestSomeText";
+ static const WCHAR bufW1[] = {'T', 'e', 's', 't', 0};
+ static const WCHAR bufW2[] = {'T', 'e', 'x', 't', '\r', 0};
+ static const WCHAR bufW3[] = {'T', 'e', 'x', 't', 0};
+ static const WCHAR bufW4[] = {'T', 'e', 's', 't', 'S', 'o', 'm',
+ 'e', 'T', 'e', 'x', 't', '\r', 0};
+ static const WCHAR bufW5[] = {'\r', 0};
+
+
+#define TEST_TXTRGE_GETTEXT(first, lim, expected_string) \
+ create_interfaces(&w, &reOle, &txtDoc, NULL); \
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); \
+ ITextDocument_Range(txtDoc, first, lim, &txtRge); \
+ hres = ITextRange_GetText(txtRge, &bstr); \
+ ok(hres == S_OK, "ITextRange_GetText\n"); \
+ ok(!lstrcmpW(bstr, expected_string), "got wrong text: %s\n", wine_dbgstr_w(bstr)); \
+ SysFreeString(bstr); \
+ ITextRange_Release(txtRge); \
+ release_interfaces(&w, &reOle, &txtDoc, NULL);
+
+ TEST_TXTRGE_GETTEXT(0, 4, bufW1)
+ TEST_TXTRGE_GETTEXT(4, 0, bufW1)
+ TEST_TXTRGE_GETTEXT(8, 12, bufW3)
+ TEST_TXTRGE_GETTEXT(8, 13, bufW2)
+ TEST_TXTRGE_GETTEXT(12, 13, bufW5)
+ TEST_TXTRGE_GETTEXT(0, 13, bufW4)
+ TEST_TXTRGE_GETTEXT(1, 1, NULL)
+}
+
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -3544,6 +3581,7 @@ START_TEST(richole)
test_ITextRange_Collapse();
test_ITextRange_GetFont();
test_ITextRange_GetPara();
+ test_ITextRange_GetText();
test_GetClientSite();
test_IOleWindow_GetWindow();
test_IOleInPlaceSite_GetWindow();
--
2.4.2

View File

@@ -1,77 +0,0 @@
From 2d05fb15e16385684dfc1e9f1d2c51fa4d5830d9 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Fri, 15 Aug 2014 14:27:21 +0800
Subject: [PATCH] riched20: Implement ITextRange::IsEqual.
---
dlls/riched20/tests/richole.c | 47 +++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 4512085ea3..b2bb21d69b 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -4113,6 +4113,52 @@ static void test_ITextRange_GetText(void)
TEST_TXTRGE_GETTEXT(1, 1, NULL)
}
+static void test_ITextRange_IsEqual2(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextRange *txtRge1 = NULL, *txtRge2 = NULL;
+ HRESULT hres;
+ static const CHAR test_text1[] = "TestSomeText";
+ LONG res;
+
+ create_interfaces(&w, &reOle, &txtDoc, NULL);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+ ITextDocument_Range(txtDoc, 2, 4, &txtRge1);
+ ITextDocument_Range(txtDoc, 2, 4, &txtRge2);
+
+#define TEST_TXTRGE_ISEQUAL(expected_hres, expected_res) \
+ hres = ITextRange_IsEqual(txtRge1, txtRge2, &res); \
+ ok(hres == expected_hres, "ITextRange_IsEqual\n"); \
+ ok(res == expected_res, "got wrong return value: %d\n", res);
+
+ TEST_TXTRGE_ISEQUAL(S_OK, tomTrue)
+ ITextRange_SetRange(txtRge2, 1, 2);
+ TEST_TXTRGE_ISEQUAL(S_FALSE, tomFalse)
+
+ ITextRange_SetRange(txtRge1, 1, 1);
+ ITextRange_SetRange(txtRge2, 2, 2);
+ TEST_TXTRGE_ISEQUAL(S_FALSE, tomFalse)
+
+ ITextRange_SetRange(txtRge2, 1, 1);
+ TEST_TXTRGE_ISEQUAL(S_OK, tomTrue)
+
+ hres = ITextRange_IsEqual(txtRge1, txtRge1, &res);
+ ok(hres == S_OK, "ITextRange_IsEqual\n");
+ ok(res == tomTrue, "got wrong return value: %d\n", res);
+
+ hres = ITextRange_IsEqual(txtRge1, txtRge2, NULL);
+ ok(hres == S_OK, "ITextRange_IsEqual\n");
+
+ hres = ITextRange_IsEqual(txtRge1, NULL, NULL);
+ ok(hres == S_FALSE, "ITextRange_IsEqual\n");
+
+ ITextRange_Release(txtRge1);
+ ITextRange_Release(txtRge2);
+ release_interfaces(&w, &reOle, &txtDoc, NULL);
+}
+
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -4141,6 +4187,7 @@ START_TEST(richole)
test_ITextRange_GetFont();
test_ITextRange_GetPara();
test_ITextRange_GetText();
+ test_ITextRange_IsEqual2();
test_GetClientSite();
test_IOleWindow_GetWindow();
test_IOleInPlaceSite_GetWindow();
--
2.20.1

View File

@@ -1,62 +0,0 @@
From a3c18216d981f2f46f3a2572d5ba17f278c259c2 Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Mon, 18 Aug 2014 14:38:50 +0800
Subject: [PATCH] riched20: Implement ITextRange::GetStoryLength.
---
dlls/riched20/tests/richole.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index b2bb21d69bc..5e105b3444a 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -4159,6 +4159,37 @@ static void test_ITextRange_IsEqual2(void)
release_interfaces(&w, &reOle, &txtDoc, NULL);
}
+static void test_ITextRange_GetStoryLength(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextRange *txtRge = NULL;
+ HRESULT hres;
+ LONG count;
+ static const CHAR test_text1[] = "TestSomeText";
+ int len = strlen(test_text1) + 1;
+
+ create_interfaces(&w, &reOle, &txtDoc, NULL);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+ ITextDocument_Range(txtDoc, 0, 0, &txtRge);
+
+ hres = ITextRange_GetStoryLength(txtRge, &count);
+ ok(hres == S_OK, "ITextRange_GetStoryLength\n");
+ ok(count == len, "got wrong length: %d\n", count);
+
+ ITextRange_SetRange(txtRge, 1, 2);
+ hres = ITextRange_GetStoryLength(txtRge, &count);
+ ok(hres == S_OK, "ITextRange_GetStoryLength\n");
+ ok(count == len, "got wrong length: %d\n", count);
+
+ hres = ITextRange_GetStoryLength(txtRge, NULL);
+ ok(hres == E_INVALIDARG, "ITextRange_GetStoryLength\n");
+
+ ITextRange_Release(txtRge);
+ release_interfaces(&w, &reOle, &txtDoc, NULL);
+}
+
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -4188,6 +4219,7 @@ START_TEST(richole)
test_ITextRange_GetPara();
test_ITextRange_GetText();
test_ITextRange_IsEqual2();
+ test_ITextRange_GetStoryLength();
test_GetClientSite();
test_IOleWindow_GetWindow();
test_IOleInPlaceSite_GetWindow();
--
2.20.1

View File

@@ -1,60 +0,0 @@
From e5dad19d1dbab38b6a6c31bd23fe7dac278e6d1a Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Mon, 18 Aug 2014 14:47:14 +0800
Subject: riched20: Implement ITextSelection::GetStoryLength.
---
dlls/riched20/tests/richole.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index c7d6299..38a8f80 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -3813,6 +3813,35 @@ static void test_ITextRange_GetStoryLength(void)
release_interfaces(&w, &reOle, &txtDoc, NULL);
}
+static void test_ITextSelection_GetStoryLength(void)
+{
+ HWND w;
+ IRichEditOle *reOle = NULL;
+ ITextDocument *txtDoc = NULL;
+ ITextSelection *txtSel = NULL;
+ HRESULT hres;
+ LONG count;
+ static const CHAR test_text1[] = "TestSomeText";
+ int len = strlen(test_text1) + 1;
+
+ create_interfaces(&w, &reOle, &txtDoc, &txtSel);
+ SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1);
+
+ hres = ITextSelection_GetStoryLength(txtSel, &count);
+ ok(hres == S_OK, "ITextSelection_GetStoryLength\n");
+ ok(count == len, "got wrong length: %d\n", count);
+
+ SendMessageA(w, EM_SETSEL, 1, 2);
+ hres = ITextSelection_GetStoryLength(txtSel, &count);
+ ok(hres == S_OK, "ITextSelection_GetStoryLength\n");
+ ok(count == len, "got wrong length: %d\n", count);
+
+ hres = ITextSelection_GetStoryLength(txtSel, NULL);
+ ok(hres == E_INVALIDARG, "ITextSelection_GetStoryLength\n");
+
+ release_interfaces(&w, &reOle, &txtDoc, &txtSel);
+}
+
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -3829,6 +3858,7 @@ START_TEST(richole)
test_ITextSelection_SetEnd();
test_ITextSelection_Collapse();
test_ITextSelection_GetFont();
+ test_ITextSelection_GetStoryLength();
test_ITextDocument_Range();
test_ITextRange_GetChar();
test_ITextRange_ScrollIntoView();
--
2.7.1

View File

@@ -1,7 +1,7 @@
From 17ad773281bf85925a0070fd0ba4ce07804c497c Mon Sep 17 00:00:00 2001
From fc7edfef4776f6ce7577a0597f78ad4971fe776d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 1 Nov 2014 22:51:34 +0100
Subject: riched20: Silence repeated FIXMEs triggered by Adobe Reader.
Subject: [PATCH] riched20: Silence repeated FIXMEs triggered by Adobe Reader.
Adobe Reader calls these functions very often while scrolling through a document.
---
@@ -9,10 +9,10 @@ Adobe Reader calls these functions very often while scrolling through a document
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 8aea23e..39cee96 100644
index 724113404b4..5a620c537d5 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -927,6 +927,14 @@ static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, R
@@ -951,6 +951,14 @@ static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, R
IUnknown_AddRef((IUnknown *)*ppvObj);
return S_OK;
}
@@ -27,7 +27,7 @@ index 8aea23e..39cee96 100644
FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid));
return E_NOINTERFACE;
@@ -3438,7 +3446,9 @@ static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
@@ -3575,7 +3583,9 @@ static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value)
{
ITextParaImpl *This = impl_from_ITextPara(iface);
@@ -39,5 +39,5 @@ index 8aea23e..39cee96 100644
if (!para_get_reole(This))
return CO_E_RELEASED;
--
2.4.2
2.17.1