318 } |
318 } |
319 else if (modifiers == winrt::Windows::System::VirtualKeyModifiers::Shift) { |
319 else if (modifiers == winrt::Windows::System::VirtualKeyModifiers::Shift) { |
320 // select everything between the first selection and the current row |
320 // select everything between the first selection and the current row |
321 std::sort(selection.begin(), selection.end()); |
321 std::sort(selection.begin(), selection.end()); |
322 int first = selection.front(); |
322 int first = selection.front(); |
|
323 int last = row; |
|
324 if (first > row) { |
|
325 last = first; |
|
326 first = row; |
|
327 } |
323 |
328 |
324 // clear previous selection |
329 // clear previous selection |
325 change_rows_bg(selection, defaultBrush, defaultBrush); |
330 change_rows_bg(selection, defaultBrush, defaultBrush); |
326 |
331 |
327 // create new selection |
332 // create new selection |
328 std::vector<int> newselection; |
333 std::vector<int> newselection; |
329 for (int s = first; s <= row; s++) { |
334 for (int s = first; s <= last; s++) { |
330 newselection.push_back(s); |
335 newselection.push_back(s); |
331 } |
336 } |
332 selection = newselection; |
337 selection = newselection; |
333 change_rows_bg(selection, selectedBrush, selectedBorderBrush); |
338 change_rows_bg(selection, selectedBrush, selectedBorderBrush); |
334 } |
339 } |