diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2023-05-10 17:00:16 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-13 12:53:49 +0200 |
commit | 0e276e0458965ff41e007ad9e4e612b55bad7987 (patch) | |
tree | 48c30d647bbf0ba0b234da8ff878e25c1a002036 /Userland/Applications/FontEditor/MainWidget.cpp | |
parent | 2d2133b2293e0fc4e81833930ff0387984b00de3 (diff) | |
download | serenity-0e276e0458965ff41e007ad9e4e612b55bad7987.zip |
FontEditor: Iterate slope and weight lists by size()
Diffstat (limited to 'Userland/Applications/FontEditor/MainWidget.cpp')
-rw-r--r-- | Userland/Applications/FontEditor/MainWidget.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp index 417c6a736f..027d6d32c4 100644 --- a/Userland/Applications/FontEditor/MainWidget.cpp +++ b/Userland/Applications/FontEditor/MainWidget.cpp @@ -643,21 +643,17 @@ ErrorOr<void> MainWidget::initialize(DeprecatedString const& path, RefPtr<Gfx::B m_mean_line_spinbox->set_value(m_edited_font->mean_line(), GUI::AllowCallback::No); m_baseline_spinbox->set_value(m_edited_font->baseline(), GUI::AllowCallback::No); - int i = 0; - for (auto& it : Gfx::font_weight_names) { - if (it.style == m_edited_font->weight()) { + for (size_t i = 0; i < Gfx::font_weight_names.size(); ++i) { + if (Gfx::font_weight_names[i].style == m_edited_font->weight()) { m_weight_combobox->set_selected_index(i, GUI::AllowCallback::No); break; } - i++; } - i = 0; - for (auto& it : Gfx::font_slope_names) { - if (it.style == m_edited_font->slope()) { + for (size_t i = 0; i < Gfx::font_slope_names.size(); ++i) { + if (Gfx::font_slope_names[i].style == m_edited_font->slope()) { m_slope_combobox->set_selected_index(i, GUI::AllowCallback::No); break; } - i++; } update_statusbar(); |