mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
LibPDF: Swap int and array branches in outline item reading
No intended behavior change. It does have the effect that indirect object references now go down the array path instead of the number path. They still fall over there, but now that's easy to fix.
This commit is contained in:
parent
208a058eab
commit
b928fadba7
1 changed files with 6 additions and 6 deletions
|
@ -134,12 +134,7 @@ PDFErrorOr<void> Type0Font::initialize(Document* document, NonnullRefPtr<DictObj
|
|||
auto& value = widths_array->at(i);
|
||||
if (!pending_code.has_value()) {
|
||||
pending_code = value.to_int();
|
||||
} else if (value.has<NonnullRefPtr<Object>>()) {
|
||||
auto array = value.get<NonnullRefPtr<Object>>()->cast<ArrayObject>();
|
||||
auto code = pending_code.release_value();
|
||||
for (auto& width : *array)
|
||||
widths.set(code++, width.to_int());
|
||||
} else {
|
||||
} else if (value.has_number()) {
|
||||
auto first_code = pending_code.release_value();
|
||||
auto last_code = value.to_int();
|
||||
auto width = widths_array->at(i + 1).to_int();
|
||||
|
@ -147,6 +142,11 @@ PDFErrorOr<void> Type0Font::initialize(Document* document, NonnullRefPtr<DictObj
|
|||
widths.set(code, width);
|
||||
|
||||
i++;
|
||||
} else {
|
||||
auto array = value.get<NonnullRefPtr<Object>>()->cast<ArrayObject>();
|
||||
auto code = pending_code.release_value();
|
||||
for (auto& width : *array)
|
||||
widths.set(code++, width.to_int());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue