From 7e6191a4cdc4ec8f4aabc59897c917bcf3ac5d5b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 30 Oct 2014 20:43:01 +0100 Subject: [PATCH] Removed patch to Iimplement IRichEditOle and ITextDocument support for ITextServices (accepted upstream). --- README.md | 2 +- debian/changelog | 1 + patches/Makefile | 10 +- ...nt-IText-Selection-Range-Set-Start-E.patch | 14 +- ...r-ITextFont-interface-and-implement-.patch | 56 ++--- ...r-ITextPara-interface-and-implement-.patch | 54 ++--- ...RunOfsFromCharOfs-when-nCharOfs-strl.patch | 4 +- ...iched20-Implement-ITextRange-GetText.patch | 12 +- ...ched20-Implement-ITextRange-SetRange.patch | 10 +- ...iched20-Implement-ITextRange-IsEqual.patch | 8 +- ...-Implement-ITextRange-GetStoryLength.patch | 8 +- ...lement-ITextSelection-GetStoryLength.patch | 8 +- ...alid-memory-access-when-parent-objec.patch | 10 +- ...-aggregation-support-for-IRichEditOl.patch | 219 ------------------ ..._IRichEditOle-and-IID_ITextDocument-.patch | 137 ----------- patches/riched20-IText_Interface/definition | 9 - 16 files changed, 95 insertions(+), 467 deletions(-) delete mode 100644 patches/riched20-IText_Interface/0011-riched20-Add-COM-aggregation-support-for-IRichEditOl.patch delete mode 100644 patches/riched20-IText_Interface/0012-riched20-Add-IID_IRichEditOle-and-IID_ITextDocument-.patch diff --git a/README.md b/README.md index 645f6a4f..45b3cb2d 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Included bugfixes and improvements * Support for GetSystemTimes ([Wine Bug #19813](http://bugs.winehq.org/show_bug.cgi?id=19813)) * Support for GetVolumePathName * Support for ID3DXSkinInfoImpl_UpdateSkinnedMesh ([Wine Bug #32572](http://bugs.winehq.org/show_bug.cgi?id=32572)) -* Support for IRichEditOle and ITextDocument support for ITextServices. ([Wine Bug #17042](http://bugs.winehq.org/show_bug.cgi?id=17042)) +* ~~Support for IRichEditOle and ITextDocument support for ITextServices.~~ ([Wine Bug #17042](http://bugs.winehq.org/show_bug.cgi?id=17042)) * Support for ITextDocument_fnRange function ([Wine Bug #12458](http://bugs.winehq.org/show_bug.cgi?id=12458)) * Support for ITextRange, ITextFont and ITextPara ([Wine Bug #18303](http://bugs.winehq.org/show_bug.cgi?id=18303)) * Support for Junction Points ([Wine Bug #12401](http://bugs.winehq.org/show_bug.cgi?id=12401)) diff --git a/debian/changelog b/debian/changelog index be932de4..9c238667 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ wine-compholio (1.7.30) UNRELEASED; urgency=low * Added patch to implement RtlDecompressBuffer. * Removed patch to avoid Clang compiler warning because of unused Vtable (accepted upstream). * Removed patch for additional ATL thunks (accepted upstream). + * Removed patch to ímplement IRichEditOle and ITextDocument support for ITextServices (accepted upstream). -- Sebastian Lackner Mon, 20 Oct 2014 19:53:47 +0200 wine-compholio (1.7.29) unstable; urgency=low diff --git a/patches/Makefile b/patches/Makefile index b2b0906d..11a7a674 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -1016,17 +1016,13 @@ quartz-MediaSeeking_Positions.ok: # | * Implement Stubs for ITextPara interface. [rev 2, by Jactry Zeng] # | * Implement ITextRange/Selection::{GetChar,GetStart,GetEnd,GetDuplicate,Collapse,SetStart,SetEnd}. [by Jactry Zeng] # | * Implement ITextRange/Selection::{GetText,SetRange,IsEqual,GetStoryLength}. [by Jactry Zeng] -# | * Add COM aggregation support for IRichEditOle. [by Jactry Zeng] -# | * Implement IRichEditOle and ITextDocument support for ITextServices. [by Jactry Zeng] # | # | This patchset fixes the following Wine bugs: # | * [#12458] Support for ITextDocument_fnRange function # | * [#18303] Support for ITextRange, ITextFont and ITextPara -# | * [#17042] Support for IRichEditOle and ITextDocument support for ITextServices. # | # | Modified files: -# | * dlls/riched20/editor.c, dlls/riched20/editor.h, dlls/riched20/richole.c, dlls/riched20/run.c, -# | dlls/riched20/tests/richole.c, dlls/riched20/tests/txtsrv.c, dlls/riched20/txtsrv.c +# | * dlls/riched20/richole.c, dlls/riched20/run.c, dlls/riched20/tests/richole.c # | .INTERMEDIATE: riched20-IText_Interface.ok riched20-IText_Interface.ok: @@ -1040,16 +1036,12 @@ riched20-IText_Interface.ok: $(call APPLY_FILE,riched20-IText_Interface/0008-riched20-Implement-ITextRange-GetStoryLength.patch) $(call APPLY_FILE,riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch) $(call APPLY_FILE,riched20-IText_Interface/0010-riched20-Fix-invalid-memory-access-when-parent-objec.patch) - $(call APPLY_FILE,riched20-IText_Interface/0011-riched20-Add-COM-aggregation-support-for-IRichEditOl.patch) - $(call APPLY_FILE,riched20-IText_Interface/0012-riched20-Add-IID_IRichEditOle-and-IID_ITextDocument-.patch) @( \ echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Implement Stubs for ITextRange interface. [rev 3]" },'; \ echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Implement Stubs for ITextFont interface. [rev 2]" },'; \ echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Implement Stubs for ITextPara interface. [rev 2]" },'; \ echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Implement ITextRange/Selection::{GetChar,GetStart,GetEnd,GetDuplicate,Collapse,SetStart,SetEnd}." },'; \ echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Implement ITextRange/Selection::{GetText,SetRange,IsEqual,GetStoryLength}." },'; \ - echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Add COM aggregation support for IRichEditOle." },'; \ - echo '+ { "riched20-IText_Interface", "Jactry Zeng", "Implement IRichEditOle and ITextDocument support for ITextServices." },'; \ ) > riched20-IText_Interface.ok # Patchset server-ACL_Compat diff --git a/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch b/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch index e37ac5b0..7ede4e26 100644 --- a/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch +++ b/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch @@ -1,4 +1,4 @@ -From 3978dfd4417127c13b28f2ecd45526e50cdc724a Mon Sep 17 00:00:00 2001 +From 32cac6b3baa18e853028012d6cb9b36ff74f1f85 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Fri, 8 Aug 2014 21:32:57 +0800 Subject: riched20: Implement IText{Selection, Range}::Set{Start, End}. @@ -9,10 +9,10 @@ Subject: riched20: Implement IText{Selection, Range}::Set{Start, End}. 2 files changed, 179 insertions(+), 8 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 9e7c123..49f9af1 100644 +index 0788125..8b5f2ba 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -651,14 +651,27 @@ static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *pcpFirst) +@@ -674,14 +674,27 @@ static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *pcpFirst) return S_OK; } @@ -42,7 +42,7 @@ index 9e7c123..49f9af1 100644 } static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim) -@@ -674,14 +687,27 @@ static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim) +@@ -697,14 +710,27 @@ static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim) return S_OK; } @@ -72,7 +72,7 @@ index 9e7c123..49f9af1 100644 } static HRESULT WINAPI ITextRange_fnGetFont(ITextRange *me, ITextFont **pFont) -@@ -1661,11 +1687,16 @@ static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFir +@@ -1684,11 +1710,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 +91,7 @@ index 9e7c123..49f9af1 100644 } static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim) -@@ -1685,11 +1716,16 @@ static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim) +@@ -1708,11 +1739,16 @@ static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim) static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim) { ITextSelectionImpl *This = impl_from_ITextSelection(me); @@ -268,5 +268,5 @@ index eed335c..2268211 100644 + test_ITextRange_SetEnd(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch b/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch index 68d0c579..d79b3a46 100644 --- a/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch +++ b/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch @@ -1,4 +1,4 @@ -From cefe1e9349a7eb453fcd01071411b861a50ab94f Mon Sep 17 00:00:00 2001 +From ef430ec89085a9d089de21871329c7cac5a5eea2 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 11 Aug 2014 13:51:55 +0800 Subject: riched20: Stub for ITextFont interface and implement @@ -10,7 +10,7 @@ Subject: riched20: Stub for ITextFont interface and implement 2 files changed, 893 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 49f9af1..39d352f 100644 +index 8b5f2ba..6cc4b09 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -46,10 +46,12 @@ DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0x @@ -25,8 +25,8 @@ index 49f9af1..39d352f 100644 +typedef struct ITextFontImpl ITextFontImpl; typedef struct IRichEditOleImpl { - IRichEditOle IRichEditOle_iface; -@@ -60,8 +62,19 @@ typedef struct IRichEditOleImpl { + IUnknown IUnknown_inner; +@@ -62,8 +64,19 @@ typedef struct IRichEditOleImpl { ITextSelectionImpl *txtSel; IOleClientSiteImpl *clientSite; struct list rangelist; @@ -46,24 +46,7 @@ index 49f9af1..39d352f 100644 struct ITextRangeImpl { ITextRange ITextRange_iface; LONG ref; -@@ -140,6 +153,7 @@ IRichEditOle_fnRelease(IRichEditOle *me) - if (!ref) - { - ITextRangeImpl *txtRge; -+ ITextFontImpl *txtFont; - TRACE ("Destroying %p\n", This); - This->txtSel->reOle = NULL; - This->editor->reOle = NULL; -@@ -147,6 +161,8 @@ IRichEditOle_fnRelease(IRichEditOle *me) - IOleClientSite_Release(&This->clientSite->IOleClientSite_iface); - LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry) - txtRge->reOle = NULL; -+ LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) -+ txtFont->reOle = NULL; - heap_free(This); - } - return ref; -@@ -458,6 +474,744 @@ static const IRichEditOleVtbl revt = { +@@ -481,6 +494,744 @@ static const IRichEditOleVtbl revt = { IRichEditOle_fnImportDataObject }; @@ -808,7 +791,7 @@ index 49f9af1..39d352f 100644 /* ITextRange interface */ static inline ITextRangeImpl *impl_from_ITextRange(ITextRange *iface) { -@@ -710,14 +1464,42 @@ static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG cpLim) +@@ -733,14 +1484,42 @@ static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG cpLim) return range_SetEnd(This->reOle->editor, cpLim, &This->start, &This->end); } @@ -853,7 +836,7 @@ index 49f9af1..39d352f 100644 } static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont) -@@ -1731,11 +2513,24 @@ static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim) +@@ -1754,11 +2533,24 @@ static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim) static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **pFont) { ITextSelectionImpl *This = impl_from_ITextSelection(me); @@ -880,14 +863,31 @@ index 49f9af1..39d352f 100644 } static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *pFont) -@@ -2369,6 +3164,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) +@@ -2392,6 +3184,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p + } TRACE("Created %p\n",reo); - *ppObj = reo; list_init(&reo->rangelist); + list_init(&reo->fontlist); + if (outer_unk) + reo->outer_unk = outer_unk; + else +@@ -2405,6 +3198,7 @@ void DestroyIRichEditOle(IRichEditOle *iface) + { + IRichEditOleImpl *This = impl_from_IRichEditOle(iface); + ITextRangeImpl *txtRge; ++ ITextFontImpl *txtFont; - return 1; + TRACE("Destroying %p\n", This); + This->txtSel->reOle = NULL; +@@ -2413,6 +3207,8 @@ void DestroyIRichEditOle(IRichEditOle *iface) + IOleClientSite_Release(&This->clientSite->IOleClientSite_iface); + LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry) + txtRge->reOle = NULL; ++ LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) ++ txtFont->reOle = NULL; + heap_free(This); } + diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index 2268211..e9618d8 100644 --- a/dlls/riched20/tests/richole.c @@ -1005,5 +1005,5 @@ index 2268211..e9618d8 100644 + test_ITextRange_GetFont(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch b/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch index c2001c04..68a56c73 100644 --- a/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch +++ b/patches/riched20-IText_Interface/0003-riched20-Stub-for-ITextPara-interface-and-implement-.patch @@ -1,4 +1,4 @@ -From 4a54bc77b87e9b301e26b521e34bc1208a11a20c Mon Sep 17 00:00:00 2001 +From ad5c4b52d44704ff75e0706ce0e2aaa3859f6f29 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Sun, 10 Aug 2014 22:17:57 +0800 Subject: riched20: Stub for ITextPara interface and implement @@ -10,7 +10,7 @@ Subject: riched20: Stub for ITextPara interface and implement 2 files changed, 729 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 39d352f..575f634 100644 +index 6cc4b09..76fc51d 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -47,11 +47,13 @@ DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xa @@ -26,8 +26,8 @@ index 39d352f..575f634 100644 +typedef struct ITextParaImpl ITextParaImpl; typedef struct IRichEditOleImpl { - IRichEditOle IRichEditOle_iface; -@@ -63,8 +65,19 @@ typedef struct IRichEditOleImpl { + IUnknown IUnknown_inner; +@@ -65,8 +67,19 @@ typedef struct IRichEditOleImpl { IOleClientSiteImpl *clientSite; struct list rangelist; struct list fontlist; @@ -47,24 +47,7 @@ index 39d352f..575f634 100644 struct ITextFontImpl { ITextFont ITextFont_iface; LONG ref; -@@ -154,6 +167,7 @@ IRichEditOle_fnRelease(IRichEditOle *me) - { - ITextRangeImpl *txtRge; - ITextFontImpl *txtFont; -+ ITextParaImpl *txtPara; - TRACE ("Destroying %p\n", This); - This->txtSel->reOle = NULL; - This->editor->reOle = NULL; -@@ -163,6 +177,8 @@ IRichEditOle_fnRelease(IRichEditOle *me) - txtRge->reOle = NULL; - LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) - txtFont->reOle = NULL; -+ LIST_FOR_EACH_ENTRY(txtPara, &This->paralist, ITextParaImpl, entry) -+ txtPara->reOle = NULL; - heap_free(This); - } - return ref; -@@ -474,6 +490,641 @@ static const IRichEditOleVtbl revt = { +@@ -494,6 +507,641 @@ static const IRichEditOleVtbl revt = { IRichEditOle_fnImportDataObject }; @@ -706,7 +689,7 @@ index 39d352f..575f634 100644 /* ITextFont interface */ static inline ITextFontImpl *impl_from_ITextFont(ITextFont *iface) { -@@ -1512,14 +2163,42 @@ static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont) +@@ -1532,14 +2180,42 @@ static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont) return E_NOTIMPL; } @@ -751,14 +734,31 @@ index 39d352f..575f634 100644 } static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *pPara) -@@ -3165,6 +3844,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) - *ppObj = reo; +@@ -3185,6 +3861,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p + TRACE("Created %p\n",reo); list_init(&reo->rangelist); list_init(&reo->fontlist); + list_init(&reo->paralist); + if (outer_unk) + reo->outer_unk = outer_unk; + else +@@ -3199,6 +3876,7 @@ void DestroyIRichEditOle(IRichEditOle *iface) + IRichEditOleImpl *This = impl_from_IRichEditOle(iface); + ITextRangeImpl *txtRge; + ITextFontImpl *txtFont; ++ ITextParaImpl *txtPara; - return 1; + TRACE("Destroying %p\n", This); + This->txtSel->reOle = NULL; +@@ -3209,6 +3887,8 @@ void DestroyIRichEditOle(IRichEditOle *iface) + txtRge->reOle = NULL; + LIST_FOR_EACH_ENTRY(txtFont, &This->fontlist, ITextFontImpl, entry) + txtFont->reOle = NULL; ++ LIST_FOR_EACH_ENTRY(txtPara, &This->paralist, ITextParaImpl, entry) ++ txtPara->reOle = NULL; + heap_free(This); } + diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index e9618d8..909d27e 100644 --- a/dlls/riched20/tests/richole.c @@ -823,5 +823,5 @@ index e9618d8..909d27e 100644 + test_ITextRange_GetPara(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0004-riched20-Fix-ME_RunOfsFromCharOfs-when-nCharOfs-strl.patch b/patches/riched20-IText_Interface/0004-riched20-Fix-ME_RunOfsFromCharOfs-when-nCharOfs-strl.patch index 0869f68e..f4560a5b 100644 --- a/patches/riched20-IText_Interface/0004-riched20-Fix-ME_RunOfsFromCharOfs-when-nCharOfs-strl.patch +++ b/patches/riched20-IText_Interface/0004-riched20-Fix-ME_RunOfsFromCharOfs-when-nCharOfs-strl.patch @@ -1,4 +1,4 @@ -From 4df3bc5e3f42cd7dc50c574baf544fc7bf95baff Mon Sep 17 00:00:00 2001 +From 48d9ee478bda1e5305965e0793af9ba844f704a5 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Wed, 13 Aug 2014 14:57:52 +0800 Subject: riched20: Fix ME_RunOfsFromCharOfs() when nCharOfs > strlen(). @@ -37,5 +37,5 @@ index 38d0270..ad08b82 100644 /****************************************************************************** -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0005-riched20-Implement-ITextRange-GetText.patch b/patches/riched20-IText_Interface/0005-riched20-Implement-ITextRange-GetText.patch index 347ad73d..106f92e7 100644 --- a/patches/riched20-IText_Interface/0005-riched20-Implement-ITextRange-GetText.patch +++ b/patches/riched20-IText_Interface/0005-riched20-Implement-ITextRange-GetText.patch @@ -1,4 +1,4 @@ -From 238e65a743387bbfce3c79ed8d00b757b51f6c48 Mon Sep 17 00:00:00 2001 +From 2980acb7084bfaddaa37a19e9961493a0a20cb0c Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Wed, 13 Aug 2014 15:40:11 +0800 Subject: riched20: Implement ITextRange::GetText. @@ -9,10 +9,10 @@ Subject: riched20: Implement ITextRange::GetText. 2 files changed, 67 insertions(+), 21 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 575f634..344bca5 100644 +index 76fc51d..63e0142 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -1953,14 +1953,40 @@ static HRESULT WINAPI ITextRange_fnInvoke(ITextRange *me, DISPID dispIdMember, R +@@ -1970,14 +1970,40 @@ static HRESULT WINAPI ITextRange_fnInvoke(ITextRange *me, DISPID dispIdMember, R return E_NOTIMPL; } @@ -55,7 +55,7 @@ index 575f634..344bca5 100644 } static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR bstr) -@@ -3037,8 +3063,6 @@ static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr) +@@ -3054,8 +3080,6 @@ static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr) { ITextSelectionImpl *This = impl_from_ITextSelection(me); ME_Cursor *start = NULL, *end = NULL; @@ -64,7 +64,7 @@ index 575f634..344bca5 100644 if (!This->reOle) return CO_E_RELEASED; -@@ -3047,23 +3071,7 @@ static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr) +@@ -3064,23 +3088,7 @@ static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr) return E_INVALIDARG; ME_GetSelection(This->reOle->editor, &start, &end); @@ -144,5 +144,5 @@ index 909d27e..0079b39 100644 + test_ITextRange_GetText(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch b/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch index e302daf3..3863b446 100644 --- a/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch +++ b/patches/riched20-IText_Interface/0006-riched20-Implement-ITextRange-SetRange.patch @@ -1,4 +1,4 @@ -From f966dc17572bb91ba94d3f898be8ccea7f1fd9e4 Mon Sep 17 00:00:00 2001 +From 6f514567079f943943d176edb86e15c85db3477b Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Wed, 13 Aug 2014 17:17:14 +0800 Subject: riched20: Implement ITextRange::SetRange. @@ -9,10 +9,10 @@ Subject: riched20: Implement ITextRange::SetRange. 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 344bca5..b693445 100644 +index 63e0142..0a59388 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -2309,14 +2309,36 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG Unit, LONG Inde +@@ -2326,14 +2326,36 @@ static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG Unit, LONG Inde return E_NOTIMPL; } @@ -51,7 +51,7 @@ index 344bca5..b693445 100644 } static HRESULT WINAPI ITextRange_fnInRange(ITextRange *me, ITextRange *pRange, LONG *pb) -@@ -2911,26 +2933,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2, +@@ -2928,26 +2950,12 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2, ITextRange** ppRange) { IRichEditOleImpl *This = impl_from_ITextDocument(me); @@ -131,5 +131,5 @@ index 0079b39..e7618f9 100644 + test_ITextRange_SetRange(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0007-riched20-Implement-ITextRange-IsEqual.patch b/patches/riched20-IText_Interface/0007-riched20-Implement-ITextRange-IsEqual.patch index 884c6f7a..3bdece9f 100644 --- a/patches/riched20-IText_Interface/0007-riched20-Implement-ITextRange-IsEqual.patch +++ b/patches/riched20-IText_Interface/0007-riched20-Implement-ITextRange-IsEqual.patch @@ -1,4 +1,4 @@ -From af9a503dc9c5bb5f15cfc5508521d8798fb7c924 Mon Sep 17 00:00:00 2001 +From 6ccbe61f2439e6af6919257535eec784e8398c2d Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Fri, 15 Aug 2014 14:27:21 +0800 Subject: riched20: Implement ITextRange::IsEqual. @@ -9,10 +9,10 @@ Subject: riched20: Implement ITextRange::IsEqual. 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index b693445..0174d8e 100644 +index 0a59388..3bb1b5a 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -2361,14 +2361,29 @@ static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, L +@@ -2378,14 +2378,29 @@ static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, L return E_NOTIMPL; } @@ -108,5 +108,5 @@ index e7618f9..7a4c8b5 100644 + test_ITextRange_IsEqual(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0008-riched20-Implement-ITextRange-GetStoryLength.patch b/patches/riched20-IText_Interface/0008-riched20-Implement-ITextRange-GetStoryLength.patch index 8de8c0f1..d5f37318 100644 --- a/patches/riched20-IText_Interface/0008-riched20-Implement-ITextRange-GetStoryLength.patch +++ b/patches/riched20-IText_Interface/0008-riched20-Implement-ITextRange-GetStoryLength.patch @@ -1,4 +1,4 @@ -From e604d5688ee6dee3737a1a6b9f94897b3e0e606a Mon Sep 17 00:00:00 2001 +From b3ca01e489e57615c3b5849bd301ecee19ddf4b1 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 18 Aug 2014 14:38:50 +0800 Subject: riched20: Implement ITextRange::GetStoryLength. @@ -9,10 +9,10 @@ Subject: riched20: Implement ITextRange::GetStoryLength. 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 0174d8e..60063ec 100644 +index 3bb1b5a..0bc302b 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -2243,8 +2243,10 @@ static HRESULT WINAPI ITextRange_fnGetStoryLength(ITextRange *me, LONG *pcch) +@@ -2260,8 +2260,10 @@ static HRESULT WINAPI ITextRange_fnGetStoryLength(ITextRange *me, LONG *pcch) if (!This->reOle) return CO_E_RELEASED; @@ -74,5 +74,5 @@ index 7a4c8b5..543f3ec 100644 + test_ITextRange_GetStoryLength(); } -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch b/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch index 9994cee9..cdffadc8 100644 --- a/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch +++ b/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch @@ -1,4 +1,4 @@ -From 72aec2670dc7071d0b03f65de3f0d7fb6525777f Mon Sep 17 00:00:00 2001 +From 58c621934c2fd7d20ebb3da783cfdcb8e28b1a10 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 18 Aug 2014 14:47:14 +0800 Subject: riched20: Implement ITextSelection::GetStoryLength. @@ -9,10 +9,10 @@ Subject: riched20: Implement ITextSelection::GetStoryLength. 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index 60063ec..13e5ba2 100644 +index 0bc302b..e42df2b 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -3281,8 +3281,10 @@ static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG * +@@ -3298,8 +3298,10 @@ static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG * if (!This->reOle) return CO_E_RELEASED; @@ -74,5 +74,5 @@ index 543f3ec..baed1f7 100644 test_ITextRange_GetChar(); test_ITextRange_GetStart_GetEnd(); -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0010-riched20-Fix-invalid-memory-access-when-parent-objec.patch b/patches/riched20-IText_Interface/0010-riched20-Fix-invalid-memory-access-when-parent-objec.patch index a8ffb36a..ffc9deae 100644 --- a/patches/riched20-IText_Interface/0010-riched20-Fix-invalid-memory-access-when-parent-objec.patch +++ b/patches/riched20-IText_Interface/0010-riched20-Fix-invalid-memory-access-when-parent-objec.patch @@ -1,4 +1,4 @@ -From 745a66e79c92ef7adc5debce9740e97c8e1866f9 Mon Sep 17 00:00:00 2001 +From 359a12d6dac0d8ef3560055d39d6ff59ed80fe5e Mon Sep 17 00:00:00 2001 From: Sebastian Lackner 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 13e5ba2..a0ba2dc 100644 +index e42df2b..fe9af6a 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -529,10 +529,13 @@ static ULONG WINAPI ITextPara_fnRelease(ITextPara *me) +@@ -546,10 +546,13 @@ static ULONG WINAPI ITextPara_fnRelease(ITextPara *me) ITextRange_Release(&This->txtRge->ITextRange_iface); else ITextSelection_Release(&This->txtSel->ITextSelection_iface); @@ -28,7 +28,7 @@ index 13e5ba2..a0ba2dc 100644 heap_free(This); } return ref; -@@ -1164,10 +1167,13 @@ static ULONG WINAPI ITextFont_fnRelease(ITextFont *me) +@@ -1181,10 +1184,13 @@ static ULONG WINAPI ITextFont_fnRelease(ITextFont *me) ITextRange_Release(&This->txtRge->ITextRange_iface); else ITextSelection_Release(&This->txtSel->ITextSelection_iface); @@ -45,5 +45,5 @@ index 13e5ba2..a0ba2dc 100644 } return ref; -- -2.1.1 +2.1.2 diff --git a/patches/riched20-IText_Interface/0011-riched20-Add-COM-aggregation-support-for-IRichEditOl.patch b/patches/riched20-IText_Interface/0011-riched20-Add-COM-aggregation-support-for-IRichEditOl.patch deleted file mode 100644 index ef9ffbea..00000000 --- a/patches/riched20-IText_Interface/0011-riched20-Add-COM-aggregation-support-for-IRichEditOl.patch +++ /dev/null @@ -1,219 +0,0 @@ -From cc2e88887b8a809a49d0712cf2423663510f9741 Mon Sep 17 00:00:00 2001 -From: Jactry Zeng -Date: Sun, 28 Sep 2014 13:17:49 +0800 -Subject: riched20: Add COM aggregation support for IRichEditOle. - ---- - dlls/riched20/editor.c | 4 +- - dlls/riched20/editor.h | 2 +- - dlls/riched20/richole.c | 98 ++++++++++++++++++++++++++++++++++--------------- - 3 files changed, 71 insertions(+), 33 deletions(-) - -diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c -index 3c0d970..a331001 100644 ---- a/dlls/riched20/editor.c -+++ b/dlls/riched20/editor.c -@@ -1194,7 +1194,7 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm - - if (!info->lpRichEditOle) - { -- CreateIRichEditOle(info->editor, (VOID**)&info->lpRichEditOle); -+ CreateIRichEditOle(NULL, info->editor, (VOID**)&info->lpRichEditOle); - } - - if (OleCreateDefaultHandler(&CLSID_NULL, NULL, &IID_IOleObject, (void**)&lpObject) == S_OK && -@@ -4474,7 +4474,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, - case EM_GETOLEINTERFACE: - { - if (!editor->reOle) -- if (!CreateIRichEditOle(editor, (LPVOID *)&editor->reOle)) -+ if (!CreateIRichEditOle(NULL, editor, (LPVOID *)&editor->reOle)) - return 0; - *(LPVOID *)lParam = editor->reOle; - IRichEditOle_AddRef(editor->reOle); -diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h -index edbac8e..75a3894 100644 ---- a/dlls/riched20/editor.h -+++ b/dlls/riched20/editor.h -@@ -240,7 +240,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) DECLSPEC_HIDDEN; - int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN; - - /* richole.c */ --LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *) DECLSPEC_HIDDEN; -+LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj) DECLSPEC_HIDDEN; - void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run* run, ME_Paragraph *para, BOOL selected) DECLSPEC_HIDDEN; - void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN; - void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src) DECLSPEC_HIDDEN; -diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index a0ba2dc..7e620ef 100644 ---- a/dlls/riched20/richole.c -+++ b/dlls/riched20/richole.c -@@ -56,8 +56,10 @@ typedef struct ITextFontImpl ITextFontImpl; - typedef struct ITextParaImpl ITextParaImpl; - - typedef struct IRichEditOleImpl { -+ IUnknown IUnknown_inner; - IRichEditOle IRichEditOle_iface; - ITextDocument ITextDocument_iface; -+ IUnknown *outer_unk; - LONG ref; - - ME_TextEditor *editor; -@@ -111,54 +113,45 @@ struct IOleClientSiteImpl { - IRichEditOleImpl *reOle; - }; - --static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface) -+static inline IRichEditOleImpl *impl_from_IUnknown(IUnknown *iface) - { -- return CONTAINING_RECORD(iface, IRichEditOleImpl, IRichEditOle_iface); -+ return CONTAINING_RECORD(iface, IRichEditOleImpl, IUnknown_inner); - } - --static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface) -+static HRESULT WINAPI IRichEditOleImpl_fnQueryInterface(IUnknown *iface, REFIID riid, LPVOID* ppvObj) - { -- return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument_iface); --} -+ IRichEditOleImpl *This = impl_from_IUnknown(iface); - --static HRESULT WINAPI --IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj) --{ -- IRichEditOleImpl *This = impl_from_IRichEditOle(me); -- -- TRACE("%p %s\n", This, debugstr_guid(riid) ); -+ TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObj); - -- *ppvObj = NULL; -- if (IsEqualGUID(riid, &IID_IUnknown) || -- IsEqualGUID(riid, &IID_IRichEditOle)) -+ if (IsEqualGUID(riid, &IID_IUnknown)) -+ *ppvObj = &This->IUnknown_inner; -+ else if (IsEqualGUID(riid, &IID_IRichEditOle)) - *ppvObj = &This->IRichEditOle_iface; - else if (IsEqualGUID(riid, &IID_ITextDocument)) - *ppvObj = &This->ITextDocument_iface; -- if (*ppvObj) -- { -- IRichEditOle_AddRef(me); -- return S_OK; -+ else { -+ FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid)); -+ return E_NOINTERFACE; - } -- FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid) ); -- -- return E_NOINTERFACE; -+ -+ IUnknown_AddRef((IUnknown *)*ppvObj); -+ return S_OK; - } - --static ULONG WINAPI --IRichEditOle_fnAddRef(IRichEditOle *me) -+static ULONG WINAPI IRichEditOleImpl_fnAddRef(IUnknown *iface) - { -- IRichEditOleImpl *This = impl_from_IRichEditOle(me); -- ULONG ref = InterlockedIncrement( &This->ref ); -+ IRichEditOleImpl *This = impl_from_IUnknown(iface); -+ ULONG ref = InterlockedIncrement(&This->ref); - - TRACE("%p ref = %u\n", This, ref); - - return ref; - } - --static ULONG WINAPI --IRichEditOle_fnRelease(IRichEditOle *me) -+static ULONG WINAPI IRichEditOleImpl_fnRelease(IUnknown *iface) - { -- IRichEditOleImpl *This = impl_from_IRichEditOle(me); -+ IRichEditOleImpl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE ("%p ref=%u\n", This, ref); -@@ -184,6 +177,44 @@ IRichEditOle_fnRelease(IRichEditOle *me) - return ref; - } - -+static const IUnknownVtbl reo_unk_vtbl = -+{ -+ IRichEditOleImpl_fnQueryInterface, -+ IRichEditOleImpl_fnAddRef, -+ IRichEditOleImpl_fnRelease -+}; -+ -+static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface) -+{ -+ return CONTAINING_RECORD(iface, IRichEditOleImpl, IRichEditOle_iface); -+} -+ -+static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface) -+{ -+ return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument_iface); -+} -+ -+static HRESULT WINAPI -+IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj) -+{ -+ IRichEditOleImpl *This = impl_from_IRichEditOle(me); -+ return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj); -+} -+ -+static ULONG WINAPI -+IRichEditOle_fnAddRef(IRichEditOle *me) -+{ -+ IRichEditOleImpl *This = impl_from_IRichEditOle(me); -+ return IUnknown_AddRef(This->outer_unk); -+} -+ -+static ULONG WINAPI -+IRichEditOle_fnRelease(IRichEditOle *me) -+{ -+ IRichEditOleImpl *This = impl_from_IRichEditOle(me); -+ return IUnknown_Release(This->outer_unk); -+} -+ - static HRESULT WINAPI - IRichEditOle_fnActivateAs(IRichEditOle *me, REFCLSID rclsid, REFCLSID rclsidAs) - { -@@ -3856,7 +3887,7 @@ CreateTextSelection(IRichEditOleImpl *reOle) - return txtSel; - } - --LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) -+LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppObj) - { - IRichEditOleImpl *reo; - -@@ -3864,6 +3895,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) - if (!reo) - return 0; - -+ reo->IUnknown_inner.lpVtbl = &reo_unk_vtbl; - reo->IRichEditOle_iface.lpVtbl = &revt; - reo->ITextDocument_iface.lpVtbl = &tdvt; - reo->ref = 1; -@@ -3882,11 +3914,17 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) - return 0; - } - TRACE("Created %p\n",reo); -- *ppObj = reo; -+ - list_init(&reo->rangelist); - list_init(&reo->fontlist); - list_init(&reo->paralist); - -+ if (outer_unk) -+ reo->outer_unk = outer_unk; -+ else -+ reo->outer_unk = &reo->IUnknown_inner; -+ *ppObj = reo; -+ - return 1; - } - --- -2.1.1 - diff --git a/patches/riched20-IText_Interface/0012-riched20-Add-IID_IRichEditOle-and-IID_ITextDocument-.patch b/patches/riched20-IText_Interface/0012-riched20-Add-IID_IRichEditOle-and-IID_ITextDocument-.patch deleted file mode 100644 index 7344a7a4..00000000 --- a/patches/riched20-IText_Interface/0012-riched20-Add-IID_IRichEditOle-and-IID_ITextDocument-.patch +++ /dev/null @@ -1,137 +0,0 @@ -From b6666769086bb06cfeacfe81f733749a811ff0fa Mon Sep 17 00:00:00 2001 -From: Jactry Zeng -Date: Sun, 28 Sep 2014 14:03:15 +0800 -Subject: riched20: Add IID_IRichEditOle and IID_ITextDocument support for - ITextServices::QueryInterface. - ---- - dlls/riched20/tests/txtsrv.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ - dlls/riched20/txtsrv.c | 11 ++++++- - 2 files changed, 79 insertions(+), 1 deletion(-) - -diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c -index 3401f8b..c154e2d 100644 ---- a/dlls/riched20/tests/txtsrv.c -+++ b/dlls/riched20/tests/txtsrv.c -@@ -29,6 +29,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - #include -@@ -862,6 +864,72 @@ static void test_COM(void) - IUnknown_Release(unk_obj.inner_unk); - } - -+static ULONG get_refcount(IUnknown *iface) -+{ -+ IUnknown_AddRef(iface); -+ return IUnknown_Release(iface); -+} -+ -+static void test_QueryInterface(void) -+{ -+ HRESULT hres; -+ IRichEditOle *reole, *txtsrv_reole; -+ ITextDocument *txtdoc, *txtsrv_txtdoc; -+ ULONG refcount; -+ -+ if(!init_texthost()) -+ return; -+ -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 1, "got wrong ref count: %d\n", refcount); -+ -+ /* IID_IRichEditOle */ -+ hres = ITextServices_QueryInterface(txtserv, &IID_IRichEditOle, (void **)&txtsrv_reole); -+ ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 2, "got wrong ref count: %d\n", refcount); -+ refcount = get_refcount((IUnknown *)txtsrv_reole); -+ ok(refcount == 2, "got wrong ref count: %d\n", refcount); -+ -+ hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument, (void **)&txtdoc); -+ ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 3, "got wrong ref count: %d\n", refcount); -+ refcount = get_refcount((IUnknown *)txtsrv_reole); -+ ok(refcount == 3, "got wrong ref count: %d\n", refcount); -+ -+ ITextDocument_Release(txtdoc); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 2, "got wrong ref count: %d\n", refcount); -+ IRichEditOle_Release(txtsrv_reole); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 1, "got wrong ref count: %d\n", refcount); -+ -+ /* IID_ITextDocument */ -+ hres = ITextServices_QueryInterface(txtserv, &IID_ITextDocument, (void **)&txtsrv_txtdoc); -+ ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 2, "got wrong ref count: %d\n", refcount); -+ refcount = get_refcount((IUnknown *)txtsrv_txtdoc); -+ ok(refcount == 2, "got wrong ref count: %d\n", refcount); -+ -+ hres = ITextDocument_QueryInterface(txtsrv_txtdoc, &IID_IRichEditOle, (void **)&reole); -+ ok(hres == S_OK, "ITextDocument_QueryInterface: 0x%08x\n", hres); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 3, "got wrong ref count: %d\n", refcount); -+ refcount = get_refcount((IUnknown *)txtsrv_txtdoc); -+ ok(refcount == 3, "got wrong ref count: %d\n", refcount); -+ -+ IRichEditOle_Release(reole); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 2, "got wrong ref count: %d\n", refcount); -+ ITextDocument_Release(txtsrv_txtdoc); -+ refcount = get_refcount((IUnknown *)txtserv); -+ ok(refcount == 1, "got wrong ref count: %d\n", refcount); -+ -+ free_texthost(); -+} -+ - START_TEST( txtsrv ) - { - setup_thiscall_wrappers(); -@@ -887,6 +955,7 @@ START_TEST( txtsrv ) - test_TxSetText(); - test_TxGetNaturalSize(); - test_TxDraw(); -+ test_QueryInterface(); - } - if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE); - } -diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c -index 636efff..bfe2c7c 100644 ---- a/dlls/riched20/txtsrv.c -+++ b/dlls/riched20/txtsrv.c -@@ -29,6 +29,7 @@ - #include "ole2.h" - #include "oleauto.h" - #include "richole.h" -+#include "tom.h" - #include "imm.h" - #include "textserv.h" - #include "wine/debug.h" -@@ -79,7 +80,15 @@ static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID r - *ppv = &This->IUnknown_inner; - else if (IsEqualIID(riid, &IID_ITextServices)) - *ppv = &This->ITextServices_iface; -- else { -+ else if (IsEqualIID(riid, &IID_IRichEditOle) || IsEqualIID(riid, &IID_ITextDocument)) -+ { -+ if (!This->editor->reOle) -+ if (!CreateIRichEditOle(This->outer_unk, This->editor, (LPVOID *)&(This->editor->reOle))) -+ return E_OUTOFMEMORY; -+ return IRichEditOle_QueryInterface(This->editor->reOle, riid, ppv); -+ } -+ else -+ { - *ppv = NULL; - FIXME("Unknown interface: %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; --- -2.1.1 - diff --git a/patches/riched20-IText_Interface/definition b/patches/riched20-IText_Interface/definition index 3bd5ece1..356e7dab 100644 --- a/patches/riched20-IText_Interface/definition +++ b/patches/riched20-IText_Interface/definition @@ -18,14 +18,5 @@ Author: Jactry Zeng Subject: Implement ITextRange/Selection::{GetText,SetRange,IsEqual,GetStoryLength}. Revision: 1 -Author: Jactry Zeng -Subject: Add COM aggregation support for IRichEditOle. -Revision: 1 - -Author: Jactry Zeng -Subject: Implement IRichEditOle and ITextDocument support for ITextServices. -Revision: 1 - Fixes: [12458] Support for ITextDocument_fnRange function Fixes: [18303] Support for ITextRange, ITextFont and ITextPara -Fixes: [17042] Support for IRichEditOle and ITextDocument support for ITextServices.