diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp index 67e7fcce7a..2cdab6aea6 100644 --- a/Userland/Applications/Browser/CookieJar.cpp +++ b/Userland/Applications/Browser/CookieJar.cpp @@ -21,16 +21,16 @@ String CookieJar::get_cookie(const URL& url, Web::Cookie::Source source) if (!domain.has_value()) return {}; - Vector cookie_list = get_matching_cookies(url, domain.value(), source); + auto cookie_list = get_matching_cookies(url, domain.value(), source); StringBuilder builder; - for (const auto* cookie : cookie_list) { + for (const auto& cookie : cookie_list) { // If there is an unprocessed cookie in the cookie-list, output the characters %x3B and %x20 ("; ") if (!builder.is_empty()) builder.append("; "); // Output the cookie's name, the %x3D ("=") character, and the cookie's value. - builder.appendff("{}={}", cookie->name, cookie->value); + builder.appendff("{}={}", cookie.name, cookie.value); } return builder.build(); @@ -238,14 +238,14 @@ void CookieJar::store_cookie(const Web::Cookie::ParsedCookie& parsed_cookie, con m_cookies.set(key, move(cookie)); } -Vector CookieJar::get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source) +Vector CookieJar::get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source) { // https://tools.ietf.org/html/rfc6265#section-5.4 auto now = Core::DateTime::now(); // 1. Let cookie-list be the set of cookies from the cookie store that meets all of the following requirements: - Vector cookie_list; + Vector cookie_list; for (auto& cookie : m_cookies) { // Either: The cookie's host-only-flag is true and the canonicalized request-host is identical to the cookie's domain. @@ -270,11 +270,11 @@ Vector CookieJar::get_matching_cookies(const URL& url, con // 2. The user agent SHOULD sort the cookie-list in the following order: // - Cookies with longer paths are listed before cookies with shorter paths. // - Among cookies that have equal-length path fields, cookies with earlier creation-times are listed before cookies with later creation-times. - cookie_list.insert_before_matching(&cookie.value, [&cookie](auto* entry) { - if (cookie.value.path.length() > entry->path.length()) { + cookie_list.insert_before_matching(cookie.value, [&cookie](auto& entry) { + if (cookie.value.path.length() > entry.path.length()) { return true; - } else if (cookie.value.path.length() == entry->path.length()) { - if (cookie.value.creation_time.timestamp() < entry->creation_time.timestamp()) + } else if (cookie.value.path.length() == entry.path.length()) { + if (cookie.value.creation_time.timestamp() < entry.creation_time.timestamp()) return true; } return false; diff --git a/Userland/Applications/Browser/CookieJar.h b/Userland/Applications/Browser/CookieJar.h index 2ca8ffc673..b93ce44a95 100644 --- a/Userland/Applications/Browser/CookieJar.h +++ b/Userland/Applications/Browser/CookieJar.h @@ -37,7 +37,7 @@ private: static String default_path(const URL& url); void store_cookie(const Web::Cookie::ParsedCookie& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source); - Vector get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source); + Vector get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source); void purge_expired_cookies(); HashMap m_cookies; diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index 3a06fd5585..49a625cf75 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -136,9 +136,9 @@ void KeyboardMapperWidget::load_from_file(String filename) m_character_map = result.value(); set_current_map("map"); - for (Widget* widget : m_map_group->child_widgets()) { - auto radio_button = (GUI::RadioButton*)widget; - radio_button->set_checked(radio_button->name() == "map"); + for (auto& widget : m_map_group->child_widgets()) { + auto& radio_button = static_cast(widget); + radio_button.set_checked(radio_button.name() == "map"); } update_window_title(); @@ -153,9 +153,9 @@ void KeyboardMapperWidget::load_from_system() m_character_map = result.value().character_map_data(); set_current_map("map"); - for (Widget* widget : m_map_group->child_widgets()) { - auto radio_button = (GUI::RadioButton*)widget; - radio_button->set_checked(radio_button->name() == "map"); + for (auto& widget : m_map_group->child_widgets()) { + auto& radio_button = static_cast(widget); + radio_button.set_checked(radio_button.name() == "map"); } update_window_title(); diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp index a1b6b9b75e..4365ba222c 100644 --- a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp +++ b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp @@ -112,14 +112,14 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector& po for (auto& type_name : CellType::names()) g_types.append(type_name); - Vector cells; + Vector cells; for (auto& position : positions) { if (auto cell = sheet.at(position)) - cells.append(cell); + cells.append(*cell); } if (cells.size() == 1) { - auto& cell = *cells.first(); + auto& cell = cells.first(); m_format = cell.type_metadata().format; m_length = cell.type_metadata().length; m_type = &cell.type(); diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index 1e3dce5e8f..42186bcebc 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -115,18 +115,18 @@ void Sheet::update() return; } m_visited_cells_in_update.clear(); - Vector cells_copy; + Vector cells_copy; // Grab a copy as updates might insert cells into the table. for (auto& it : m_cells) { if (it.value->dirty()) { - cells_copy.append(it.value); + cells_copy.append(*it.value); m_workbook.set_dirty(true); } } for (auto& cell : cells_copy) - update(*cell); + update(cell); m_visited_cells_in_update.clear(); } diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index 3401819baa..db30b7b55b 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -171,11 +171,11 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector new_sheets) m_current_cell_label->set_enabled(true); m_current_cell_label->set_text(builder.string_view()); - Vector cells; + Vector cells; for (auto& position : selection) - cells.append(&sheet.ensure(position)); + cells.append(sheet.ensure(position)); - auto first_cell = cells.first(); + auto& first_cell = cells.first(); m_cell_value_editor->on_change = nullptr; m_cell_value_editor->set_text(""); m_should_change_selected_cells = false; @@ -191,14 +191,14 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector new_sheets) // FIXME: Lines? auto offset = m_cell_value_editor->cursor().column(); try_generate_tip_for_input_expression(text, offset); - for (auto* cell : cells) - cell->set_data(text); + for (auto& cell : cells) + cell.set_data(text); sheet.update(); update(); } }; m_cell_value_editor->set_enabled(true); - static_cast(const_cast(m_cell_value_editor->syntax_highlighter()))->set_cell(first_cell); + static_cast(const_cast(m_cell_value_editor->syntax_highlighter()))->set_cell(&first_cell); }; m_selected_view->on_selection_dropped = [&]() { m_cell_value_editor->set_enabled(false); diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 41155e5055..7fb83efd5e 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -663,7 +663,7 @@ NonnullRefPtr build_graphs_tab() cpu_graph_group_box.set_layout(); cpu_graph_group_box.layout()->set_margins({ 6, 16, 6, 6 }); cpu_graph_group_box.set_fixed_height(120); - Vector cpu_graphs; + Vector cpu_graphs; for (size_t i = 0; i < ProcessModel::the().cpus().size(); i++) { auto& cpu_graph = cpu_graph_group_box.add(); cpu_graph.set_max(100); @@ -679,12 +679,12 @@ NonnullRefPtr build_graphs_tab() return String::formatted("Kernel: {}%", value); }, }); - cpu_graphs.append(&cpu_graph); + cpu_graphs.append(cpu_graph); } ProcessModel::the().on_cpu_info_change = [cpu_graphs](const NonnullOwnPtrVector& cpus) { float sum_cpu = 0; for (size_t i = 0; i < cpus.size(); ++i) { - cpu_graphs[i]->add_value({ (int)cpus[i].total_cpu_percent, (int)cpus[i].total_cpu_percent_kernel }); + cpu_graphs[i].add_value({ (int)cpus[i].total_cpu_percent, (int)cpus[i].total_cpu_percent_kernel }); sum_cpu += cpus[i].total_cpu_percent; } float cpu_usage = sum_cpu / (float)cpus.size(); diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 8abd23e15b..21d44af2f2 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -489,17 +489,17 @@ NonnullRefPtr HackStudioWidget::create_switch_to_next_editor_action return GUI::Action::create("Switch to &Next Editor", { Mod_Ctrl, Key_E }, [this](auto&) { if (m_all_editor_wrappers.size() <= 1) return; - Vector wrappers; + Vector wrappers; m_editors_splitter->for_each_child_of_type([this, &wrappers](auto& child) { - wrappers.append(&child); + wrappers.append(child); return IterationDecision::Continue; }); for (size_t i = 0; i < wrappers.size(); ++i) { - if (m_current_editor_wrapper.ptr() == wrappers[i]) { + if (m_current_editor_wrapper.ptr() == &wrappers[i]) { if (i == wrappers.size() - 1) - wrappers[0]->editor().set_focus(true); + wrappers[0].editor().set_focus(true); else - wrappers[i + 1]->editor().set_focus(true); + wrappers[i + 1].editor().set_focus(true); } } }); @@ -510,17 +510,17 @@ NonnullRefPtr HackStudioWidget::create_switch_to_previous_editor_ac return GUI::Action::create("Switch to &Previous Editor", { Mod_Ctrl | Mod_Shift, Key_E }, [this](auto&) { if (m_all_editor_wrappers.size() <= 1) return; - Vector wrappers; + Vector wrappers; m_editors_splitter->for_each_child_of_type([this, &wrappers](auto& child) { - wrappers.append(&child); + wrappers.append(child); return IterationDecision::Continue; }); for (int i = wrappers.size() - 1; i >= 0; --i) { - if (m_current_editor_wrapper.ptr() == wrappers[i]) { + if (m_current_editor_wrapper.ptr() == &wrappers[i]) { if (i == 0) - wrappers.last()->editor().set_focus(true); + wrappers.last().editor().set_focus(true); else - wrappers[i - 1]->editor().set_focus(true); + wrappers[i - 1].editor().set_focus(true); } } }); diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index 23dabfc764..5fee393e47 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -58,7 +58,7 @@ struct EventLoop::Private { }; static EventLoop* s_main_event_loop; -static Vector* s_event_loop_stack; +static Vector* s_event_loop_stack; static NeverDestroyed s_id_allocator; static HashMap>* s_timers; static HashTable* s_notifiers; @@ -257,7 +257,7 @@ EventLoop::EventLoop([[maybe_unused]] MakeInspectable make_inspectable) : m_private(make()) { if (!s_event_loop_stack) { - s_event_loop_stack = new Vector; + s_event_loop_stack = new Vector; s_timers = new HashMap>; s_notifiers = new HashTable; } @@ -274,7 +274,7 @@ EventLoop::EventLoop([[maybe_unused]] MakeInspectable make_inspectable) #endif VERIFY(rc == 0); - s_event_loop_stack->append(this); + s_event_loop_stack->append(*this); #ifdef __serenity__ if (getuid() != 0 @@ -314,9 +314,7 @@ EventLoop& EventLoop::main() EventLoop& EventLoop::current() { - EventLoop* event_loop = s_event_loop_stack->last(); - VERIFY(event_loop != nullptr); - return *event_loop; + return s_event_loop_stack->last(); } void EventLoop::quit(int code) @@ -340,7 +338,7 @@ public: { if (&m_event_loop != s_main_event_loop) { m_event_loop.take_pending_events_from(EventLoop::current()); - s_event_loop_stack->append(&event_loop); + s_event_loop_stack->append(event_loop); } } ~EventLoopPusher() diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 1380beb147..3b3c531a0f 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -362,8 +362,8 @@ void ColorPicker::create_color_button(Widget& container, unsigned rgb) auto& widget = container.add(*this, color); widget.on_click = [this](Color color) { for (auto& value : m_color_widgets) { - value->set_selected(false); - value->update(); + value.set_selected(false); + value.update(); } m_color = color; @@ -375,7 +375,7 @@ void ColorPicker::create_color_button(Widget& container, unsigned rgb) widget.set_selected(true); } - m_color_widgets.append(&widget); + m_color_widgets.append(widget); } ColorButton::ColorButton(ColorPicker& picker, Color color) diff --git a/Userland/Libraries/LibGUI/ColorPicker.h b/Userland/Libraries/LibGUI/ColorPicker.h index e26aacc206..e2627a094b 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.h +++ b/Userland/Libraries/LibGUI/ColorPicker.h @@ -37,7 +37,7 @@ private: Color m_color; bool m_color_has_alpha_channel { true }; - Vector m_color_widgets; + Vector m_color_widgets; RefPtr m_custom_color; RefPtr m_preview_widget; RefPtr m_html_text; diff --git a/Userland/Libraries/LibGUI/Splitter.cpp b/Userland/Libraries/LibGUI/Splitter.cpp index b19712096b..c0d2110278 100644 --- a/Userland/Libraries/LibGUI/Splitter.cpp +++ b/Userland/Libraries/LibGUI/Splitter.cpp @@ -155,7 +155,7 @@ void Splitter::recompute_grabbables() m_hovered_index = {}; auto child_widgets = this->child_widgets(); - child_widgets.remove_all_matching([&](auto& widget) { return !widget->is_visible(); }); + child_widgets.remove_all_matching([&](auto& widget) { return !widget.is_visible(); }); if (child_widgets.size() < 2) return; @@ -164,8 +164,8 @@ void Splitter::recompute_grabbables() size_t end_index = 1; while (end_index < child_widgets.size()) { - auto const& first_widget = *child_widgets[start_index]; - auto const& second_widget = *child_widgets[end_index]; + auto const& first_widget = child_widgets[start_index]; + auto const& second_widget = child_widgets[end_index]; m_grabbables.append(Grabbable { .index = m_grabbables.size(), .grabbable_rect = rect_between_widgets(first_widget, second_widget, true), diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index 96c30728cb..d3d00b9b1a 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -851,14 +851,14 @@ void Widget::focus_previous_widget(FocusSource source, bool siblings_only) { auto focusable_widgets = window()->focusable_widgets(source); if (siblings_only) - focusable_widgets.remove_all_matching([this](auto& entry) { return entry->parent() != parent(); }); + focusable_widgets.remove_all_matching([this](auto& entry) { return entry.parent() != parent(); }); for (int i = focusable_widgets.size() - 1; i >= 0; --i) { - if (focusable_widgets[i] != this) + if (&focusable_widgets[i] != this) continue; if (i > 0) - focusable_widgets[i - 1]->set_focus(true, source); + focusable_widgets[i - 1].set_focus(true, source); else - focusable_widgets.last()->set_focus(true, source); + focusable_widgets.last().set_focus(true, source); } } @@ -866,24 +866,24 @@ void Widget::focus_next_widget(FocusSource source, bool siblings_only) { auto focusable_widgets = window()->focusable_widgets(source); if (siblings_only) - focusable_widgets.remove_all_matching([this](auto& entry) { return entry->parent() != parent(); }); + focusable_widgets.remove_all_matching([this](auto& entry) { return entry.parent() != parent(); }); for (size_t i = 0; i < focusable_widgets.size(); ++i) { - if (focusable_widgets[i] != this) + if (&focusable_widgets[i] != this) continue; if (i < focusable_widgets.size() - 1) - focusable_widgets[i + 1]->set_focus(true, source); + focusable_widgets[i + 1].set_focus(true, source); else - focusable_widgets.first()->set_focus(true, source); + focusable_widgets.first().set_focus(true, source); } } -Vector Widget::child_widgets() const +Vector Widget::child_widgets() const { - Vector widgets; + Vector widgets; widgets.ensure_capacity(children().size()); for (auto& child : const_cast(this)->children()) { if (is(child)) - widgets.append(static_cast(&child)); + widgets.append(static_cast(child)); } return widgets; } diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 2ec342cc53..d22eacc1e4 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -250,7 +250,7 @@ public: }); } - Vector child_widgets() const; + Vector child_widgets() const; void do_layout(); diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 07a3de700e..66a8258e0b 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -843,13 +843,13 @@ void Window::start_interactive_resize() WindowServerConnection::the().async_start_window_resize(m_window_id); } -Vector Window::focusable_widgets(FocusSource source) const +Vector Window::focusable_widgets(FocusSource source) const { if (!m_main_widget) return {}; HashTable seen_widgets; - Vector collected_widgets; + Vector collected_widgets; Function collect_focusable_widgets = [&](auto& widget) { bool widget_accepts_focus = false; @@ -868,7 +868,7 @@ Vector Window::focusable_widgets(FocusSource source) const if (widget_accepts_focus) { auto& effective_focus_widget = widget.focus_proxy() ? *widget.focus_proxy() : widget; if (seen_widgets.set(&effective_focus_widget) == AK::HashSetResult::InsertedNewEntry) - collected_widgets.append(&effective_focus_widget); + collected_widgets.append(effective_focus_widget); } widget.for_each_child_widget([&](auto& child) { if (!child.is_visible()) @@ -1056,7 +1056,7 @@ void Window::focus_a_widget_if_possible(FocusSource source) { auto focusable_widgets = this->focusable_widgets(source); if (!focusable_widgets.is_empty()) - set_focused_widget(focusable_widgets[0], source); + set_focused_widget(&focusable_widgets[0], source); } void Window::did_disable_focused_widget(Badge) diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 662141ff4b..904eec1234 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -172,7 +172,7 @@ public: void apply_icon(); const Gfx::Bitmap* icon() const { return m_icon.ptr(); } - Vector focusable_widgets(FocusSource) const; + Vector focusable_widgets(FocusSource) const; void schedule_relayout(); diff --git a/Userland/Libraries/LibTLS/HandshakeClient.cpp b/Userland/Libraries/LibTLS/HandshakeClient.cpp index 55521d658b..bea4d0ed4c 100644 --- a/Userland/Libraries/LibTLS/HandshakeClient.cpp +++ b/Userland/Libraries/LibTLS/HandshakeClient.cpp @@ -228,7 +228,7 @@ ByteBuffer TLSv12::build_certificate() { PacketBuilder builder { MessageType::Handshake, m_context.options.version }; - Vector certificates; + Vector certificates; Vector* local_certificates = nullptr; if (m_context.is_server) { @@ -250,7 +250,7 @@ ByteBuffer TLSv12::build_certificate() // FIXME: Check for and respond with only the requested certificate types. if (true) { - certificates.append(&certificate); + certificates.append(certificate); } } } @@ -266,9 +266,9 @@ ByteBuffer TLSv12::build_certificate() builder.append_u24(total_certificate_size); for (auto& certificate : certificates) { - if (!certificate->der.is_empty()) { - builder.append_u24(certificate->der.size()); - builder.append(certificate->der.bytes()); + if (!certificate.der.is_empty()) { + builder.append_u24(certificate.der.size()); + builder.append(certificate.der.bytes()); } } } diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp index 2dc82f3c4e..3e0dd512df 100644 --- a/Userland/Services/WindowServer/MenuManager.cpp +++ b/Userland/Services/WindowServer/MenuManager.cpp @@ -227,34 +227,34 @@ void MenuManager::close_everyone() void MenuManager::close_everyone_not_in_lineage(Menu& menu) { - Vector menus_to_close; + Vector menus_to_close; for (auto& open_menu : m_open_menu_stack) { if (!open_menu) continue; if (&menu == open_menu.ptr() || open_menu->is_menu_ancestor_of(menu)) continue; - menus_to_close.append(open_menu); + menus_to_close.append(*open_menu); } close_menus(menus_to_close); } -void MenuManager::close_menus(const Vector& menus) +void MenuManager::close_menus(const Vector& menus) { for (auto& menu : menus) { - if (menu == m_current_menu) + if (&menu == m_current_menu) clear_current_menu(); - menu->set_visible(false); - menu->clear_hovered_item(); + menu.set_visible(false); + menu.clear_hovered_item(); m_open_menu_stack.remove_first_matching([&](auto& entry) { - return entry == menu; + return entry == &menu; }); } refresh(); } -static void collect_menu_subtree(Menu& menu, Vector& menus) +static void collect_menu_subtree(Menu& menu, Vector& menus) { - menus.append(&menu); + menus.append(menu); for (size_t i = 0; i < menu.item_count(); ++i) { auto& item = menu.item(i); if (!item.is_submenu()) @@ -265,7 +265,7 @@ static void collect_menu_subtree(Menu& menu, Vector& menus) void MenuManager::close_menu_and_descendants(Menu& menu) { - Vector menus_to_close; + Vector menus_to_close; collect_menu_subtree(menu, menus_to_close); close_menus(menus_to_close); } diff --git a/Userland/Services/WindowServer/MenuManager.h b/Userland/Services/WindowServer/MenuManager.h index b3af227fcc..8132e3a459 100644 --- a/Userland/Services/WindowServer/MenuManager.h +++ b/Userland/Services/WindowServer/MenuManager.h @@ -50,7 +50,7 @@ public: Menu* hovered_menu() { return m_hovered_menu; } private: - void close_menus(const Vector&); + void close_menus(const Vector&); virtual void event(Core::Event&) override; void handle_mouse_event(MouseEvent&); diff --git a/Userland/Services/WindowServer/Menubar.cpp b/Userland/Services/WindowServer/Menubar.cpp index 34991bee79..3bd9ecea88 100644 --- a/Userland/Services/WindowServer/Menubar.cpp +++ b/Userland/Services/WindowServer/Menubar.cpp @@ -21,7 +21,7 @@ Menubar::~Menubar() void Menubar::add_menu(Menu& menu) { - m_menus.append(&menu); + m_menus.append(menu); } } diff --git a/Userland/Services/WindowServer/Menubar.h b/Userland/Services/WindowServer/Menubar.h index 03e10d14c5..838718252b 100644 --- a/Userland/Services/WindowServer/Menubar.h +++ b/Userland/Services/WindowServer/Menubar.h @@ -29,7 +29,7 @@ public: void for_each_menu(Callback callback) { for (auto& menu : m_menus) { - if (callback(*menu) == IterationDecision::Break) + if (callback(menu) == IterationDecision::Break) return; } } @@ -39,7 +39,7 @@ private: ClientConnection& m_client; int m_menubar_id { 0 }; - Vector m_menus; + Vector m_menus; }; } diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h index 4bd6ceabc7..92c0af8fe8 100644 --- a/Userland/Services/WindowServer/WindowManager.h +++ b/Userland/Services/WindowServer/WindowManager.h @@ -200,19 +200,19 @@ public: { auto* blocking_modal_window = window.blocking_modal_window(); if (blocking_modal_window || window.is_modal()) { - Vector modal_stack; + Vector modal_stack; auto* modal_stack_top = blocking_modal_window ? blocking_modal_window : &window; for (auto* parent = modal_stack_top->parent_window(); parent; parent = parent->parent_window()) { auto* blocked_by = parent->blocking_modal_window(); if (!blocked_by || (blocked_by != modal_stack_top && !modal_stack_top->is_descendant_of(*blocked_by))) break; - modal_stack.append(parent); + modal_stack.append(*parent); if (!parent->is_modal()) break; } if (!modal_stack.is_empty()) { for (size_t i = modal_stack.size(); i > 0; i--) { - IterationDecision decision = f(*modal_stack[i - 1], false); + IterationDecision decision = f(modal_stack[i - 1], false); if (decision != IterationDecision::Continue) return decision; }