summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibPDF
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2022-03-04 19:53:38 -0700
committerAndreas Kling <kling@serenityos.org>2022-03-07 10:53:57 +0100
commitc1aa8c4a444c56215d1744fe0ceaddeb6c9c503e (patch)
tree1d71b8816bfc3d9baa5c4fd001eddd9a310f4d18 /Userland/Libraries/LibPDF
parent455224d4766df886a43c19e9c015533c025d40dd (diff)
downloadserenity-c1aa8c4a444c56215d1744fe0ceaddeb6c9c503e.zip
LibPDF: Remove unused function in Parser
Diffstat (limited to 'Userland/Libraries/LibPDF')
-rw-r--r--Userland/Libraries/LibPDF/Parser.cpp24
-rw-r--r--Userland/Libraries/LibPDF/Parser.h10
2 files changed, 2 insertions, 32 deletions
diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp
index f1c76ad2a1..73fab0b345 100644
--- a/Userland/Libraries/LibPDF/Parser.cpp
+++ b/Userland/Libraries/LibPDF/Parser.cpp
@@ -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
*/
@@ -7,7 +7,6 @@
#include <AK/BitStream.h>
#include <AK/MemoryStream.h>
#include <AK/ScopeGuard.h>
-#include <AK/TypeCasts.h>
#include <LibPDF/CommonNames.h>
#include <LibPDF/Document.h>
#include <LibPDF/Filter.h>
@@ -561,27 +560,6 @@ bool Parser::navigate_to_after_startxref()
return false;
}
-bool Parser::sloppy_is_linearized()
-{
- ScopeGuard guard([&] {
- m_reader.move_to(0);
- m_reader.set_reading_forwards();
- });
-
- auto limit = min(1024ul, m_reader.bytes().size() - 1);
- m_reader.move_to(limit);
- m_reader.set_reading_backwards();
-
- while (!m_reader.done()) {
- m_reader.move_until('/');
- if (m_reader.matches("/Linearized"))
- return true;
- m_reader.move_by(1);
- }
-
- return false;
-}
-
String Parser::parse_comment()
{
if (!m_reader.matches('%'))
diff --git a/Userland/Libraries/LibPDF/Parser.h b/Userland/Libraries/LibPDF/Parser.h
index b862bc67c2..3af930f362 100644
--- a/Userland/Libraries/LibPDF/Parser.h
+++ b/Userland/Libraries/LibPDF/Parser.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
*/
@@ -102,14 +102,6 @@ private:
bool navigate_to_before_eof_marker();
bool navigate_to_after_startxref();
- // If the PDF is linearized, the first object will be the linearization
- // parameter dictionary, and it will always occur within the first 1024 bytes.
- // We do a very sloppy and context-free search for this object. A return value
- // of true does not necessarily mean this PDF is linearized, but a return value
- // of false does mean this PDF is not linearized.
- // FIXME: false doesn't guarantee non-linearization, but we VERIFY the result!
- bool sloppy_is_linearized();
-
String parse_comment();
Value parse_value();