summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/fpdf_parser_utility.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-11 13:42:12 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-11 13:42:12 -0700
commitab36e73c8c5409fa262d4fa2faffe65c8804a792 (patch)
tree6a454e2cabb89698f2b05fed0e301eba414b2621 /core/fpdfapi/parser/fpdf_parser_utility.cpp
parenta91b8d395ac8f6aed38cccfda1f38de11dd45bdd (diff)
downloadpdfium-ab36e73c8c5409fa262d4fa2faffe65c8804a792.tar.xz
Add CPDF_Object::IsInline()
Prevent having to remember what an object number of 0 implies. Review-Url: https://codereview.chromium.org/2412673002
Diffstat (limited to 'core/fpdfapi/parser/fpdf_parser_utility.cpp')
-rw-r--r--core/fpdfapi/parser/fpdf_parser_utility.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index 10fac7fa1c..7b9ead4005 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -179,7 +179,7 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) {
buf << "[";
for (size_t i = 0; i < p->GetCount(); i++) {
CPDF_Object* pElement = p->GetObjectAt(i);
- if (pElement && pElement->GetObjNum()) {
+ if (pElement && !pElement->IsInline()) {
buf << " " << pElement->GetObjNum() << " 0 R";
} else {
buf << pElement;
@@ -195,7 +195,7 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) {
const CFX_ByteString& key = it.first;
CPDF_Object* pValue = it.second;
buf << "/" << PDF_NameEncode(key);
- if (pValue && pValue->GetObjNum()) {
+ if (pValue && !pValue->IsInline()) {
buf << " " << pValue->GetObjNum() << " 0 R ";
} else {
buf << pValue;