diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2017-10-02 19:23:28 +0300 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-02 16:36:31 +0000 |
commit | 1cfdb58521aa96f6c0cc39a8e8fa31f2ee6ad4a9 (patch) | |
tree | 24cc7990715938ab9b57d545958cf8492e4d6aef /core/fpdfapi/parser/cpdf_parser.cpp | |
parent | d8169d7607b5084cdeceee3eaffca0ab16d2c14d (diff) | |
download | pdfium-1cfdb58521aa96f6c0cc39a8e8fa31f2ee6ad4a9.tar.xz |
Move CPDF_Parser::ObjectType into protected section
Change-Id: I2a26647359a7d14d7d1269fe2835e0b3184f2ca8
Reviewed-on: https://pdfium-review.googlesource.com/13732
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
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; + } +} |