summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfeditpage.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-16 12:26:06 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-16 12:26:06 -0800
commit8a3aa459fc5284f51bcd7e98e95bf6214f47bb67 (patch)
tree13fb383936d679aded19054f4e7a0387dd52de76 /fpdfsdk/fpdfeditpage.cpp
parent14a60c50b10de1d9e4edd3629ea210a816940a75 (diff)
downloadpdfium-8a3aa459fc5284f51bcd7e98e95bf6214f47bb67.tar.xz
Make CPDF_Array take unique_ptrs
BUG= Review-Url: https://codereview.chromium.org/2498223005
Diffstat (limited to 'fpdfsdk/fpdfeditpage.cpp')
-rw-r--r--fpdfsdk/fpdfeditpage.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp
index 92fd39e78b..9dc8ae9099 100644
--- a/fpdfsdk/fpdfeditpage.cpp
+++ b/fpdfsdk/fpdfeditpage.cpp
@@ -110,10 +110,10 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document,
return nullptr;
CPDF_Array* pMediaBoxArray = new CPDF_Array;
- pMediaBoxArray->Add(new CPDF_Number(0));
- pMediaBoxArray->Add(new CPDF_Number(0));
- pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(width)));
- pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(height)));
+ pMediaBoxArray->AddNew<CPDF_Number>(0);
+ pMediaBoxArray->AddNew<CPDF_Number>(0);
+ pMediaBoxArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(width));
+ pMediaBoxArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(height));
pPageDict->SetFor("MediaBox", pMediaBoxArray);
pPageDict->SetFor("Rotate", new CPDF_Number(0));
pPageDict->SetFor("Resources",
@@ -298,10 +298,10 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
pRectArray = new CPDF_Array;
pAnnot->GetAnnotDict()->SetFor("Rect", pRectArray);
}
- pRectArray->SetAt(0, new CPDF_Number(rect.left));
- pRectArray->SetAt(1, new CPDF_Number(rect.bottom));
- pRectArray->SetAt(2, new CPDF_Number(rect.right));
- pRectArray->SetAt(3, new CPDF_Number(rect.top));
+ pRectArray->SetNewAt<CPDF_Number>(0, rect.left);
+ pRectArray->SetNewAt<CPDF_Number>(1, rect.bottom);
+ pRectArray->SetNewAt<CPDF_Number>(2, rect.right);
+ pRectArray->SetNewAt<CPDF_Number>(3, rect.top);
// TODO: Transform AP's rectangle
}