diff options
author | Lei Zhang <thestig@chromium.org> | 2018-02-09 22:28:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-09 22:28:49 +0000 |
commit | 257900b6dae0fe8d82d48ecc91d92e5dbb3a28bf (patch) | |
tree | e3b53963f47cb34166baafb5eb17b07d1c66c9fe /fpdfsdk/fpdfeditpage.cpp | |
parent | bc5dd9e7901ee56e0db66e76bf2e4903ab3d3fcd (diff) | |
download | pdfium-257900b6dae0fe8d82d48ecc91d92e5dbb3a28bf.tar.xz |
Use CPDF_Dictionary::SetRectFor() when appropriate.
Change-Id: I4ced221fb5691927485deceb7002dac880c2c210
Reviewed-on: https://pdfium-review.googlesource.com/26110
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditpage.cpp')
-rw-r--r-- | fpdfsdk/fpdfeditpage.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index a032bf6607..ca2cf3fb6e 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -142,11 +142,7 @@ FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDFPage_New(FPDF_DOCUMENT document, if (!pPageDict) return nullptr; - CPDF_Array* pMediaBoxArray = pPageDict->SetNewFor<CPDF_Array>("MediaBox"); - pMediaBoxArray->AddNew<CPDF_Number>(0); - pMediaBoxArray->AddNew<CPDF_Number>(0); - pMediaBoxArray->AddNew<CPDF_Number>(static_cast<float>(width)); - pMediaBoxArray->AddNew<CPDF_Number>(static_cast<float>(height)); + pPageDict->SetRectFor("MediaBox", CFX_FloatRect(0, 0, width, height)); pPageDict->SetNewFor<CPDF_Number>("Rotate", 0); pPageDict->SetNewFor<CPDF_Dictionary>("Resources"); |