From 2c47fb2c9b3db7be3480cbc044fa90fda988b97f Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Mon, 26 Mar 2018 20:17:29 +0000 Subject: Do not call CPDF_PageObjectList directly in fpdfeditpage.cpp. Change-Id: If816c4f532f03513ad06959182b0e0edfd688e39 Reviewed-on: https://pdfium-review.googlesource.com/29170 Reviewed-by: dsinclair Commit-Queue: Henrique Nakashima --- fpdfsdk/fpdfeditpage.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index 800613348b..902aab4dd1 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -175,8 +175,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertObject(FPDF_PAGE page, return; pPageObj->SetDirty(true); - // TODO(hnakashima): Move into CPDF_Page. - pPage->GetPageObjectList()->push_back(std::move(pPageObjHolder)); + pPage->AppendPageObject(std::move(pPageObjHolder)); CalcBoundingBox(pPageObj); } @@ -190,7 +189,7 @@ FPDFPage_RemoveObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj) { if (!IsPageObject(pPage)) return false; - return pPage->RemoveObject(pPageObj); + return pPage->RemovePageObject(pPageObj); } FPDF_EXPORT int FPDF_CALLCONV FPDFPage_CountObject(FPDF_PAGE page) { @@ -202,8 +201,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_CountObjects(FPDF_PAGE page) { if (!IsPageObject(pPage)) return -1; - // TODO(hnakashima): Move into CPDF_Page. - return pdfium::CollectionSize(*pPage->GetPageObjectList()); + return pPage->GetPageObjectCount(); } FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPage_GetObject(FPDF_PAGE page, @@ -212,8 +210,7 @@ FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPage_GetObject(FPDF_PAGE page, if (!IsPageObject(pPage)) return nullptr; - // TODO(hnakashima): Move into CPDF_Page. - return pPage->GetPageObjectList()->GetPageObjectByIndex(index); + return pPage->GetPageObjectByIndex(index); } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_HasTransparency(FPDF_PAGE page) { -- cgit v1.2.3