Commit 5c2522d7 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

riched20: Use ME_GetSelectionType() in ME_ShowContextMenu() for getting type of selection.

parent 915201a1
...@@ -3005,19 +3005,12 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y) ...@@ -3005,19 +3005,12 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
{ {
CHARRANGE selrange; CHARRANGE selrange;
HMENU menu; HMENU menu;
int seltype = 0; int seltype;
if(!editor->lpOleCallback || !editor->hWnd) if(!editor->lpOleCallback || !editor->hWnd)
return FALSE; return FALSE;
ME_GetSelectionOfs(editor, &selrange.cpMin, &selrange.cpMax); ME_GetSelectionOfs(editor, &selrange.cpMin, &selrange.cpMax);
if(selrange.cpMin == selrange.cpMax) seltype = ME_GetSelectionType(editor);
seltype |= SEL_EMPTY;
else
{
/* FIXME: Handle objects */
seltype |= SEL_TEXT;
if(selrange.cpMax-selrange.cpMin > 1)
seltype |= SEL_MULTICHAR;
}
if(SUCCEEDED(IRichEditOleCallback_GetContextMenu(editor->lpOleCallback, seltype, NULL, &selrange, &menu))) if(SUCCEEDED(IRichEditOleCallback_GetContextMenu(editor->lpOleCallback, seltype, NULL, &selrange, &menu)))
{ {
TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, editor->hwndParent, NULL); TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, editor->hwndParent, NULL);
......
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