Rename FPDFPage_Move() to FPDF_MovePages() Better indicate that this is not a page-level API, and that it can move multiple pages. Bug: pdfium:1587 Change-Id: Ia48c5ef7cc646a8b736d8ac3add248108de1937d Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/112150 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nigi <nigi@chromium.org>
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp index 3f0873b..b4d09de 100644 --- a/fpdfsdk/fpdf_edit_embeddertest.cpp +++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -91,7 +91,7 @@ std::vector<int> page_indices; int page_indices_len; int dest_page_index; - // whether FPDFPage_Move() will succeed or fail + // whether FPDF_MovePages() will succeed or fail bool expected_result; // expected order of pages if `expected_result` is true std::vector<int> expected_order; @@ -4918,8 +4918,8 @@ std::vector<std::string> orig_hashes = HashesForDocument(page_count); ASSERT_THAT(orig_hashes, testing::SizeIs(page_count)); - EXPECT_EQ(FPDFPage_Move(document(), &tc.page_indices[0], - tc.page_indices_len, tc.dest_page_index), + EXPECT_EQ(FPDF_MovePages(document(), &tc.page_indices[0], + tc.page_indices_len, tc.dest_page_index), tc.expected_result) << tc;
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index eb29b30..ee4b678 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp
@@ -196,10 +196,10 @@ } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFPage_Move(FPDF_DOCUMENT document, - const int* page_indices, - unsigned long page_indices_len, - int dest_page_index) { +FPDF_MovePages(FPDF_DOCUMENT document, + const int* page_indices, + unsigned long page_indices_len, + int dest_page_index) { auto* doc = CPDFDocumentFromFPDFDocument(document); if (!doc) { return false;
diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c index a99169e..bb25225 100644 --- a/fpdfsdk/fpdf_view_c_api_test.c +++ b/fpdfsdk/fpdf_view_c_api_test.c
@@ -236,7 +236,6 @@ CHK(FPDFPage_GetRotation); CHK(FPDFPage_HasTransparency); CHK(FPDFPage_InsertObject); - CHK(FPDFPage_Move); CHK(FPDFPage_New); CHK(FPDFPage_RemoveObject); CHK(FPDFPage_SetRotation); @@ -263,6 +262,7 @@ CHK(FPDFText_SetCharcodes); CHK(FPDFText_SetText); CHK(FPDF_CreateNewDocument); + CHK(FPDF_MovePages); // fpdf_ext.h CHK(FPDFDoc_GetPageMode);
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index fc7c53b..09d579e 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h
@@ -153,10 +153,10 @@ // > // Returned false because [2, 2] contains duplicates. // FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFPage_Move(FPDF_DOCUMENT document, - const int* page_indices, - unsigned long page_indices_len, - int dest_page_index); +FPDF_MovePages(FPDF_DOCUMENT document, + const int* page_indices, + unsigned long page_indices_len, + int dest_page_index); // Get the rotation of |page|. //