MCPcopy Create free account
hub / github.com/SatDump/SatDump / TableGetColumnNextSortDirection

Method TableGetColumnNextSortDirection

src-core/imgui/imgui_tables.cpp:2735–2745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2733// - Note that the PreferSortAscending flag is never checked, it is essentially the default and therefore a no-op.
2734IM_STATIC_ASSERT(ImGuiSortDirection_None == 0 && ImGuiSortDirection_Ascending == 1 && ImGuiSortDirection_Descending == 2);
2735ImGuiSortDirection ImGui::TableGetColumnNextSortDirection(ImGuiTableColumn* column)
2736{
2737 IM_ASSERT(column->SortDirectionsAvailCount > 0);
2738 if (column->SortOrder == -1)
2739 return TableGetColumnAvailSortDirection(column, 0);
2740 for (int n = 0; n < 3; n++)
2741 if (column->SortDirection == TableGetColumnAvailSortDirection(column, n))
2742 return TableGetColumnAvailSortDirection(column, (n + 1) % column->SortDirectionsAvailCount);
2743 IM_ASSERT(0);
2744 return ImGuiSortDirection_None;
2745}
2746
2747// Note that the NoSortAscending/NoSortDescending flags are processed in TableSortSpecsSanitize(), and they may change/revert
2748// the value of SortDirection. We could technically also do it here but it would be unnecessary and duplicate code.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected