summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfsave.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfsave.cpp')
-rw-r--r--fpdfsdk/fpdfsave.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index e5938b2542..8293c371dc 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -185,10 +185,12 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
} else {
CPDF_Stream* pData = new CPDF_Stream;
pData->InitStreamFromFile(pDsfileWrite.get(), pDataDict);
- uint32_t objnum = pPDFDocument->AddIndirectObject(pData);
iLast = pArray->GetCount() - 2;
pArray->InsertAt(iLast, new CPDF_String("datasets", FALSE));
- pArray->InsertAt(iLast + 1, new CPDF_Reference(pPDFDocument, objnum));
+ pArray->InsertAt(
+ iLast + 1,
+ new CPDF_Reference(pPDFDocument,
+ pPDFDocument->AddIndirectObject(pData)));
}
fileList->push_back(std::move(pDsfileWrite));
}
@@ -206,10 +208,12 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
} else {
CPDF_Stream* pData = new CPDF_Stream;
pData->InitStreamFromFile(pfileWrite.get(), pDataDict);
- uint32_t objnum = pPDFDocument->AddIndirectObject(pData);
iLast = pArray->GetCount() - 2;
pArray->InsertAt(iLast, new CPDF_String("form", FALSE));
- pArray->InsertAt(iLast + 1, new CPDF_Reference(pPDFDocument, objnum));
+ pArray->InsertAt(
+ iLast + 1,
+ new CPDF_Reference(pPDFDocument,
+ pPDFDocument->AddIndirectObject(pData)));
}
fileList->push_back(std::move(pfileWrite));
}