OSDN Git Service

DirView.cpp:
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 13 Jan 2022 12:56:43 +0000 (21:56 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 13 Jan 2022 12:56:43 +0000 (21:56 +0900)
 - Fix the parent folder icon not being displayed.
 - Fix the problem that the sort order is different from version 2.16.16 or earlier

Src/DirView.cpp

index aa4fb9e..01165f3 100644 (file)
@@ -1143,7 +1143,7 @@ void CDirView::SortColumnsAppropriately()
        //sort using static CompareFunc comparison function
        CompareState cs(&GetDiffContext(), m_pColItems.get(), sortCol, bSortAscending, m_bTreeMode);
        std::stable_sort(m_listViewItems.begin(), m_listViewItems.end(), [&cs](const ListViewOwnerDataItem& a, const ListViewOwnerDataItem& b)
-               { return CompareState::CompareFunc(a.lParam, b.lParam, reinterpret_cast<LPARAM>(&cs)) > 0; });
+               { return CompareState::CompareFunc(a.lParam, b.lParam, reinterpret_cast<LPARAM>(&cs)) < 0; });
 
        m_firstDiffItem.reset();
        m_lastDiffItem.reset();
@@ -4415,6 +4415,7 @@ void CDirView::ReflectGetdispinfo(NMLVDISPINFO *pParam)
        int i = m_pColItems->ColPhysToLog(pParam->item.iSubItem);
        if (IsDiffItemSpecial(key))
        {
+               pParam->item.iImage = m_listViewItems[nIdx].iImage;
                if (m_pColItems->IsColName(i))
                {
                        pParam->item.pszText = _T("..");