Rebase against 0d91274defcf65093957cf8e43985b9be55642d5.

This commit is contained in:
Sebastian Lackner
2015-05-19 05:25:23 +02:00
parent 0defa32dfb
commit 9573b57d3c
31 changed files with 1448 additions and 2149 deletions

View File

@@ -1,18 +1,18 @@
From 6f4e0b9da2720ac9b3e37b419e5599cb0f0fb99d Mon Sep 17 00:00:00 2001
From c75a9af77ea3cc0abea38a7c595b52093b4d166a Mon Sep 17 00:00:00 2001
From: Jactry Zeng <wine@jactry.com>
Date: Fri, 8 Aug 2014 21:32:57 +0800
Subject: riched20: Implement IText{Selection, Range}::Set{Start, End}.
---
dlls/riched20/richole.c | 52 +++++++++++++---
dlls/riched20/richole.c | 46 ++++++++++++--
dlls/riched20/tests/richole.c | 135 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 179 insertions(+), 8 deletions(-)
2 files changed, 177 insertions(+), 4 deletions(-)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 3818cfa..89a51ac 100644
index 4f85325..55dda9b 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -871,14 +871,27 @@ static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *pcpFirst)
@@ -2995,14 +2995,33 @@ static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFir
return S_OK;
}
@@ -30,49 +30,6 @@ index 3818cfa..89a51ac 100644
+ return S_OK;
+}
+
static HRESULT WINAPI ITextRange_fnSetStart(ITextRange *me, LONG cpFirst)
{
ITextRangeImpl *This = impl_from_ITextRange(me);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("not implemented %p\n", This);
- return E_NOTIMPL;
+ return range_SetStart(This->reOle->editor, cpFirst, &This->start, &This->end);
}
static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim)
@@ -894,14 +907,27 @@ static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim)
return S_OK;
}
+static HRESULT range_SetEnd(ME_TextEditor *editor, LONG cpLim, LONG *start, LONG *end)
+{
+ int len = ME_GetTextLength(editor) + 1;
+
+ TRACE("%d\n", cpLim);
+ if (cpLim == *end)
+ return S_FALSE;
+ cpLim = min(cpLim, len);
+ cpLim = max(cpLim, 0);
+ *start = min(*start, cpLim);
+ *end = cpLim;
+ return S_OK;
+}
+
static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG cpLim)
{
ITextRangeImpl *This = impl_from_ITextRange(me);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("not implemented %p\n", This);
- return E_NOTIMPL;
+ return range_SetEnd(This->reOle->editor, cpLim, &This->start, &This->end);
}
static HRESULT WINAPI ITextRange_fnGetFont(ITextRange *me, ITextFont **pFont)
@@ -1881,11 +1907,16 @@ static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFir
static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG cpFirst)
{
ITextSelectionImpl *This = impl_from_ITextSelection(me);
@@ -91,7 +48,24 @@ index 3818cfa..89a51ac 100644
}
static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
@@ -1905,11 +1936,16 @@ static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
@@ -3019,14 +3038,33 @@ static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
return S_OK;
}
+static HRESULT range_SetEnd(ME_TextEditor *editor, LONG cpLim, LONG *start, LONG *end)
+{
+ int len = ME_GetTextLength(editor) + 1;
+
+ TRACE("%d\n", cpLim);
+ if (cpLim == *end)
+ return S_FALSE;
+ cpLim = min(cpLim, len);
+ cpLim = max(cpLim, 0);
+ *start = min(*start, cpLim);
+ *end = cpLim;
+ return S_OK;
+}
+
static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim)
{
ITextSelectionImpl *This = impl_from_ITextSelection(me);
@@ -111,11 +85,11 @@ index 3818cfa..89a51ac 100644
static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **pFont)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index b4fbaa1..5550e30 100644
index d826298..9a52f78 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -1081,6 +1081,137 @@ static void test_IOleInPlaceSite_GetWindow(void)
release_interfaces(&w, &reOle, &txtDoc, NULL);
@@ -1347,6 +1347,137 @@ todo_wine {
release_interfaces(&hwnd, &reOle, &doc, NULL);
}
+static void test_ITextRange_SetStart(void)
@@ -252,7 +226,7 @@ index b4fbaa1..5550e30 100644
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
@@ -1093,12 +1224,16 @@ START_TEST(richole)
@@ -1359,12 +1490,16 @@ START_TEST(richole)
test_ITextSelection_GetText();
test_ITextSelection_GetChar();
test_ITextSelection_GetStart_GetEnd();
@@ -270,5 +244,5 @@ index b4fbaa1..5550e30 100644
test_IOleWindow_GetWindow();
test_IOleInPlaceSite_GetWindow();
--
2.3.2
2.4.0

View File

@@ -1,4 +1,4 @@
From 359a12d6dac0d8ef3560055d39d6ff59ed80fe5e Mon Sep 17 00:00:00 2001
From 44c16f1f02bf269a595b914bcc55a37184fc1fa4 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 13 Sep 2014 17:21:31 +0200
Subject: riched20: Fix invalid memory access when parent object was destroyed
@@ -9,10 +9,10 @@ Subject: riched20: Fix invalid memory access when parent object was destroyed
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index e42df2b..fe9af6a 100644
index d3ed501..7a07a84 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -546,10 +546,13 @@ static ULONG WINAPI ITextPara_fnRelease(ITextPara *me)
@@ -1618,10 +1618,13 @@ static ULONG WINAPI TextFont_Release(ITextFont *iface)
ITextRange_Release(&This->txtRge->ITextRange_iface);
else
ITextSelection_Release(&This->txtSel->ITextSelection_iface);
@@ -27,8 +27,8 @@ index e42df2b..fe9af6a 100644
+ }
heap_free(This);
}
return ref;
@@ -1181,10 +1184,13 @@ static ULONG WINAPI ITextFont_fnRelease(ITextFont *me)
@@ -2441,10 +2444,13 @@ static ULONG WINAPI TextPara_Release(ITextPara *iface)
ITextRange_Release(&This->txtRge->ITextRange_iface);
else
ITextSelection_Release(&This->txtSel->ITextSelection_iface);
@@ -43,7 +43,7 @@ index e42df2b..fe9af6a 100644
+ }
heap_free(This);
}
return ref;
--
2.1.2
2.4.0

View File

