summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-30 18:55:12 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-30 18:55:12 +0000
commit8fe33fbaecc7a1be1baeb50548be65b5b178a292 (patch)
tree07f2fdfaa434b1e0226fb6f83594d12bb1412c84 /core/fpdfapi/edit
parent170656e36b45ea05662621a0070c985050071c7c (diff)
downloadpdfium-8fe33fbaecc7a1be1baeb50548be65b5b178a292.tar.xz
Remove dead code in various write function.
BUG=pdfium:1093 Change-Id: I05f32018841dfa8b1c4512fb6350fc2a2fe4c5e4 Reviewed-on: https://pdfium-review.googlesource.com/33250 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_creator.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp
index 24c4c2c29a..d386217f23 100644
--- a/core/fpdfapi/edit/cpdf_creator.cpp
+++ b/core/fpdfapi/edit/cpdf_creator.cpp
@@ -260,16 +260,8 @@ bool CPDF_Creator::WriteDirectObj(uint32_t objnum,
const CPDF_Array* p = pObj->AsArray();
for (size_t i = 0; i < p->GetCount(); i++) {
- const CPDF_Object* pElement = p->GetObjectAt(i);
- if (!pElement->IsInline()) {
- if (!m_Archive->WriteString(" ") ||
- !m_Archive->WriteDWord(pElement->GetObjNum()) ||
- !m_Archive->WriteString(" 0 R")) {
- return false;
- }
- } else if (!WriteDirectObj(objnum, pElement, true)) {
+ if (!WriteDirectObj(objnum, p->GetObjectAt(i), true))
return false;
- }
}
if (!m_Archive->WriteString("]"))
return false;
@@ -298,15 +290,8 @@ bool CPDF_Creator::WriteDirectObj(uint32_t objnum,
if (bSignDict && key == "Contents")
bSignValue = true;
- if (!pValue->IsInline()) {
- if (!m_Archive->WriteString(" ") ||
- !m_Archive->WriteDWord(pValue->GetObjNum()) ||
- !m_Archive->WriteString(" 0 R ")) {
- return false;
- }
- } else if (!WriteDirectObj(objnum, pValue, !bSignValue)) {
+ if (!WriteDirectObj(objnum, pValue, !bSignValue))
return false;
- }
}
if (!m_Archive->WriteString(">>"))
return false;
@@ -637,15 +622,8 @@ int32_t CPDF_Creator::WriteDoc_Stage4() {
!m_Archive->WriteString(PDF_NameEncode(key).AsStringView())) {
return -1;
}
- if (!pValue->IsInline()) {
- if (!m_Archive->WriteString(" ") ||
- !m_Archive->WriteDWord(pValue->GetObjNum()) ||
- !m_Archive->WriteString(" 0 R ")) {
- return -1;
- }
- } else if (!pValue->WriteTo(m_Archive.get())) {
+ if (!pValue->WriteTo(m_Archive.get()))
return -1;
- }
}
} else {
if (!m_Archive->WriteString("\r\n/Root ") ||