riched20: Move DestroyIRichEditOle() into IRichEditOle:Release().
Francois Gouget
fgouget at free.fr
Mon Jan 5 12:42:20 CST 2015
---
a9491ec5 split off DestroyIRichEditOle() from
IRichEditOleImpl_inner_fnRelease() among other things, but 27ac8d26
essentially reverted that part which left
IRichEditOleImpl_inner_fnRelease() as a thin wrapper around
DestroyIRichEditOle() and its only user. So I think it makes more sense
to merge the two, again.
dlls/riched20/editor.h | 1 -
dlls/riched20/richole.c | 28 ++++++++++++----------------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index d8abe4e..e4c13a9 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -241,7 +241,6 @@ int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN;
/* richole.c */
LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj) DECLSPEC_HIDDEN;
-void DestroyIRichEditOle(IRichEditOle *iface) 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 0788125..1280016 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -143,7 +143,18 @@ static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface)
TRACE ("%p ref=%u\n", This, ref);
if (!ref)
- DestroyIRichEditOle(&This->IRichEditOle_iface);
+ {
+ ITextRangeImpl *txtRge;
+
+ TRACE("Destroying %p\n", This);
+ This->txtSel->reOle = NULL;
+ This->editor->reOle = NULL;
+ ITextSelection_Release(&This->txtSel->ITextSelection_iface);
+ IOleClientSite_Release(&This->clientSite->IOleClientSite_iface);
+ LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry)
+ txtRge->reOle = NULL;
+ heap_free(This);
+ }
return ref;
}
@@ -2365,21 +2376,6 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p
return 1;
}
-void DestroyIRichEditOle(IRichEditOle *iface)
-{
- IRichEditOleImpl *This = impl_from_IRichEditOle(iface);
- ITextRangeImpl *txtRge;
-
- TRACE("Destroying %p\n", This);
- This->txtSel->reOle = NULL;
- This->editor->reOle = NULL;
- ITextSelection_Release(&This->txtSel->ITextSelection_iface);
- IOleClientSite_Release(&This->clientSite->IOleClientSite_iface);
- LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry)
- txtRge->reOle = NULL;
- heap_free(This);
-}
-
static void convert_sizel(const ME_Context *c, const SIZEL* szl, SIZE* sz)
{
/* sizel is in .01 millimeters, sz in pixels */
--
2.1.4
More information about the wine-patches
mailing list