mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibPDF: Give Parser a reference to the Document
The Parser will need to call resolve_to on certain values.
This commit is contained in:
parent
6808cd1915
commit
2f0a2865f2
Notes:
sideshowbarker
2024-07-18 17:51:34 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/2f0a2865f24 Pull-request: https://github.com/SerenityOS/serenity/pull/7018 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/bcoles Reviewed-by: https://github.com/tomuta
2 changed files with 5 additions and 0 deletions
|
@ -12,6 +12,8 @@ namespace PDF {
|
|||
Document::Document(const ReadonlyBytes& bytes)
|
||||
: m_parser(Parser({}, bytes))
|
||||
{
|
||||
m_parser.set_document(this);
|
||||
|
||||
VERIFY(m_parser.perform_validation());
|
||||
auto [xref_table, trailer] = m_parser.parse_last_xref_table_and_trailer();
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ class Parser {
|
|||
public:
|
||||
Parser(Badge<Document>, const ReadonlyBytes&);
|
||||
|
||||
void set_document(RefPtr<Document> document) { m_document = document; }
|
||||
|
||||
bool perform_validation();
|
||||
|
||||
struct XRefTableAndTrailer {
|
||||
|
@ -74,6 +76,7 @@ private:
|
|||
void consume(char);
|
||||
|
||||
Reader m_reader;
|
||||
RefPtr<Document> m_document;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue