Commit 164897e6 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

riched20: Fetch extent from object if REOBJECT::sizel is unset.

parent a7d29d16
......@@ -464,6 +464,7 @@ HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo)
ME_Cursor *cursor, cursor_from_ofs;
ME_Style *style;
HRESULT hr;
SIZEL extent;
if (editor->lpOleCallback)
{
......@@ -472,6 +473,17 @@ HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo)
return hr;
}
extent = reo->sizel;
if (!extent.cx && !extent.cy && reo->poleobj)
{
hr = IOleObject_GetExtent( reo->poleobj, DVASPECT_CONTENT, &extent );
if (FAILED(hr))
{
extent.cx = 0;
extent.cy = 0;
}
}
if (reo->cp == REO_CP_SELECTION)
cursor = editor->pCursors;
else
......@@ -487,6 +499,7 @@ HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo)
run = run_insert( editor, cursor, style, &space, 1, MERF_GRAPHICS );
run->reobj = create_re_object( reo, run );
run->reobj->obj.sizel = extent;
prev = run;
while ((prev = run_prev_all_paras( prev )))
......
......@@ -4217,9 +4217,7 @@ static void subtest_InsertObject(struct reolecb_obj *callback)
reobj.cbStruct = sizeof(reobj);
hr = IRichEditOle_GetObject(reole, 0, &reobj, REO_GETOBJ_NO_INTERFACES);
ok(hr == S_OK, "IRichEditOle_GetObject got hr %#lx.\n", hr);
todo_wine
ok(reobj.sizel.cx == 800, "expected reobj.sizel.cx to be %ld, got %ld\n", 800L, reobj.sizel.cx);
todo_wine
ok(reobj.sizel.cy == 400, "expected reobj.sizel.cy to be %ld, got %ld\n", 400L, reobj.sizel.cy);
IOleClientSite_Release(clientsite);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment