From 4307d0ee8b6e86926756835666fdf7d489280652 Mon Sep 17 00:00:00 2001 From: ohowe Date: Wed, 23 Nov 2022 14:57:29 -0700 Subject: [PATCH] [glass] Plot: allow for more than 11 plots (#4685) Since m_windows is sorted using the ascii, when "Plot <10>" is reached it will be before "Plot <2>" in `m_windows` which makes it so it will not add a new plot after the id 10 is reached. This also fixes a potential issue of someone manually changing an id in the file, which would break adding a new plot in some circumstances. --- glass/src/lib/native/cpp/other/Plot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glass/src/lib/native/cpp/other/Plot.cpp b/glass/src/lib/native/cpp/other/Plot.cpp index caf9089868..5f4dd6eebb 100644 --- a/glass/src/lib/native/cpp/other/Plot.cpp +++ b/glass/src/lib/native/cpp/other/Plot.cpp @@ -991,7 +991,7 @@ void PlotProvider::DisplayMenu() { for (size_t i = 0; i <= numWindows; ++i) { std::snprintf(id, sizeof(id), "Plot <%d>", static_cast(i)); bool match = false; - for (size_t j = i; j < numWindows; ++j) { + for (size_t j = 0; j < numWindows; ++j) { if (m_windows[j]->GetId() == id) { match = true; break;