On Tue, Apr 17, 2018 at 10:49:01PM +0800, Jactry Zeng wrote:
Signed-off-by: Jactry Zeng <jzeng(a)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 df1f1870cd..74540f88d9 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 = SEL_EMPTY; + 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; - } + ME_GetSelectionType(editor);
You'll want to actually use the selection type ;-/
if(SUCCEEDED(IRichEditOleCallback_GetContextMenu(editor->lpOleCallback, seltype, NULL, &selrange, &menu))) { TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, editor->hwndParent, NULL);