https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f0d6d9896db556f42a0d8…
commit f0d6d9896db556f42a0d84f5b720cf183a67b96c
Author: Brock Mammen <brockmammen(a)gmail.com>
AuthorDate: Tue May 19 11:33:39 2020 -0500
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Aug 16 19:02:42 2020 +0300
[SHELLFIND] Fix column sorting (#2814)
CORE-16825
---
dll/win32/browseui/shellfind/CFindFolder.cpp | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dll/win32/browseui/shellfind/CFindFolder.cpp
b/dll/win32/browseui/shellfind/CFindFolder.cpp
index 19814517bb2..fb6ba371dda 100644
--- a/dll/win32/browseui/shellfind/CFindFolder.cpp
+++ b/dll/win32/browseui/shellfind/CFindFolder.cpp
@@ -538,7 +538,20 @@ STDMETHODIMP CFindFolder::BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC
pbcReserve
STDMETHODIMP CFindFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1,
PCUIDLIST_RELATIVE pidl2)
{
- return m_pisfInner->CompareIDs(lParam, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
+ WORD wColumn = LOWORD(lParam);
+ switch (wColumn)
+ {
+ case 0: // Name
+ break;
+ case 1: // Path
+ return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
+ case 2: // Relevance
+ return E_NOTIMPL;
+ default: // Default columns
+ wColumn -= _countof(g_ColumnDefs) - 1;
+ break;
+ }
+ return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1),
_ILGetFSPidl(pidl2));
}
STDMETHODIMP CFindFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)