diff options
author | thestig <thestig@chromium.org> | 2016-05-23 10:21:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-23 10:21:45 -0700 |
commit | 168fc2be3253fdfb8a58685b89d28a471fa4740a (patch) | |
tree | a63cdaac7e5a0206b54704b725b1da85f4282655 | |
parent | 885bba0b002e2a70e7808e65a53d6f977ddccd95 (diff) | |
download | pdfium-168fc2be3253fdfb8a58685b89d28a471fa4740a.tar.xz |
Delete CPDF_Object::IsModified().
Review-Url: https://codereview.chromium.org/2001933002
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 25 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_object.h | 1 |
2 files changed, 12 insertions, 14 deletions
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 658b9782e5..994c1c8a5a 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -1353,28 +1353,26 @@ void CPDF_Creator::InitOldObjNumOffsets() { dwStart = j; } } + void CPDF_Creator::InitNewObjNumOffsets() { FX_BOOL bIncremental = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0; FX_BOOL bNoOriginal = (m_dwFlags & FPDFCREATE_NO_ORIGINAL) != 0; for (const auto& pair : m_pDocument->m_IndirectObjs) { const uint32_t objnum = pair.first; const CPDF_Object* pObj = pair.second; - if (pObj->GetObjNum() == CPDF_Object::kInvalidObjNum) + if (bIncremental || pObj->GetObjNum() == CPDF_Object::kInvalidObjNum) continue; - if (bIncremental) { - if (!pObj->IsModified()) - continue; - } else if (m_pParser && m_pParser->IsValidObjectNumber(objnum) && - m_pParser->GetObjectType(objnum)) { + if (m_pParser && m_pParser->IsValidObjectNumber(objnum) && + m_pParser->GetObjectType(objnum)) { continue; } AppendNewObjNum(objnum); } int32_t iCount = m_NewObjNumArray.GetSize(); - if (iCount == 0) { + if (iCount == 0) return; - } + int32_t i = 0; uint32_t dwStartObjNum = 0; FX_BOOL bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0; @@ -1386,12 +1384,12 @@ void CPDF_Creator::InitNewObjNumOffsets() { } i++; } - if (i >= iCount) { + if (i >= iCount) return; - } + uint32_t dwLastObjNum = dwStartObjNum; i++; - FX_BOOL bNewStart = FALSE; + bool bNewStart = false; for (; i < iCount; i++) { uint32_t dwCurObjNum = m_NewObjNumArray.ElementAt(i); bool bExist = m_pParser && m_pParser->IsValidObjectNumber(dwCurObjNum) && @@ -1401,14 +1399,15 @@ void CPDF_Creator::InitNewObjNumOffsets() { m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1); dwStartObjNum = dwCurObjNum; } - if (bNewStart) { + if (bNewStart) dwStartObjNum = dwCurObjNum; - } + bNewStart = bExist; dwLastObjNum = dwCurObjNum; } m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1); } + void CPDF_Creator::AppendNewObjNum(uint32_t objbum) { int32_t iStart = 0, iFind = 0; int32_t iEnd = m_NewObjNumArray.GetUpperBound(); diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_object.h b/core/fpdfapi/fpdf_parser/include/cpdf_object.h index 0d2e87e9f1..f637e36667 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_object.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_object.h @@ -42,7 +42,6 @@ class CPDF_Object { virtual CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const = 0; virtual CPDF_Object* GetDirect() const; - FX_BOOL IsModified() const { return FALSE; } void Release(); virtual CFX_ByteString GetString() const; |