The character position should be filled in REOBJECT which IRichEditOle::GetObject returns.
Signed-off-by: Dongwan Kim kdw6485@gmail.com --- dlls/riched20/caret.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index beac8af50a1..9e1bb17b7f4 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -462,6 +462,7 @@ void editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo) struct re_object *reobj_prev = NULL; ME_Cursor *cursor, cursor_from_ofs; ME_Style *style; + LONG cp = 0;
if (reo->cp == REO_CP_SELECTION) cursor = editor->pCursors; @@ -482,12 +483,16 @@ void editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo) prev = run; while ((prev = run_prev_all_paras( prev ))) { + cp += prev->len; if (prev->reobj) { reobj_prev = prev->reobj; + cp += prev->reobj->obj.cp; break; } } + if(run->reobj->obj.cp == REO_CP_SELECTION) + run->reobj->obj.cp = cp; if (reobj_prev) list_add_after(&reobj_prev->entry, &run->reobj->entry); else