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)

This commit is contained in:
Charlie Fenton 2015-10-22 01:39:20 -07:00
parent 2c6aa0970c
commit 40398cec31
3 changed files with 45 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}