mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibPDF: Keep track of OutlineItem parents
While OutlineItem had a parent field, it was never populated nor used. This commit populates it when possible (no parent means the OutlineItem is a top-level item).
This commit is contained in:
parent
2ea8d2547e
commit
3db6af6360
1 changed files with 3 additions and 0 deletions
|
@ -273,6 +273,9 @@ PDFErrorOr<NonnullRefPtr<OutlineItem>> Document::build_outline_item(NonnullRefPt
|
||||||
VERIFY(outline_item_dict->contains(CommonNames::Last));
|
VERIFY(outline_item_dict->contains(CommonNames::Last));
|
||||||
auto first_ref = outline_item_dict->get_value(CommonNames::First);
|
auto first_ref = outline_item_dict->get_value(CommonNames::First);
|
||||||
auto children = TRY(build_outline_item_chain(first_ref));
|
auto children = TRY(build_outline_item_chain(first_ref));
|
||||||
|
for (auto& child : children) {
|
||||||
|
child.parent = outline_item;
|
||||||
|
}
|
||||||
outline_item->children = move(children);
|
outline_item->children = move(children);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue