Ticket #1283: filezilla-02-vector-begin.diff

File filezilla-02-vector-begin.diff, 2.2 KB (added by nonsea, 13 years ago)

patch for this bug

  • trunk/src/interface/RemoteListView.cpp

     
    10171017        // Simply reverse everything
    10181018        m_sortDirection = direction;
    10191019        m_sortColumn = column;
    1020         std::reverse(++m_indexMapping.begin(), m_indexMapping.end());
     1020        std::vector<unsigned int>::iterator iter;
     1021        iter = m_indexMapping.begin();
     1022        std::reverse(++iter, m_indexMapping.end());
    10211023
    10221024        SortList_UpdateSelections(selected, focused);
    10231025        delete [] selected;
     
    10531055        break;
    10541056    }
    10551057
     1058    std::vector<unsigned int>::iterator iter;
     1059    iter = m_indexMapping.begin();
    10561060    if (!m_sortColumn)
    1057         std::sort(++m_indexMapping.begin(), m_indexMapping.end(), CRemoteListViewSortName(m_pDirectoryListing, dirSortMode));
     1061        std::sort(++iter, m_indexMapping.end(), CRemoteListViewSortName(m_pDirectoryListing, dirSortMode));
    10581062    else if (m_sortColumn == 1)
    1059         std::sort(++m_indexMapping.begin(), m_indexMapping.end(), CRemoteListViewSortSize(m_pDirectoryListing, dirSortMode));
     1063        std::sort(++iter, m_indexMapping.end(), CRemoteListViewSortSize(m_pDirectoryListing, dirSortMode));
    10601064    else if (m_sortColumn == 2)
    1061         std::sort(++m_indexMapping.begin(), m_indexMapping.end(), CRemoteListViewSortType(this, dirSortMode, m_pDirectoryListing, m_fileData));
     1065        std::sort(++iter, m_indexMapping.end(), CRemoteListViewSortType(this, dirSortMode, m_pDirectoryListing, m_fileData));
    10621066    else if (m_sortColumn == 3)
    1063         std::sort(++m_indexMapping.begin(), m_indexMapping.end(), CRemoteListViewSortTime(m_pDirectoryListing, dirSortMode));
     1067        std::sort(++iter, m_indexMapping.end(), CRemoteListViewSortTime(m_pDirectoryListing, dirSortMode));
    10641068    else if (m_sortColumn == 4)
    1065         std::sort(++m_indexMapping.begin(), m_indexMapping.end(), CRemoteListViewSortPermissions(m_pDirectoryListing, dirSortMode));
     1069        std::sort(++iter, m_indexMapping.end(), CRemoteListViewSortPermissions(m_pDirectoryListing, dirSortMode));
    10661070   
     1071    iter = m_indexMapping.begin();
    10671072    if (m_sortDirection)
    1068         std::reverse(++m_indexMapping.begin(), m_indexMapping.end());
     1073        std::reverse(++iter, m_indexMapping.end());
    10691074
    10701075    SortList_UpdateSelections(selected, focused);
    10711076    delete [] selected;