From 8a48246ed1a93983668a25f5b9b0af0e745e3f04 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 Mar 2023 14:17:01 +0100 Subject: Everywhere: Stop using NonnullRefPtrVector This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector with Vector>. --- Userland/Applications/Presenter/Slide.cpp | 6 +++--- Userland/Applications/Presenter/Slide.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Userland/Applications/Presenter') diff --git a/Userland/Applications/Presenter/Slide.cpp b/Userland/Applications/Presenter/Slide.cpp index fcbed85419..8e07961a19 100644 --- a/Userland/Applications/Presenter/Slide.cpp +++ b/Userland/Applications/Presenter/Slide.cpp @@ -9,7 +9,7 @@ #include "Presentation.h" #include -Slide::Slide(NonnullRefPtrVector slide_objects, DeprecatedString title) +Slide::Slide(Vector> slide_objects, DeprecatedString title) : m_slide_objects(move(slide_objects)) , m_title(move(title)) { @@ -25,7 +25,7 @@ ErrorOr Slide::parse_slide(JsonObject const& slide_json) return Error::from_string_view("Slide objects must be an array"sv); auto const& json_slide_objects = maybe_slide_objects.value(); - NonnullRefPtrVector slide_objects; + Vector> slide_objects; for (auto const& maybe_slide_object_json : json_slide_objects.values()) { if (!maybe_slide_object_json.is_object()) return Error::from_string_view("Slides must be objects"sv); @@ -43,6 +43,6 @@ ErrorOr Slide::render(Presentation const& presentation) const HTMLElement wrapper; wrapper.tag_name = "div"sv; for (auto const& object : m_slide_objects) - TRY(wrapper.children.try_append(TRY(object.render(presentation)))); + TRY(wrapper.children.try_append(TRY(object->render(presentation)))); return wrapper; } diff --git a/Userland/Applications/Presenter/Slide.h b/Userland/Applications/Presenter/Slide.h index 8e7482b47b..013917d315 100644 --- a/Userland/Applications/Presenter/Slide.h +++ b/Userland/Applications/Presenter/Slide.h @@ -24,8 +24,8 @@ public: ErrorOr render(Presentation const&) const; private: - Slide(NonnullRefPtrVector slide_objects, DeprecatedString title); + Slide(Vector> slide_objects, DeprecatedString title); - NonnullRefPtrVector m_slide_objects; + Vector> m_slide_objects; DeprecatedString m_title; }; -- cgit v1.2.3