summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-07-20 21:38:39 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-07-20 19:30:01 +0000
commitbba6b77b6b35da6b5884248d768f12615f62a003 (patch)
tree2259a6529e066d2f3ebc4b4310beeb479282a11e /core/fpdfapi/edit
parentc760024a54b92a2e091cfcae4d9bbb7d52e66374 (diff)
downloadpdfium-bba6b77b6b35da6b5884248d768f12615f62a003.tar.xz
Use enum for pdf object type
Replace uint8_t type to enum for ObjectType variables Change-Id: Ie33c8c9413c5082397a2c6fbf73e03f08b7d8658 Reviewed-on: https://pdfium-review.googlesource.com/8470 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_creator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp
index 858d56cbaf..ceffa5077f 100644
--- a/core/fpdfapi/edit/cpdf_creator.cpp
+++ b/core/fpdfapi/edit/cpdf_creator.cpp
@@ -323,9 +323,9 @@ bool CPDF_Creator::WriteOldIndirectObject(uint32_t objnum) {
m_ObjectOffsets[objnum] = m_Archive->CurrentOffset();
bool bExistInMap = !!m_pDocument->GetIndirectObject(objnum);
- const uint8_t object_type = m_pParser->GetObjectType(objnum);
+ const CPDF_Parser::ObjectType object_type = m_pParser->GetObjectType(objnum);
if (m_pParser->IsVersionUpdated() || m_bSecurityChanged || bExistInMap ||
- (object_type == 2 && m_pEncryptDict)) {
+ (object_type == CPDF_Parser::ObjectType::kCompressed && m_pEncryptDict)) {
CPDF_Object* pObj = m_pDocument->GetOrParseIndirectObject(objnum);
if (!pObj) {
m_ObjectOffsets.erase(objnum);
@@ -341,7 +341,7 @@ bool CPDF_Creator::WriteOldIndirectObject(uint32_t objnum) {
m_pParser->GetIndirectBinary(objnum, pBuffer, size);
if (!pBuffer)
return true;
- if (object_type == 2) {
+ if (object_type == CPDF_Parser::ObjectType::kCompressed) {
if (!m_Archive->WriteDWord(objnum) ||
!m_Archive->WriteString(" 0 obj ") ||
!m_Archive->WriteBlock(pBuffer, size) ||
@@ -412,7 +412,7 @@ void CPDF_Creator::InitNewObjNumOffsets() {
continue;
}
if (m_pParser && m_pParser->IsValidObjectNumber(objnum) &&
- m_pParser->GetObjectType(objnum)) {
+ m_pParser->GetObjectType(objnum) != CPDF_Parser::ObjectType::kFree) {
continue;
}
m_NewObjNumArray.insert(std::lower_bound(m_NewObjNumArray.begin(),