From fb72726e51bfd0c7bfc61c9b354e2b60f46adac5 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Mon, 11 Jun 2018 18:19:57 +0000 Subject: Implement CPDF_Object::MakeReference method. Change-Id: I153747ef587a184eaef58ff09dbf8f214c9ddfb3 Reviewed-on: https://pdfium-review.googlesource.com/17230 Reviewed-by: Tom Sepez Commit-Queue: Art Snake --- fpdfsdk/fpdf_ppo.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'fpdfsdk/fpdf_ppo.cpp') diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp index c4bd51e603..8bbae7258d 100644 --- a/fpdfsdk/fpdf_ppo.cpp +++ b/fpdfsdk/fpdf_ppo.cpp @@ -337,8 +337,7 @@ bool CPDF_PageOrganizer::PDFDocInit() { pElement ? ToDictionary(pElement->GetDirect()) : nullptr; if (!pNewPages) { pNewPages = dest()->NewIndirect(); - pNewRoot->SetNewFor("Pages", dest(), - pNewPages->GetObjNum()); + pNewRoot->SetFor("Pages", pNewPages->MakeReference(dest())); } ByteString cbPageType = pNewPages->GetStringFor("Type", ""); @@ -347,8 +346,8 @@ bool CPDF_PageOrganizer::PDFDocInit() { if (!pNewPages->GetArrayFor("Kids")) { pNewPages->SetNewFor("Count", 0); - pNewPages->SetNewFor( - "Kids", dest(), dest()->NewIndirect()->GetObjNum()); + pNewPages->SetFor("Kids", + dest()->NewIndirect()->MakeReference(dest())); } return true; @@ -754,8 +753,8 @@ void CPDF_NPageToOneExporter::FinishPage( CPDF_Stream* pStream = dest()->NewIndirect(nullptr, 0, std::move(pDict)); pStream->SetData(bsContent.raw_str(), bsContent.GetLength()); - pDestPageDict->SetNewFor(pdfium::page_object::kContents, - dest(), pStream->GetObjNum()); + pDestPageDict->SetFor(pdfium::page_object::kContents, + pStream->MakeReference(dest())); } } // namespace -- cgit v1.2.3