summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfppo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfppo.cpp')
-rw-r--r--fpdfsdk/fpdfppo.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index 705c7e21da..610aae7abd 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -170,9 +170,9 @@ bool CPDF_PageOrganizer::PDFDocInit() {
CPDF_Dictionary* pNewPages =
pElement ? ToDictionary(pElement->GetDirect()) : nullptr;
if (!pNewPages) {
- pNewPages = new CPDF_Dictionary(m_pDestPDFDoc->GetByteStringPool());
- pNewRoot->SetReferenceFor("Pages", m_pDestPDFDoc,
- m_pDestPDFDoc->AddIndirectObject(pNewPages));
+ pNewPages = m_pDestPDFDoc->NewIndirect<CPDF_Dictionary>(
+ m_pDestPDFDoc->GetByteStringPool());
+ pNewRoot->SetReferenceFor("Pages", m_pDestPDFDoc, pNewPages);
}
CFX_ByteString cbPageType = pNewPages->GetStringFor("Type", "");
@@ -181,9 +181,8 @@ bool CPDF_PageOrganizer::PDFDocInit() {
if (!pNewPages->GetArrayFor("Kids")) {
pNewPages->SetIntegerFor("Count", 0);
- pNewPages->SetReferenceFor(
- "Kids", m_pDestPDFDoc,
- m_pDestPDFDoc->AddIndirectObject(new CPDF_Array));
+ pNewPages->SetReferenceFor("Kids", m_pDestPDFDoc,
+ m_pDestPDFDoc->NewIndirect<CPDF_Array>());
}
return true;
@@ -331,8 +330,9 @@ uint32_t CPDF_PageOrganizer::GetNewObjId(ObjectNumberMap* pObjNumberMap,
return 0;
}
}
- CPDF_Object* pUnownedClone = pClone.get();
- dwNewObjNum = m_pDestPDFDoc->AddIndirectObject(pClone.release());
+ CPDF_Object* pUnownedClone =
+ m_pDestPDFDoc->AddIndirectObject(std::move(pClone));
+ dwNewObjNum = pUnownedClone->GetObjNum();
(*pObjNumberMap)[dwObjnum] = dwNewObjNum;
if (!UpdateReference(pUnownedClone, pObjNumberMap))
return 0;