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.
| 11056 | // Read '// Error Handling [BETA]' block in imgui_internal.h for details. |
| 11057 | // Attempt to recover from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. |
| 11058 | void ImGui::ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in) |
| 11059 | { |
| 11060 | ImGuiContext& g = *GImGui; |
| 11061 | |
| 11062 | while (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow) //-V1044 |
| 11063 | { |
| 11064 | IM_ASSERT_USER_ERROR(0, "Missing EndTable()"); |
| 11065 | EndTable(); |
| 11066 | } |
| 11067 | |
| 11068 | ImGuiWindow* window = g.CurrentWindow; |
| 11069 | |
| 11070 | // FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. |
| 11071 | while (g.CurrentTabBar != NULL && g.CurrentTabBar->Window == window) //-V1044 |
| 11072 | { |
| 11073 | IM_ASSERT_USER_ERROR(0, "Missing EndTabBar()"); |
| 11074 | EndTabBar(); |
| 11075 | } |
| 11076 | while (g.CurrentMultiSelect != NULL && g.CurrentMultiSelect->Storage->Window == window) //-V1044 |
| 11077 | { |
| 11078 | IM_ASSERT_USER_ERROR(0, "Missing EndMultiSelect()"); |
| 11079 | EndMultiSelect(); |
| 11080 | } |
| 11081 | if (window->DC.MenuBarAppending) //-V1044 |
| 11082 | { |
| 11083 | IM_ASSERT_USER_ERROR(0, "Missing EndMenuBar()"); |
| 11084 | EndMenuBar(); |
| 11085 | } |
| 11086 | while (window->DC.TreeDepth > state_in->SizeOfTreeStack) //-V1044 |
| 11087 | { |
| 11088 | IM_ASSERT_USER_ERROR(0, "Missing TreePop()"); |
| 11089 | TreePop(); |
| 11090 | } |
| 11091 | while (g.GroupStack.Size > state_in->SizeOfGroupStack) //-V1044 |
| 11092 | { |
| 11093 | IM_ASSERT_USER_ERROR(0, "Missing EndGroup()"); |
| 11094 | EndGroup(); |
| 11095 | } |
| 11096 | IM_ASSERT(g.GroupStack.Size == state_in->SizeOfGroupStack); |
| 11097 | while (window->IDStack.Size > state_in->SizeOfIDStack) //-V1044 |
| 11098 | { |
| 11099 | IM_ASSERT_USER_ERROR(0, "Missing PopID()"); |
| 11100 | PopID(); |
| 11101 | } |
| 11102 | while (g.DisabledStackSize > state_in->SizeOfDisabledStack) //-V1044 |
| 11103 | { |
| 11104 | IM_ASSERT_USER_ERROR(0, "Missing EndDisabled()"); |
| 11105 | if (g.CurrentItemFlags & ImGuiItemFlags_Disabled) |
| 11106 | EndDisabled(); |
| 11107 | else |
| 11108 | { |
| 11109 | EndDisabledOverrideReenable(); |
| 11110 | g.CurrentWindowStack.back().DisabledOverrideReenable = false; |
| 11111 | } |
| 11112 | } |
| 11113 | IM_ASSERT(g.DisabledStackSize == state_in->SizeOfDisabledStack); |
| 11114 | while (g.ColorStack.Size > state_in->SizeOfColorStack) //-V1044 |
| 11115 | { |
nothing calls this directly
no outgoing calls
no test coverage detected