summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibPDF/XRefTable.h
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2022-03-05 17:30:55 -0700
committerAndreas Kling <kling@serenityos.org>2022-03-07 10:53:57 +0100
commit73cf8205b47d2ca6f0dc01025b84ac31271f7526 (patch)
tree02965c39127215e112f8c6459ba5bb3a84ec435f /Userland/Libraries/LibPDF/XRefTable.h
parent7e1c823725c085e1efb796dfe98fca8f7d7857b7 (diff)
downloadserenity-73cf8205b47d2ca6f0dc01025b84ac31271f7526.zip
LibPDF: Propagate errors in Parser and Document
Diffstat (limited to 'Userland/Libraries/LibPDF/XRefTable.h')
-rw-r--r--Userland/Libraries/LibPDF/XRefTable.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibPDF/XRefTable.h b/Userland/Libraries/LibPDF/XRefTable.h
index efb87f2314..59076009ac 100644
--- a/Userland/Libraries/LibPDF/XRefTable.h
+++ b/Userland/Libraries/LibPDF/XRefTable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
+ * Copyright (c) 2021-2022, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -29,7 +29,7 @@ struct XRefSection {
class XRefTable final : public RefCounted<XRefTable> {
public:
- bool merge(XRefTable&& other)
+ PDFErrorOr<void> merge(XRefTable&& other)
{
auto this_size = m_entries.size();
auto other_size = other.m_entries.size();
@@ -48,11 +48,11 @@ public:
m_entries[i] = other_entry;
} else if (other_entry.byte_offset != invalid_byte_offset) {
// Both xref tables have an entry for the same object index
- return false;
+ return Error { Error::Type::Parse, "Conflicting xref entry during merge" };
}
}
- return true;
+ return {};
}
void add_section(XRefSection const& section)