summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index f636704162..437f214db6 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -61,10 +61,7 @@ class CPDF_Parser {
void SetPassword(const char* password) { m_Password = password; }
CFX_ByteString GetPassword() { return m_Password; }
- CPDF_Dictionary* GetTrailer() const {
- return m_TrailerPos == kInvalidPos ? nullptr
- : m_Trailers[m_TrailerPos].get();
- }
+ CPDF_Dictionary* GetTrailer() const;
FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; }
uint32_t GetPermissions() const;
@@ -128,6 +125,8 @@ class CPDF_Parser {
private:
friend class CPDF_DataAvail;
+ class TrailerData;
+
enum class ParserState {
kDefault,
kComment,
@@ -176,8 +175,7 @@ class CPDF_Parser {
uint32_t start_objnum,
uint32_t count,
std::vector<CrossRefObjData>* out_objects);
- bool ParseCrossRefV4(std::vector<CrossRefObjData>* out_objects,
- uint32_t* start_obj_num_at_last_block);
+ bool ParseCrossRefV4(std::vector<CrossRefObjData>* out_objects);
void MergeCrossRefObjectsData(const std::vector<CrossRefObjData>& objects);
std::unique_ptr<CPDF_Object> ParseIndirectObjectAtInternal(
@@ -199,10 +197,9 @@ class CPDF_Parser {
FX_FILESIZE m_LastXRefOffset;
std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler;
CFX_ByteString m_Password;
- std::vector<std::unique_ptr<CPDF_Dictionary>> m_Trailers;
- size_t m_TrailerPos;
+ std::unique_ptr<TrailerData> m_TrailerData;
std::unique_ptr<CPDF_LinearizedHeader> m_pLinearized;
- uint32_t m_dwXrefStartObjNum;
+ uint32_t m_linearized_first_page_cross_ref_start_obj_num;
// A map of object numbers to indirect streams.
std::map<uint32_t, CFX_RetainPtr<CPDF_StreamAcc>> m_ObjectStreamMap;