From fc618ab041e3c45a10cdbecc44203d70d3bb73b6 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Mon, 10 Aug 2009 10:53:48 -0400 Subject: [PATCH] richedit: Add closing actions for IRichEditOle_fnInsertObject. Previously inserting the object didn't result in the text being wrapped, which would cause an assertion error when this is checked for during repainting the text. It is also important to invalidate the affected areas of text, update the scrollbar, and end the creation of undo transactions for this insertion. --- dlls/riched20/caret.c | 2 +- dlls/riched20/richole.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 33dbdaf013a..058d278296f 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -459,7 +459,7 @@ void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCur MERF_GRAPHICS); di->member.run.ole_obj = ALLOC_OBJ(*reo); ME_CopyReObject(di->member.run.ole_obj, reo); - ME_SendSelChange(editor); + ME_ReleaseStyle(pStyle); } diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 326ecc537d5..61cf6bb9389 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -388,6 +388,8 @@ IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *reo) if (reo->polesite) IOleClientSite_AddRef(reo->polesite); ME_InsertOLEFromCursor(This->editor, reo, 0); + ME_CommitUndo(This->editor); + ME_UpdateRepaint(This->editor); return S_OK; }