MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / SortByCol

Method SortByCol

DataViewer/TableBase.cpp:708–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708void TableBase::SortByCol(int col, bool ascending)
709{
710 if (col == -1) {
711 if (ascending) {
712 SortByDefaultAscending();
713 } else {
714 SortByDefaultDecending();
715 }
716 return;
717 }
718 sorting_ascending = ascending;
719 sorting_col = col;
720 int rows = GetNumberRows();
721
722 int tm=time_state->GetCurrTime();
723 switch (table_int->GetColType(col)) {
724 case GdaConst::date_type:
725 case GdaConst::time_type:
726 case GdaConst::datetime_type:
727 case GdaConst::long64_type:
728 {
729 SortColumn<wxInt64>(col, tm, ascending);
730 }
731 break;
732 case GdaConst::double_type:
733 {
734 SortColumn<double>(col, tm, ascending);
735 }
736 break;
737 case GdaConst::string_type:
738 {
739 SortColumn<wxString>(col, tm, ascending);
740 }
741 break;
742 default:
743 break;
744 }
745}
746
747void TableBase::MoveSelectedToTop()
748{

Callers 1

Calls 2

GetCurrTimeMethod · 0.80
GetColTypeMethod · 0.80

Tested by

no test coverage detected