diff options
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_parser.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index 40d1b49ed6..336e6625b5 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -52,20 +52,6 @@ int32_t GetStreamFirst(const RetainPtr<CPDF_StreamAcc>& pObjStream) { return pObjStream->GetDict()->GetIntegerFor("First"); } -CPDF_Parser::ObjectType GetObjectTypeFromCrossRefStreamType( - int cross_ref_stream_type) { - switch (cross_ref_stream_type) { - case 0: - return CPDF_Parser::ObjectType::kFree; - case 1: - return CPDF_Parser::ObjectType::kNotCompressed; - case 2: - return CPDF_Parser::ObjectType::kCompressed; - default: - return CPDF_Parser::ObjectType::kNull; - } -} - } // namespace class CPDF_Parser::TrailerData { @@ -161,6 +147,10 @@ bool CPDF_Parser::IsObjectFreeOrNull(uint32_t objnum) const { return false; } +bool CPDF_Parser::IsObjectFree(uint32_t objnum) const { + return GetObjectType(objnum) == ObjectType::kFree; +} + void CPDF_Parser::SetEncryptDictionary(CPDF_Dictionary* pDict) { m_pEncryptDict = pDict; } @@ -1486,3 +1476,17 @@ CPDF_Parser::Error CPDF_Parser::LoadLinearizedMainXRefTable() { return SUCCESS; } + +CPDF_Parser::ObjectType CPDF_Parser::GetObjectTypeFromCrossRefStreamType( + int cross_ref_stream_type) const { + switch (cross_ref_stream_type) { + case 0: + return CPDF_Parser::ObjectType::kFree; + case 1: + return CPDF_Parser::ObjectType::kNotCompressed; + case 2: + return CPDF_Parser::ObjectType::kCompressed; + default: + return CPDF_Parser::ObjectType::kNull; + } +} |