Superseded patch 144990. Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/riched20/editor.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index eb67e11fdd..820b0380c7 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3005,19 +3005,12 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y) { CHARRANGE selrange; HMENU menu; - int seltype = 0; + int seltype; + if(!editor->lpOleCallback || !editor->hWnd) return FALSE; ME_GetSelectionOfs(editor, &selrange.cpMin, &selrange.cpMax); - if(selrange.cpMin == selrange.cpMax) - seltype |= SEL_EMPTY; - else - { - /* FIXME: Handle objects */ - seltype |= SEL_TEXT; - if(selrange.cpMax-selrange.cpMin > 1) - seltype |= SEL_MULTICHAR; - } + seltype = ME_GetSelectionType(editor); if(SUCCEEDED(IRichEditOleCallback_GetContextMenu(editor->lpOleCallback, seltype, NULL, &selrange, &menu))) { TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, editor->hwndParent, NULL);