mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +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
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/b928fadba7 Pull-request: https://github.com/SerenityOS/serenity/pull/21584
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…
Reference in a new issue