summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
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/parser
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/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_array.cpp10
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.cpp9
2 files changed, 2 insertions, 17 deletions
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index 4f802d9e7f..a5361fbbb9 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -235,16 +235,8 @@ bool CPDF_Array::WriteTo(IFX_ArchiveStream* archive) const {
return false;
for (size_t i = 0; i < GetCount(); ++i) {
- const CPDF_Object* pElement = GetObjectAt(i);
- if (!pElement->IsInline()) {
- if (!archive->WriteString(" ") ||
- !archive->WriteDWord(pElement->GetObjNum()) ||
- !archive->WriteString(" 0 R")) {
- return false;
- }
- } else if (!pElement->WriteTo(archive)) {
+ if (!GetObjectAt(i)->WriteTo(archive))
return false;
- }
}
return archive->WriteString("]");
}
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index ae7239efdf..c6127fa344 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/parser/cpdf_dictionary.cpp
@@ -287,15 +287,8 @@ bool CPDF_Dictionary::WriteTo(IFX_ArchiveStream* archive) const {
return false;
}
- if (!pValue->IsInline()) {
- if (!archive->WriteString(" ") ||
- !archive->WriteDWord(pValue->GetObjNum()) ||
- !archive->WriteString(" 0 R")) {
- return false;
- }
- } else if (!pValue->WriteTo(archive)) {
+ if (!pValue->WriteTo(archive))
return false;
- }
}
return archive->WriteString(">>");
}