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.
| 10980 | // Read '// Error Handling [BETA]' block in imgui_internal.h for details. |
| 10981 | // Attempt to recover from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. |
| 10982 | void ImGui::ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in) |
| 10983 | { |
| 10984 | ImGuiContext& g = *GImGui; |
| 10985 | |
| 10986 | while (g.CurrentTable != NULL && g.CurrentTable->InnerWindow == g.CurrentWindow) //-V1044 |
| 10987 | { |
| 10988 | IM_ASSERT_USER_ERROR(0, "Missing EndTable()"); |
| 10989 | EndTable(); |
| 10990 | } |
| 10991 | |
| 10992 | ImGuiWindow* window = g.CurrentWindow; |
| 10993 | |
| 10994 | // FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. |
| 10995 | while (g.CurrentTabBar != NULL && g.CurrentTabBar->Window == window) //-V1044 |
| 10996 | { |
| 10997 | IM_ASSERT_USER_ERROR(0, "Missing EndTabBar()"); |
| 10998 | EndTabBar(); |
| 10999 | } |
| 11000 | while (g.CurrentMultiSelect != NULL && g.CurrentMultiSelect->Storage->Window == window) //-V1044 |
| 11001 | { |
| 11002 | IM_ASSERT_USER_ERROR(0, "Missing EndMultiSelect()"); |
| 11003 | EndMultiSelect(); |
| 11004 | } |
| 11005 | if (window->DC.MenuBarAppending) //-V1044 |
| 11006 | { |
| 11007 | IM_ASSERT_USER_ERROR(0, "Missing EndMenuBar()"); |
| 11008 | EndMenuBar(); |
| 11009 | } |
| 11010 | while (window->DC.TreeDepth > state_in->SizeOfTreeStack) //-V1044 |
| 11011 | { |
| 11012 | IM_ASSERT_USER_ERROR(0, "Missing TreePop()"); |
| 11013 | TreePop(); |
| 11014 | } |
| 11015 | while (g.GroupStack.Size > state_in->SizeOfGroupStack) //-V1044 |
| 11016 | { |
| 11017 | IM_ASSERT_USER_ERROR(0, "Missing EndGroup()"); |
| 11018 | EndGroup(); |
| 11019 | } |
| 11020 | IM_ASSERT(g.GroupStack.Size == state_in->SizeOfGroupStack); |
| 11021 | while (window->IDStack.Size > state_in->SizeOfIDStack) //-V1044 |
| 11022 | { |
| 11023 | IM_ASSERT_USER_ERROR(0, "Missing PopID()"); |
| 11024 | PopID(); |
| 11025 | } |
| 11026 | while (g.DisabledStackSize > state_in->SizeOfDisabledStack) //-V1044 |
| 11027 | { |
| 11028 | IM_ASSERT_USER_ERROR(0, "Missing EndDisabled()"); |
| 11029 | if (g.CurrentItemFlags & ImGuiItemFlags_Disabled) |
| 11030 | EndDisabled(); |
| 11031 | else |
| 11032 | { |
| 11033 | EndDisabledOverrideReenable(); |
| 11034 | g.CurrentWindowStack.back().DisabledOverrideReenable = false; |
| 11035 | } |
| 11036 | } |
| 11037 | IM_ASSERT(g.DisabledStackSize == state_in->SizeOfDisabledStack); |
| 11038 | while (g.ColorStack.Size > state_in->SizeOfColorStack) //-V1044 |
| 11039 | { |
nothing calls this directly
no outgoing calls
no test coverage detected