diff options
author | Andreas Kling <kling@serenityos.org> | 2023-03-06 14:17:01 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-06 23:46:35 +0100 |
commit | 8a48246ed1a93983668a25f5b9b0af0e745e3f04 (patch) | |
tree | dd98425d119f79e0160bf19951f96a4a30276cbb /Userland/Applications/Presenter | |
parent | 104be6c8ace8d56f66a89b570cdd615e74d22aa8 (diff) | |
download | serenity-8a48246ed1a93983668a25f5b9b0af0e745e3f04.zip |
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<T> with Vector<NNRP<T>>.
Diffstat (limited to 'Userland/Applications/Presenter')
-rw-r--r-- | Userland/Applications/Presenter/Slide.cpp | 6 | ||||
-rw-r--r-- | Userland/Applications/Presenter/Slide.h | 4 |
2 files changed, 5 insertions, 5 deletions
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 <AK/JsonObject.h> -Slide::Slide(NonnullRefPtrVector<SlideObject> slide_objects, DeprecatedString title) +Slide::Slide(Vector<NonnullRefPtr<SlideObject>> slide_objects, DeprecatedString title) : m_slide_objects(move(slide_objects)) , m_title(move(title)) { @@ -25,7 +25,7 @@ ErrorOr<Slide> 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<SlideObject> slide_objects; + Vector<NonnullRefPtr<SlideObject>> 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<HTMLElement> 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<HTMLElement> render(Presentation const&) const; private: - Slide(NonnullRefPtrVector<SlideObject> slide_objects, DeprecatedString title); + Slide(Vector<NonnullRefPtr<SlideObject>> slide_objects, DeprecatedString title); - NonnullRefPtrVector<SlideObject> m_slide_objects; + Vector<NonnullRefPtr<SlideObject>> m_slide_objects; DeprecatedString m_title; }; |