From 5266c6be8e7ecbdf127e7d329900a1f9579b7753 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Fri, 2 Dec 2022 19:03:26 +0100 Subject: [PATCH] Fix typo 'activ_' to 'active_' --- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 12 ++++++------ src/slic3r/Utils/EmbossStyleManager.cpp | 22 +++++++++++----------- src/slic3r/Utils/EmbossStyleManager.hpp | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index d1a920b5bf..8a9a51c983 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -2013,9 +2013,9 @@ void GLGizmoEmboss::draw_delete_style_button() { if (draw_button(IconType::erase, !can_delete)) { while (true) { // NOTE: can't use previous loaded activ index -> erase could change index - size_t activ_index = m_style_manager.get_style_index(); - next_style_index = (activ_index > 0) ? activ_index - 1 : - activ_index + 1; + size_t active_index = m_style_manager.get_style_index(); + next_style_index = (active_index > 0) ? active_index - 1 : + active_index + 1; if (next_style_index >= m_style_manager.get_styles().size()) { // can't remove last font style // TODO: inform user @@ -2029,7 +2029,7 @@ void GLGizmoEmboss::draw_delete_style_button() { } // load back - m_style_manager.load_style(activ_index); + m_style_manager.load_style(active_index); ImGui::OpenPopup(popup_id); break; } @@ -2050,9 +2050,9 @@ void GLGizmoEmboss::draw_delete_style_button() { std::string text_in_popup = GUI::format(_L("Are you sure,\nthat you want permanently and unrecoverable \nremove style \"%1%\"?"), style_name); ImGui::Text("%s", text_in_popup.c_str()); if (ImGui::Button(_u8L("Yes").c_str())) { - size_t activ_index = m_style_manager.get_style_index(); + size_t active_index = m_style_manager.get_style_index(); m_style_manager.load_style(next_style_index); - m_style_manager.erase(activ_index); + m_style_manager.erase(active_index); m_style_manager.store_styles_to_app_config(wxGetApp().app_config); ImGui::CloseCurrentPopup(); process(); diff --git a/src/slic3r/Utils/EmbossStyleManager.cpp b/src/slic3r/Utils/EmbossStyleManager.cpp index 77df3e2170..22ad0827ea 100644 --- a/src/slic3r/Utils/EmbossStyleManager.cpp +++ b/src/slic3r/Utils/EmbossStyleManager.cpp @@ -39,19 +39,19 @@ void StyleManager::init(AppConfig *app_config, const EmbossStyles &default_style m_style_items.push_back({style}); } - std::optional activ_index_opt = (app_config != nullptr) ? + std::optional active_index_opt = (app_config != nullptr) ? EmbossStylesSerializable::load_style_index(*app_config) : std::optional{}; - size_t activ_index = 0; - if (activ_index_opt.has_value()) activ_index = *activ_index_opt; - if (activ_index >= m_style_items.size()) activ_index = 0; + size_t active_index = 0; + if (active_index_opt.has_value()) active_index = *active_index_opt; + if (active_index >= m_style_items.size()) active_index = 0; // find valid font item - if (!load_style(activ_index)) { - m_style_items.erase(m_style_items.begin() + activ_index); - activ_index = 0; - while (m_style_items.empty() || !load_style(activ_index)) + if (!load_style(active_index)) { + m_style_items.erase(m_style_items.begin() + active_index); + active_index = 0; + while (m_style_items.empty() || !load_style(active_index)) m_style_items.erase(m_style_items.begin()); // no one style from config is loadable if (m_style_items.empty()) { @@ -61,14 +61,14 @@ void StyleManager::init(AppConfig *app_config, const EmbossStyles &default_style m_style_items.push_back({std::move(style)}); } // try to load first default font - [[maybe_unused]] bool loaded = load_style(activ_index); + [[maybe_unused]] bool loaded = load_style(active_index); assert(loaded); } } } bool StyleManager::store_styles_to_app_config(bool use_modification, - bool store_activ_index) + bool store_active_index) { assert(m_app_config != nullptr); if (m_app_config == nullptr) return false; @@ -87,7 +87,7 @@ bool StyleManager::store_styles_to_app_config(bool use_modification, m_style_cache.stored_wx_font = m_style_cache.wx_font; } - if (store_activ_index) + if (store_active_index) { size_t style_index = exist_stored_style() ? m_style_cache.style_index : diff --git a/src/slic3r/Utils/EmbossStyleManager.hpp b/src/slic3r/Utils/EmbossStyleManager.hpp index bc04ede32b..3851a10517 100644 --- a/src/slic3r/Utils/EmbossStyleManager.hpp +++ b/src/slic3r/Utils/EmbossStyleManager.hpp @@ -46,7 +46,7 @@ public: /// When true cache state will be used for store /// When true store activ index into configuration /// True on succes otherwise False. - bool store_styles_to_app_config(bool use_modification = true, bool store_activ_index = true); + bool store_styles_to_app_config(bool use_modification = true, bool store_active_index = true); /// /// Append actual style to style list