@@ -1,18 +1,18 @@
From 6bb871e513368168c7fd275e0d4fc38ef82a51c1 Mon Sep 17 00:00:00 2001
From 0b40418cf55b2c6b963433c48fd52f8465558f1d 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.
Adobe Reader calls these functions very often while scrolling through a document.
---
dlls/riched20/richole.c | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
dlls/riched20/richole.c | 48 ++++++++++++++++++++++++++++++++++++++----------
1 file changed, 38 insertions(+), 10 deletions(-)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index fe9af6a..9de460f 100644
index 7a07a84..8e719eb 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -146,6 +146,14 @@ static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, R
@@ -175,6 +175,14 @@ static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, R
IUnknown_AddRef((IUnknown *)*ppvObj);
return S_OK;
}
@@ -27,160 +27,116 @@ index fe9af6a..9de460f 100644
FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid));
return E_NOINTERFACE;
@@ -676,11 +684,12 @@ static HRESULT WINAPI ITextPara_fnSetStyle(ITextPara *me, LONG Value)
static HRESULT WINAPI ITextPara_fnGetAlignment(ITextPara *me, LONG *pValue)
@@ -1833,7 +1841,9 @@ static HRESULT WINAPI TextFont_SetBackColor(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetBold(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextParaImpl *This = impl_from_ITextPara(me);
if (!This->reOle)
return CO_E_RELEASED;
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
- FIXME("not implemented: %p\n", This);
+ if (!once++) FIXME("not implemented: %p\n", This);
return E_NOTIMPL;
}
@@ -1374,13 +1383,14 @@ static HRESULT WINAPI ITextFont_fnSetBackColor(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetBold(ITextFont *me, LONG *pValue)
{
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
if (!value)
return E_INVALIDARG;
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = tomFalse;
return S_OK;
}
@@ -1417,13 +1427,14 @@ static HRESULT WINAPI ITextFont_fnSetEmboss(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetForeColor(ITextFont *me, LONG *pValue)
@@ -1880,7 +1890,9 @@ static HRESULT WINAPI TextFont_SetEmboss(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetForeColor(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!value)
return E_INVALIDARG;
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = tomAutoColor;
return S_OK;
}
@@ -1480,13 +1491,14 @@ static HRESULT WINAPI ITextFont_fnSetEngrave(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetItalic(ITextFont *me, LONG *pValue)
@@ -1949,7 +1961,9 @@ static HRESULT WINAPI TextFont_SetEngrave(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetItalic(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!value)
return E_INVALIDARG;
@@ -1996,7 +2010,9 @@ static HRESULT WINAPI TextFont_SetKerning(ITextFont *iface, FLOAT value)
static HRESULT WINAPI TextFont_GetLanguageID(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = tomFalse;
return S_OK;
}
@@ -1523,11 +1535,12 @@ static HRESULT WINAPI ITextFont_fnSetKerning(ITextFont *me, float Value)
static HRESULT WINAPI ITextFont_fnGetLanguageID(ITextFont *me, LONG *pValue)
@@ -2133,7 +2149,9 @@ static HRESULT WINAPI TextFont_SetShadow(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetSize(ITextFont *iface, FLOAT *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!This->reOle)
return CO_E_RELEASED;
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
- FIXME("not implemented: %p\n", This);
+ if (!once++) FIXME("not implemented: %p\n", This);
return E_NOTIMPL;
}
@@ -1647,13 +1660,14 @@ static HRESULT WINAPI ITextFont_fnSetShadow(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetSize(ITextFont *me, float *pValue)
{
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
if (!value)
return E_INVALIDARG;
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = 12.0;
return S_OK;
}
@@ -1710,13 +1724,14 @@ static HRESULT WINAPI ITextFont_fnSetSpacing(ITextFont *me, float Value)
static HRESULT WINAPI ITextFont_fnGetStrikeThrough(ITextFont *me, LONG *pValue)
@@ -2202,7 +2220,9 @@ static HRESULT WINAPI TextFont_SetSpacing(ITextFont *iface, FLOAT value)
static HRESULT WINAPI TextFont_GetStrikeThrough(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!value)
return E_INVALIDARG;
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = tomFalse;
return S_OK;
}
@@ -1733,13 +1748,14 @@ static HRESULT WINAPI ITextFont_fnSetStrikeThrough(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetSubscript(ITextFont *me, LONG *pValue)
@@ -2227,7 +2247,9 @@ static HRESULT WINAPI TextFont_SetStrikeThrough(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetSubscript(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!value)
return E_INVALIDARG;
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = tomFalse;
return S_OK;
}
@@ -1779,13 +1795,14 @@ static HRESULT WINAPI ITextFont_fnSetSuperscript(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetUnderline(ITextFont *me, LONG *pValue)
@@ -2277,7 +2299,9 @@ static HRESULT WINAPI TextFont_SetSuperscript(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetUnderline(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
if (!pValue)
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!value)
return E_INVALIDARG;
if (!This->reOle)
return CO_E_RELEASED;
- FIXME("Stub\n");
+ if (!once++) FIXME("Stub\n");
*pValue = tomNone;
return S_OK;
}
@@ -1802,11 +1819,12 @@ static HRESULT WINAPI ITextFont_fnSetUnderline(ITextFont *me, LONG Value)
static HRESULT WINAPI ITextFont_fnGetWeight(ITextFont *me, LONG *pValue)
@@ -2302,7 +2326,9 @@ static HRESULT WINAPI TextFont_SetUnderline(ITextFont *iface, LONG value)
static HRESULT WINAPI TextFont_GetWeight(ITextFont *iface, LONG *value)
{
ITextFontImpl *This = impl_from_ITextFont(iface);
- FIXME("(%p)->(%p): stub\n", This, value);
+ static int once;
ITextFontImpl *This = impl_from_ITextFont(me);
+
+ if (!once++) FIXME("(%p)->(%p): stub\n", This, value);
if (!This->reOle)
return CO_E_RELEASED;
@@ -2593,7 +2619,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);
- FIXME("(%p)->(%p)\n", This, value);
+ static int once;
+
+ if (!once++) FIXME("(%p)->(%p)\n", This, value);
- FIXME("not implemented: %p\n", This);
+ if (!once++) FIXME("not implemented: %p\n", This);
return E_NOTIMPL;
}
if (!This->reOle)
return CO_E_RELEASED;
--
2.1.2
2.4.0

View File

@@ -1,3 +1,3 @@
Fixes: [12458] Support for ITextDocument_fnRange function
# Fixes: [12458] Support for ITextDocument_fnRange function
Fixes: [18303] Support for ITextRange, ITextFont and ITextPara
Fixes: Adobe Reader needs ITextSelection_fnGetDuplicate implementation