From 40398cec31fd5c2c10e7c986845e2b768f4a2776 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Thu, 22 Oct 2015 01:39:20 -0700 Subject: [PATCH] MGR: fix a bug which made it difficult to select items when certain key fields are hidden (selection would always jump to item in top row) --- clientgui/ViewProjects.cpp | 9 +++++++++ clientgui/ViewTransfers.cpp | 18 ++++++++++++++++++ clientgui/ViewWork.cpp | 18 ++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/clientgui/ViewProjects.cpp b/clientgui/ViewProjects.cpp index 59265e3d39..4c27634dea 100644 --- a/clientgui/ViewProjects.cpp +++ b/clientgui/ViewProjects.cpp @@ -355,6 +355,15 @@ wxString CViewProjects::GetKeyValue1(int iRowIndex) { return wxEmptyString; } + if (m_iColumnIDToColumnIndex[COLUMN_PROJECT] < 0) { + // Column is hidden, so SynchronizeCacheItem() did not set its value + wxString strDocumentText = wxEmptyString; + GetDocProjectURL(m_iSortedIndexes[iRowIndex], strDocumentText); + if (!strDocumentText.IsSameAs(project->m_strProjectURL)) { + project->m_strProjectURL = strDocumentText; + } + } + return project->m_strProjectURL; } diff --git a/clientgui/ViewTransfers.cpp b/clientgui/ViewTransfers.cpp index 5e5264fad8..560f900270 100644 --- a/clientgui/ViewTransfers.cpp +++ b/clientgui/ViewTransfers.cpp @@ -314,6 +314,15 @@ wxString CViewTransfers::GetKeyValue1(int iRowIndex) { return wxEmptyString; } + if (m_iColumnIDToColumnIndex[COLUMN_FILE] < 0) { + // Column is hidden, so SynchronizeCacheItem() did not set its value + wxString strDocumentText = wxEmptyString; + GetDocFileName(m_iSortedIndexes[iRowIndex], strDocumentText); + if (!strDocumentText.IsSameAs(transfer->m_strFileName)) { + transfer->m_strFileName = strDocumentText; + } + } + return transfer->m_strFileName; } @@ -325,6 +334,15 @@ wxString CViewTransfers::GetKeyValue2(int iRowIndex) { return wxEmptyString; } + if (m_iColumnIDToColumnIndex[COLUMN_PROJECT] < 0) { + // Column is hidden, so SynchronizeCacheItem() did not set its value + wxString strDocumentText = wxEmptyString; + GetDocProjectURL(m_iSortedIndexes[iRowIndex], strDocumentText); + if (!strDocumentText.IsSameAs(transfer->m_strProjectURL)) { + transfer->m_strProjectURL = strDocumentText; + } + } + return transfer->m_strProjectURL; } diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index 9c09c147ae..8e887e2d06 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -370,6 +370,15 @@ wxString CViewWork::GetKeyValue1(int iRowIndex) { return wxEmptyString; } + if (m_iColumnIDToColumnIndex[COLUMN_NAME] < 0) { + // Column is hidden, so SynchronizeCacheItem() did not set its value + wxString strDocumentText = wxEmptyString; + GetDocName(m_iSortedIndexes[iRowIndex], strDocumentText); + if (!strDocumentText.IsSameAs(work->m_strName)) { + work->m_strName = strDocumentText; + } + } + return work->m_strName; } @@ -381,6 +390,15 @@ wxString CViewWork::GetKeyValue2(int iRowIndex) { return wxEmptyString; } + if (m_iColumnIDToColumnIndex[COLUMN_PROJECT] < 0) { + // Column is hidden, so SynchronizeCacheItem() did not set its value + wxString strDocumentText = wxEmptyString; + GetDocProjectURL(m_iSortedIndexes[iRowIndex], strDocumentText); + if (!strDocumentText.IsSameAs(work->m_strProjectURL)) { + work->m_strProjectURL = strDocumentText; + } + } + return work->m_strProjectURL; }