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

Alexandre Julliard julliard at winehq.org
Thu Apr 19 16:54:19 CDT 2018


Module: wine
Branch: master
Commit: 5c2522d713966efdd96d294003c6692cdebfe09f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5c2522d713966efdd96d294003c6692cdebfe09f

Author: Jactry Zeng <jzeng at codeweavers.com>
Date:   Thu Apr 19 17:45:04 2018 +0800

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

Signed-off-by: Jactry Zeng <jzeng at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 eb67e11..820b038 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);




More information about the wine-cvs mailing list