Daniel Jelinski : shell32: Simplify cut/copy operations.

Alexandre Julliard julliard at winehq.org
Tue Aug 20 14:38:38 CDT 2013


Module: wine
Branch: master
Commit: b49c9ac923a7b83c7fe73412a0702f3042e9690e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b49c9ac923a7b83c7fe73412a0702f3042e9690e

Author: Daniel Jelinski <djelinski1 at gmail.com>
Date:   Sun Aug 11 01:02:58 2013 +0200

shell32: Simplify cut/copy operations.

---

 dlls/shell32/shlview_cmenu.c |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c
index 6004afc..4c4edef 100644
--- a/dlls/shell32/shlview_cmenu.c
+++ b/dlls/shell32/shlview_cmenu.c
@@ -257,29 +257,17 @@ static void DoDelete(ContextMenu *This)
  *
  * copies the currently selected items into the clipboard
  */
-static BOOL DoCopyOrCut(ContextMenu *This, HWND hwnd, BOOL cut)
+static void DoCopyOrCut(ContextMenu *This, HWND hwnd, BOOL cut)
 {
     IDataObject *dataobject;
-    IShellBrowser *browser;
-    IShellView *view;
 
     TRACE("(%p)->(wnd=%p, cut=%d)\n", This, hwnd, cut);
 
-    /* get the active IShellView */
-    if ((browser = (IShellBrowser*)SendMessageA(hwnd, CWM_GETISHELLBROWSER, 0, 0)))
+    if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->parent, hwnd, This->cidl, (LPCITEMIDLIST*)This->apidl, &IID_IDataObject, 0, (void**)&dataobject)))
     {
-        if (SUCCEEDED(IShellBrowser_QueryActiveShellView(browser, &view)))
-        {
-            if (SUCCEEDED(IShellView_GetItemObject(view, SVGIO_SELECTION, &IID_IDataObject, (void**)&dataobject)))
-	    {
-                OleSetClipboard(dataobject);
-                IDataObject_Release(dataobject);
-	    }
-            IShellView_Release(view);
-        }
+        OleSetClipboard(dataobject);
+        IDataObject_Release(dataobject);
     }
-
-    return TRUE;
 }
 
 /**************************************************************************




More information about the wine-cvs mailing list