From ac47710db7ebaf2637de4b1517231d93e0e03baa Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 27 Feb 2019 16:49:55 +0100 Subject: [PATCH] Internal: InputText: Tweaks to make PVS static analyzer relax a little with its false positive. --- imgui_widgets.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index b1e17f128..0857f4b8c 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -3284,7 +3284,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2 ClearActiveID(); // Release focus when we click outside - if (g.ActiveId == id && io.MouseClicked[0] && !init_state && !init_make_active) + if (g.ActiveId == id && io.MouseClicked[0] && !init_state && !init_make_active) //-V560 clear_active_id = true; bool value_changed = false; @@ -3295,8 +3295,8 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2 // FIXME-OPT: Because our selection/cursor code currently needs the wide text we need to convert it when active, which is not ideal :( if (is_readonly && state != NULL) { - const bool will_render_cursor = (g.ActiveId == id) || (state && user_scroll_active); - const bool will_render_selection = state && state->HasSelection() && (RENDER_SELECTION_WHEN_INACTIVE || will_render_cursor); + const bool will_render_cursor = (g.ActiveId == id) || (user_scroll_active); + const bool will_render_selection = state->HasSelection() && (RENDER_SELECTION_WHEN_INACTIVE || will_render_cursor); if (will_render_cursor || will_render_selection) { const char* buf_end = NULL;