Author: dquintana
Date: Sat Jun 28 18:05:01 2014
New Revision: 63659
URL:
http://svn.reactos.org/svn/reactos?rev=63659&view=rev
Log:
[RSHELL]
* Fix a 6am whoops.
* Simplify the FindPidlInList method.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Sat Jun 28
18:05:01 2014
@@ -1260,7 +1260,7 @@
IEnumIDList * eidl;
m_shellFolder->EnumObjects(GetToolbar(), SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
&eidl);
- LPITEMIDLIST item = { 0 };
+ LPITEMIDLIST item = NULL;
hr = eidl->Next(1, &item, NULL);
while (hr == S_OK)
{
Modified: branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] Sat Jun 28
18:05:01 2014
@@ -256,85 +256,24 @@
TRACE("Comparing with item at %d with side %d and pidl { cb=%d }\n", i,
info.side, info.pidl->mkid.cb);
+ CComPtr<IShellFolder> fld;
if (info.side <= 0)
- {
-#if 0
- LPWSTR name1;
- LPWSTR name2;
- STRRET str1 = { STRRET_WSTR, 0 };
- STRRET str2 = { STRRET_WSTR, 0 };
- hr = m_UserLocalFolder->GetDisplayNameOf(info->pidl, SHGDN_FORPARSING |
SHGDN_INFOLDER, &str1);
- if (FAILED(hr))
- return hr;
- hr = m_UserLocalFolder->GetDisplayNameOf(pcidl, SHGDN_FORPARSING |
SHGDN_INFOLDER, &str2);
- if (FAILED(hr))
- return hr;
- StrRetToStrW(&str1, info->pidl, &name1);
- StrRetToStrW(&str2, pcidl, &name2);
- int order = StrCmpW(name1, name2);
- CoTaskMemFree(name1);
- CoTaskMemFree(name2);
-
- if (order == 0)
- {
- *pinfo = *info;
- return S_OK;
- }
-#else
- // FIXME: This works in windows.
- hr = m_UserLocalFolder->CompareIDs(0, info.pidl, pcidl);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
- if (hr == S_OK)
- {
- *pinfo = info;
- return S_OK;
- }
- else
- {
- TRACE("Comparison returned %d\n", (int) (short) (hr &
0xFFFF));
- }
-#endif
- }
+ fld = m_UserLocalFolder;
else
- {
-#if 0
- LPWSTR name1;
- LPWSTR name2;
- STRRET str1 = { STRRET_WSTR, 0 };
- STRRET str2 = { STRRET_WSTR, 0 };
- hr = m_AllUSersFolder->GetDisplayNameOf(info->pidl, SHGDN_FORPARSING |
SHGDN_INFOLDER, &str1);
- if (FAILED(hr))
- return hr;
- hr = m_AllUSersFolder->GetDisplayNameOf(pcidl, SHGDN_FORPARSING |
SHGDN_INFOLDER, &str2);
- if (FAILED(hr))
- return hr;
- StrRetToStrW(&str1, info->pidl, &name1);
- StrRetToStrW(&str2, pcidl, &name2);
- int order = StrCmpW(name1, name2);
- CoTaskMemFree(name1);
- CoTaskMemFree(name2);
-
- if (order == 0)
- {
- *pinfo = *info;
- return S_OK;
- }
-#else
- // FIXME: This works in windows.
- hr = m_AllUSersFolder->CompareIDs(0, info.pidl, pcidl);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
- if (hr == S_OK)
- {
- *pinfo = info;
- return S_OK;
- }
- else
- {
- TRACE("Comparison returned %d\n", (int) (short) (hr &
0xFFFF));
- }
-#endif
+ fld = m_AllUSersFolder;
+
+ hr = m_AllUSersFolder->CompareIDs(0, info.pidl, pcidl);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ if (hr == S_OK)
+ {
+ *pinfo = info;
+ return S_OK;
+ }
+ else
+ {
+ TRACE("Comparison returned %d\n", (int) (short) (hr &
0xFFFF));
}
}