From e919ec18fc0b008241e5e5371d5762e9fe89de6f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 23 Aug 2018 20:27:21 +0000 Subject: Remove deprecated FPDFDest_GetPageIndex() API. Use FPDFDest_GetDestPageIndex() instead. BUG=pdfium:1041 Change-Id: I8e91ef46456a60ebd873068765b7c3ff1a991fa4 Reviewed-on: https://pdfium-review.googlesource.com/41230 Reviewed-by: Henrique Nakashima Commit-Queue: Lei Zhang --- fpdfsdk/fpdf_doc.cpp | 13 ------------- fpdfsdk/fpdf_doc_embeddertest.cpp | 8 -------- fpdfsdk/fpdf_view_c_api_test.c | 1 - 3 files changed, 22 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp index 7a2bbc4c2e..1f0d4f27e0 100644 --- a/fpdfsdk/fpdf_doc.cpp +++ b/fpdfsdk/fpdf_doc.cpp @@ -202,19 +202,6 @@ FPDFAction_GetURIPath(FPDF_DOCUMENT document, return len; } -FPDF_EXPORT unsigned long FPDF_CALLCONV -FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest) { - if (!dest) - return 0; - - CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); - if (!pDoc) - return 0; - - CPDF_Dest destination(CPDFArrayFromFPDFDest(dest)); - return destination.GetPageIndexDeprecated(pDoc); -} - FPDF_EXPORT int FPDF_CALLCONV FPDFDest_GetDestPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest) { if (!dest) diff --git a/fpdfsdk/fpdf_doc_embeddertest.cpp b/fpdfsdk/fpdf_doc_embeddertest.cpp index 5c0223ee46..3ba86006d0 100644 --- a/fpdfsdk/fpdf_doc_embeddertest.cpp +++ b/fpdfsdk/fpdf_doc_embeddertest.cpp @@ -43,31 +43,26 @@ TEST_F(FPDFDocEmbeddertest, DestGetPageIndex) { EXPECT_TRUE(OpenDocument("named_dests.pdf")); // NULL FPDF_DEST case. - EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), nullptr)); EXPECT_EQ(-1, FPDFDest_GetDestPageIndex(document(), nullptr)); // Page number directly in item from Dests NameTree. FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First"); EXPECT_TRUE(dest); - EXPECT_EQ(1U, FPDFDest_GetPageIndex(document(), dest)); EXPECT_EQ(1, FPDFDest_GetDestPageIndex(document(), dest)); // Page number via object reference in item from Dests NameTree. dest = FPDF_GetNamedDestByName(document(), "Next"); EXPECT_TRUE(dest); - EXPECT_EQ(1U, FPDFDest_GetPageIndex(document(), dest)); EXPECT_EQ(1, FPDFDest_GetDestPageIndex(document(), dest)); // Page number directly in item from Dests dictionary. dest = FPDF_GetNamedDestByName(document(), "FirstAlternate"); EXPECT_TRUE(dest); - EXPECT_EQ(11U, FPDFDest_GetPageIndex(document(), dest)); EXPECT_EQ(11, FPDFDest_GetDestPageIndex(document(), dest)); // Invalid object reference in item from Dests NameTree. dest = FPDF_GetNamedDestByName(document(), "LastAlternate"); EXPECT_TRUE(dest); - EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), dest)); EXPECT_EQ(-1, FPDFDest_GetDestPageIndex(document(), dest)); } @@ -134,7 +129,6 @@ TEST_F(FPDFDocEmbeddertest, DestGetLocationInPage) { EXPECT_TRUE(OpenDocument("named_dests.pdf")); // NULL FPDF_DEST case. - EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), nullptr)); EXPECT_EQ(-1, FPDFDest_GetDestPageIndex(document(), nullptr)); FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First"); @@ -162,8 +156,6 @@ TEST_F(FPDFDocEmbeddertest, BUG_680376) { // Page number directly in item from Dests NameTree. FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First"); EXPECT_TRUE(dest); - EXPECT_EQ(static_cast(-1), - FPDFDest_GetPageIndex(document(), dest)); EXPECT_EQ(-1, FPDFDest_GetDestPageIndex(document(), dest)); } diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c index 799956b36a..393a8f66e8 100644 --- a/fpdfsdk/fpdf_view_c_api_test.c +++ b/fpdfsdk/fpdf_view_c_api_test.c @@ -111,7 +111,6 @@ int CheckPDFiumCApi() { CHK(FPDFBookmark_GetTitle); CHK(FPDFDest_GetDestPageIndex); CHK(FPDFDest_GetLocationInPage); - CHK(FPDFDest_GetPageIndex); CHK(FPDFDest_GetView); CHK(FPDFLink_CountQuadPoints); CHK(FPDFLink_Enumerate); -- cgit v1.2.3