mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
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>>.
This commit is contained in:
parent
104be6c8ac
commit
8a48246ed1
168 changed files with 1280 additions and 1280 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue