Called by e.g. End() but may be called for manual recovery. Read '// Error Handling [BETA]' block in imgui_internal.h for details. Attempt to recover from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls.
| 11022 | // Read '// Error Handling [BETA]' block in imgui_internal.h for details. |
| 11023 | // Attempt to recover from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. |
| 11024 | void ImGui::ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in) |
| 11025 | { |
| 11026 | ImGuiContext& g = *GImGui; |
| 11027 | |
| 11028 | while (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow) //-V1044 |
| 11029 | { |
| 11030 | IM_ASSERT_USER_ERROR(0, "Missing EndTable()"); |
| 11031 | EndTable(); |
| 11032 | } |
| 11033 | |
| 11034 | ImGuiWindow* window = g.CurrentWindow; |
| 11035 | |
| 11036 | // FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. |
| 11037 | while (g.CurrentTabBar != NULL && g.CurrentTabBar->Window == window) //-V1044 |
| 11038 | { |
| 11039 | IM_ASSERT_USER_ERROR(0, "Missing EndTabBar()"); |
| 11040 | EndTabBar(); |
| 11041 | } |
| 11042 | while (g.CurrentMultiSelect != NULL && g.CurrentMultiSelect->Storage->Window == window) //-V1044 |
| 11043 | { |
| 11044 | IM_ASSERT_USER_ERROR(0, "Missing EndMultiSelect()"); |
| 11045 | EndMultiSelect(); |
| 11046 | } |
| 11047 | if (window->DC.MenuBarAppending) //-V1044 |
| 11048 | { |
| 11049 | IM_ASSERT_USER_ERROR(0, "Missing EndMenuBar()"); |
| 11050 | EndMenuBar(); |
| 11051 | } |
| 11052 | while (window->DC.TreeDepth > state_in->SizeOfTreeStack) //-V1044 |
| 11053 | { |
| 11054 | IM_ASSERT_USER_ERROR(0, "Missing TreePop()"); |
| 11055 | TreePop(); |
| 11056 | } |
| 11057 | while (g.GroupStack.Size > state_in->SizeOfGroupStack) //-V1044 |
| 11058 | { |
| 11059 | IM_ASSERT_USER_ERROR(0, "Missing EndGroup()"); |
| 11060 | EndGroup(); |
| 11061 | } |
| 11062 | IM_ASSERT(g.GroupStack.Size == state_in->SizeOfGroupStack); |
| 11063 | while (window->IDStack.Size > state_in->SizeOfIDStack) //-V1044 |
| 11064 | { |
| 11065 | IM_ASSERT_USER_ERROR(0, "Missing PopID()"); |
| 11066 | PopID(); |
| 11067 | } |
| 11068 | while (g.DisabledStackSize > state_in->SizeOfDisabledStack) //-V1044 |
| 11069 | { |
| 11070 | IM_ASSERT_USER_ERROR(0, "Missing EndDisabled()"); |
| 11071 | if (g.CurrentItemFlags & ImGuiItemFlags_Disabled) |
| 11072 | EndDisabled(); |
| 11073 | else |
| 11074 | { |
| 11075 | EndDisabledOverrideReenable(); |
| 11076 | g.CurrentWindowStack.back().DisabledOverrideReenable = false; |
| 11077 | } |
| 11078 | } |
| 11079 | IM_ASSERT(g.DisabledStackSize == state_in->SizeOfDisabledStack); |
| 11080 | while (g.ColorStack.Size > state_in->SizeOfColorStack) //-V1044 |
| 11081 | { |
nothing calls this directly
no test coverage detected