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.
This commit is contained in:
parent
71cb069246
commit
fc618ab041
|
@ -459,7 +459,7 @@ void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCur
|
||||||
MERF_GRAPHICS);
|
MERF_GRAPHICS);
|
||||||
di->member.run.ole_obj = ALLOC_OBJ(*reo);
|
di->member.run.ole_obj = ALLOC_OBJ(*reo);
|
||||||
ME_CopyReObject(di->member.run.ole_obj, reo);
|
ME_CopyReObject(di->member.run.ole_obj, reo);
|
||||||
ME_SendSelChange(editor);
|
ME_ReleaseStyle(pStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -388,6 +388,8 @@ IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *reo)
|
||||||
if (reo->polesite) IOleClientSite_AddRef(reo->polesite);
|
if (reo->polesite) IOleClientSite_AddRef(reo->polesite);
|
||||||
|
|
||||||
ME_InsertOLEFromCursor(This->editor, reo, 0);
|
ME_InsertOLEFromCursor(This->editor, reo, 0);
|
||||||
|
ME_CommitUndo(This->editor);
|
||||||
|
ME_UpdateRepaint(This->editor);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue