Author: dquintana
Date: Sat Mar 15 21:44:49 2014
New Revision: 62510
URL:
http://svn.reactos.org/svn/reactos?rev=62510&view=rev
Log:
[RSHELL]
* Make this crazy nested conditional mess a bit flatter.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Sat Mar 15
21:44:49 2014
@@ -347,33 +347,19 @@
return hr;
}
- CComPtr<IObjectWithSite> ows;
- if (SUCCEEDED(m_subMenuParent->QueryInterface(IID_PPV_ARG(IObjectWithSite,
&ows))))
- {
- CComPtr<IServiceProvider> sp;
- if (SUCCEEDED(ows->GetSite(IID_PPV_ARG(IServiceProvider, &sp))))
- {
- CComPtr<IDeskBar> db0;
- if (SUCCEEDED(sp->QueryInterface(IID_PPV_ARG(IDeskBar, &db0))))
- {
- CComPtr<IUnknown> unk0;
- if (SUCCEEDED(db0->GetClient(&unk0)))
- {
- CComPtr<IDeskBar> db;
- if (SUCCEEDED(IUnknown_QueryService(unk0, SID_SMenuBandChild,
IID_PPV_ARG(IDeskBar, &db))))
- {
- CComPtr<IDeskBar> db1;
- if (SUCCEEDED(IUnknown_QueryService(m_site, SID_SMenuBandParent,
IID_PPV_ARG(IDeskBar, &db1))))
- {
- if (fShow)
- db->SetClient(db1);
- else
- db->SetClient(NULL);
- }
- }
- }
- }
- }
+ CComPtr<IServiceProvider> sp;
+ CComPtr<IUnknown> unk0;
+ CComPtr<IDeskBar> db0, db, db1;
+ if (SUCCEEDED(IUnknown_GetSite(m_subMenuParent, IID_PPV_ARG(IServiceProvider,
&sp))) &&
+ SUCCEEDED(sp->QueryInterface(IID_PPV_ARG(IDeskBar, &db0))) &&
+ SUCCEEDED(db0->GetClient(&unk0)) &&
+ SUCCEEDED(IUnknown_QueryService(unk0, SID_SMenuBandChild, IID_PPV_ARG(IDeskBar,
&db))) &&
+ SUCCEEDED(IUnknown_QueryService(m_site, SID_SMenuBandParent,
IID_PPV_ARG(IDeskBar, &db1))))
+ {
+ if (fShow)
+ db->SetClient(db1);
+ else
+ db->SetClient(NULL);
}
if (m_dwFlags & SMINIT_VERTICAL)