summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
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/edit
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/edit')
-rw-r--r--core/fpdfapi/edit/fpdf_edit_create.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fpdfapi/edit/fpdf_edit_create.cpp b/core/fpdfapi/edit/fpdf_edit_create.cpp
index ac8d709a2e..e5b1fe1bb0 100644
--- a/core/fpdfapi/edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/edit/fpdf_edit_create.cpp
@@ -97,7 +97,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj,
const CPDF_Array* p = pObj->AsArray();
for (size_t i = 0; i < p->GetCount(); i++) {
CPDF_Object* pElement = p->GetObjectAt(i);
- if (pElement->GetObjNum()) {
+ if (!pElement->IsInline()) {
if (pFile->AppendString(" ") < 0) {
return -1;
}
@@ -136,7 +136,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj,
return -1;
}
offset += len + 1;
- if (pValue->GetObjNum()) {
+ if (!pValue->IsInline()) {
if (pFile->AppendString(" ") < 0) {
return -1;
}
@@ -213,7 +213,7 @@ int32_t PDF_CreatorWriteTrailer(CPDF_Document* pDocument,
return -1;
}
offset += len + 1;
- if (pValue->GetObjNum()) {
+ if (!pValue->IsInline()) {
if (pFile->AppendString(" ") < 0) {
return -1;
}
@@ -1157,7 +1157,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum,
const CPDF_Array* p = pObj->AsArray();
for (size_t i = 0; i < p->GetCount(); i++) {
CPDF_Object* pElement = p->GetObjectAt(i);
- if (pElement->GetObjNum()) {
+ if (!pElement->IsInline()) {
if (m_File.AppendString(" ") < 0) {
return -1;
}
@@ -1203,7 +1203,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum,
if (bSignDict && key == "Contents") {
bSignValue = TRUE;
}
- if (pValue->GetObjNum()) {
+ if (!pValue->IsInline()) {
if (m_File.AppendString(" ") < 0) {
return -1;
}
@@ -1562,7 +1562,7 @@ int32_t CPDF_Creator::WriteDoc_Stage2(IFX_Pause* pPause) {
m_iStage = 27;
}
if (m_iStage == 27) {
- if (m_pEncryptDict && !m_pEncryptDict->GetObjNum()) {
+ if (m_pEncryptDict && m_pEncryptDict->IsInline()) {
m_dwLastObjNum += 1;
FX_FILESIZE saveOffset = m_Offset;
if (WriteIndirectObj(m_dwLastObjNum, m_pEncryptDict) < 0) {
@@ -1728,7 +1728,7 @@ int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause* pPause) {
if (m_File.AppendString(PDF_NameEncode(key).AsStringC()) < 0) {
return -1;
}
- if (pValue->GetObjNum()) {
+ if (!pValue->IsInline()) {
if (m_File.AppendString(" ") < 0) {
return -1;
}