Author: gadamopoulos
Date: Wed Dec 17 12:11:31 2014
New Revision: 65700
URL:
http://svn.reactos.org/svn/reactos?rev=65700&view=rev
Log:
[RSHELL]
- Simplify some code by using shlwapi helpers
- See issue CORE-8919
Modified:
trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
Modified: trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuDes…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Wed Dec 17 12:11:31
2014
@@ -89,13 +89,7 @@
HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(IUnknown *punkObj, BOOL
fSetFocus)
{
- CComPtr<IInputObjectSite> ios;
-
- HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IInputObjectSite, &ios));
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- return ios->OnFocusChangeIS(punkObj, fSetFocus);
+ return IUnknown_OnFocusChangeIS(m_Client, punkObj, fSetFocus);
}
HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryStatus(const GUID *pguidCmdGroup, ULONG
cCmds,
@@ -177,24 +171,12 @@
HRESULT STDMETHODCALLTYPE CMenuDeskBar::HasFocusIO()
{
- CComPtr<IInputObject> io;
-
- HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IInputObject, &io));
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- return io->HasFocusIO();
+ return IUnknown_HasFocusIO(m_Client);
}
HRESULT STDMETHODCALLTYPE CMenuDeskBar::TranslateAcceleratorIO(LPMSG lpMsg)
{
- CComPtr<IInputObject> io;
-
- HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IInputObject, &io));
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- return io->TranslateAcceleratorIO(lpMsg);
+ return IUnknown_TranslateAcceleratorIO(m_Client, lpMsg);
}
HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetClient(IUnknown *punkClient)
@@ -564,20 +546,15 @@
while (popup)
{
HRESULT hr;
- CComPtr<IOleWindow> window;
-
- hr = popup->QueryInterface(IID_PPV_ARG(IOleWindow, &window));
+ HWND parent;
+
+ hr = IUnknown_GetWindow(popup, &parent);
if (FAILED_UNEXPECTEDLY(hr))
return FALSE;
-
- HWND parent;
-
- hr = window->GetWindow(&parent);
- if (SUCCEEDED(hr) && hwnd == parent)
+ if (hwnd == parent)
return TRUE;
- popup = NULL;
- hr = IUnknown_GetSite(window, IID_PPV_ARG(IMenuPopup, &popup));
+ hr = IUnknown_GetSite(popup, IID_PPV_ARG(IMenuPopup, &popup));
if (FAILED(hr))
return FALSE;
}