| 693 | |
| 694 | |
| 695 | std::string CsvWindow::humanReadableSelection() { |
| 696 | long rows = table->getNumberRows(); |
| 697 | long cols = table->getNumberCols(); |
| 698 | std::vector<int> sel = grid->getSelection(); |
| 699 | std::string human = ""; |
| 700 | if( |
| 701 | (sel[0] == sel[2] && sel[1] == sel[3]) || |
| 702 | (sel[0] == 0 && sel[1] == 0 && sel[2] == rows - 1 && sel[3] == cols - 1 ) |
| 703 | ) { |
| 704 | // Full Table |
| 705 | human = "Full Table"; |
| 706 | } else if( sel[0] == 0 && sel[2] == rows - 1 ) { |
| 707 | // Column(s) |
| 708 | if( sel[1] == sel[3] ) { |
| 709 | human = "Column '" + table->getHeaderCell(sel[1], false)+"'"; |
| 710 | } else { |
| 711 | human = "Columns '" + table->getHeaderCell(sel[1], false) + "' > '" + table->getHeaderCell(sel[3], false) + "'"; |
| 712 | } |
| 713 | } else { |
| 714 | // Selection |
| 715 | human = "Selection (" + table->getHeaderCell(sel[1], false) + ":" + std::to_string(sel[0]+1) + " > " + table->getHeaderCell(sel[3], false) + ":" + std::to_string(sel[2]+1) + ")"; |
| 716 | } |
| 717 | return human; |
| 718 | } |
| 719 | |
| 720 | |
| 721 |
no test coverage detected