From ba8f75557a062e09d5687376f2b2947234653a8a Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 27 Oct 2017 12:32:26 +0200 Subject: [PATCH] [SHELL32][REGEDIT][MSCONFIG_NEW] Correctly check for presence of list view sort header. --- base/applications/msconfig_new/comctl32ex/listview.c | 2 +- base/applications/regedit/listview.c | 2 +- dll/win32/shell32/CDefView.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base/applications/msconfig_new/comctl32ex/listview.c b/base/applications/msconfig_new/comctl32ex/listview.c index 0eab585b3d3..9e5f533998e 100644 --- a/base/applications/msconfig_new/comctl32ex/listview.c +++ b/base/applications/msconfig_new/comctl32ex/listview.c @@ -49,7 +49,7 @@ ListView_SortEx(HWND hListView, BOOL bSortAsc; Sort sort; - if ((GetWindowLongPtr(hListView, GWL_STYLE) & ~LVS_NOSORTHEADER) == 0) + if (GetWindowLongPtr(hListView, GWL_STYLE) & LVS_NOSORTHEADER) return TRUE; hHeader = ListView_GetHeader(hListView); diff --git a/base/applications/regedit/listview.c b/base/applications/regedit/listview.c index 4d99cd7814a..687fb2234bb 100644 --- a/base/applications/regedit/listview.c +++ b/base/applications/regedit/listview.c @@ -478,7 +478,7 @@ static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSor static BOOL ListView_Sort(HWND hListView, int iSortingColumn, int iSortedColumn) { - if ( (GetWindowLongPtr(hListView, GWL_STYLE) & ~LVS_NOSORTHEADER) && + if (!(GetWindowLongPtr(hListView, GWL_STYLE) & LVS_NOSORTHEADER) && (iSortingColumn >= 0) ) { BOOL bSortAscending; diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index f846cc1fd46..1492724e55e 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -698,7 +698,7 @@ BOOL CDefView::_Sort() HWND hHeader; HDITEM hColumn; - if ((m_ListView.GetWindowLongPtr(GWL_STYLE) & ~LVS_NOSORTHEADER) == 0) + if (m_ListView.GetWindowLongPtr(GWL_STYLE) & LVS_NOSORTHEADER) return TRUE; hHeader = (HWND)m_ListView.SendMessage(LVM_GETHEADER, 0, 0);