mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 05:27:45 +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
|
@ -17,7 +17,7 @@ DeprecatedString OutlineItem::to_deprecated_string(int indent) const
|
|||
StringBuilder child_builder;
|
||||
child_builder.append('[');
|
||||
for (auto& child : children)
|
||||
child_builder.appendff("{}\n", child.to_deprecated_string(indent + 1));
|
||||
child_builder.appendff("{}\n", child->to_deprecated_string(indent + 1));
|
||||
child_builder.appendff("{}]", indent_str);
|
||||
|
||||
StringBuilder builder;
|
||||
|
@ -335,7 +335,7 @@ PDFErrorOr<NonnullRefPtr<OutlineItem>> Document::build_outline_item(NonnullRefPt
|
|||
auto first_ref = outline_item_dict->get_value(CommonNames::First);
|
||||
auto children = TRY(build_outline_item_chain(first_ref, page_number_by_index_ref));
|
||||
for (auto& child : children) {
|
||||
child.parent = outline_item;
|
||||
child->parent = outline_item;
|
||||
}
|
||||
outline_item->children = move(children);
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ PDFErrorOr<NonnullRefPtr<OutlineItem>> Document::build_outline_item(NonnullRefPt
|
|||
return outline_item;
|
||||
}
|
||||
|
||||
PDFErrorOr<NonnullRefPtrVector<OutlineItem>> Document::build_outline_item_chain(Value const& first_ref, HashMap<u32, u32> const& page_number_by_index_ref)
|
||||
PDFErrorOr<Vector<NonnullRefPtr<OutlineItem>>> Document::build_outline_item_chain(Value const& first_ref, HashMap<u32, u32> const& page_number_by_index_ref)
|
||||
{
|
||||
// We used to receive a last_ref parameter, which was what the parent of this chain
|
||||
// thought was this chain's last child. There are documents out there in the wild
|
||||
|
@ -399,7 +399,7 @@ PDFErrorOr<NonnullRefPtrVector<OutlineItem>> Document::build_outline_item_chain(
|
|||
// (we already ignore the /Parent attribute too, which can also be out of sync).
|
||||
VERIFY(first_ref.has<Reference>());
|
||||
|
||||
NonnullRefPtrVector<OutlineItem> children;
|
||||
Vector<NonnullRefPtr<OutlineItem>> children;
|
||||
|
||||
auto first_value = TRY(get_or_load_value(first_ref.as_ref_index())).get<NonnullRefPtr<Object>>();
|
||||
auto first_dict = first_value->cast<DictObject>();
|
||||
|
|
|
@ -56,7 +56,7 @@ struct Destination {
|
|||
|
||||
struct OutlineItem final : public RefCounted<OutlineItem> {
|
||||
RefPtr<OutlineItem> parent;
|
||||
NonnullRefPtrVector<OutlineItem> children;
|
||||
Vector<NonnullRefPtr<OutlineItem>> children;
|
||||
DeprecatedString title;
|
||||
i32 count { 0 };
|
||||
Destination dest;
|
||||
|
@ -70,7 +70,7 @@ struct OutlineItem final : public RefCounted<OutlineItem> {
|
|||
};
|
||||
|
||||
struct OutlineDict final : public RefCounted<OutlineDict> {
|
||||
NonnullRefPtrVector<OutlineItem> children;
|
||||
Vector<NonnullRefPtr<OutlineItem>> children;
|
||||
u32 count { 0 };
|
||||
|
||||
OutlineDict() = default;
|
||||
|
@ -138,7 +138,7 @@ private:
|
|||
|
||||
PDFErrorOr<void> build_outline();
|
||||
PDFErrorOr<NonnullRefPtr<OutlineItem>> build_outline_item(NonnullRefPtr<DictObject> const& outline_item_dict, HashMap<u32, u32> const&);
|
||||
PDFErrorOr<NonnullRefPtrVector<OutlineItem>> build_outline_item_chain(Value const& first_ref, HashMap<u32, u32> const&);
|
||||
PDFErrorOr<Vector<NonnullRefPtr<OutlineItem>>> build_outline_item_chain(Value const& first_ref, HashMap<u32, u32> const&);
|
||||
|
||||
PDFErrorOr<Destination> create_destination_from_parameters(NonnullRefPtr<ArrayObject>, HashMap<u32, u32> const&);
|
||||
PDFErrorOr<Destination> create_destination_from_dictionary_entry(NonnullRefPtr<Object> const& entry, HashMap<u32, u32> const& page_number_by_index_ref);
|
||||
|
@ -258,7 +258,7 @@ struct Formatter<PDF::OutlineDict> : Formatter<FormatString> {
|
|||
StringBuilder child_builder;
|
||||
child_builder.append('[');
|
||||
for (auto& child : dict.children)
|
||||
child_builder.appendff("{}\n", child.to_deprecated_string(2));
|
||||
child_builder.appendff("{}\n", child->to_deprecated_string(2));
|
||||
child_builder.append(" ]"sv);
|
||||
|
||||
return Formatter<FormatString>::format(builder,
|
||||
|
|
|
@ -238,7 +238,7 @@ RENDERER_HANDLER(path_cubic_bezier_curve_no_first_control)
|
|||
{
|
||||
VERIFY(args.size() == 4);
|
||||
VERIFY(!m_current_path.segments().is_empty());
|
||||
auto current_point = m_current_path.segments().rbegin()->point();
|
||||
auto current_point = (*m_current_path.segments().rbegin())->point();
|
||||
m_current_path.cubic_bezier_curve_to(
|
||||
current_point,
|
||||
map(args[0].to_float(), args[1].to_float()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue