diff options
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 208fc0a219..7d4661c6c7 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2226,22 +2226,25 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { // TODO: support multi-select LLScrollListItem *item = getFirstSelected(); - S32 cell = item->getSelectedCell(); - switch (mSelectionType) + if (item) { - case CELL: - if (cell < mColumns.size()) cell++; - break; - case HEADER: - if (cell == -1) cell = 1; - else if (cell > 1 && cell < mColumns.size()) cell++; // skip header - break; - case ROW: - cell = -1; - break; + S32 cell = item->getSelectedCell(); + switch (mSelectionType) + { + case CELL: + if (cell < mColumns.size()) cell++; + break; + case HEADER: + if (cell == -1) cell = 1; + else if (cell > 1 && cell < mColumns.size()) cell++; // skip header + break; + case ROW: + cell = -1; + break; + } + item->setSelectedCell(cell); + handled = TRUE; } - item->setSelectedCell(cell); - handled = TRUE; } break; case KEY_RIGHT: @@ -2249,22 +2252,25 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { // TODO: support multi-select LLScrollListItem *item = getFirstSelected(); - S32 cell = item->getSelectedCell(); - switch (mSelectionType) + if (item) { - case CELL: - if (cell >= 0) cell--; - break; - case HEADER: - if (cell > 1) cell--; - else if (cell == 1) cell = -1; // skip header - break; - case ROW: - cell = -1; - break; + S32 cell = item->getSelectedCell(); + switch (mSelectionType) + { + case CELL: + if (cell >= 0) cell--; + break; + case HEADER: + if (cell > 1) cell--; + else if (cell == 1) cell = -1; // skip header + break; + case ROW: + cell = -1; + break; + } + item->setSelectedCell(cell); + handled = TRUE; } - item->setSelectedCell(cell); - handled = TRUE; } break; case KEY_PAGE_UP: |