summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-02-01 17:07:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-01 17:07:13 +0000
commit71a7d377ff36a0be1af1848d5cac0ccb83ae725d (patch)
treec7f26301bbfcd45126900f7bbc0dc88f5e8a8946 /public
parent1fc533150a27257de4830559a14499f2e903dce9 (diff)
downloadpdfium-71a7d377ff36a0be1af1848d5cac0ccb83ae725d.tar.xz
Deprecate FPDFDest_GetPageIndex and create a fixed version.
FPDFDest_GetDestPageIndex() has a well defined return value for errors (-1). Keeping FPDFDest_GetPageIndex() to avoid changing behavior of the old API for whoever relies on it. Bug: pdfium:938 Change-Id: Iad528923cb156e957a419540c262a65f45cb777d Reviewed-on: https://pdfium-review.googlesource.com/24811 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_doc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h
index b523575967..7ec232c45e 100644
--- a/public/fpdf_doc.h
+++ b/public/fpdf_doc.h
@@ -177,15 +177,28 @@ FPDFAction_GetURIPath(FPDF_DOCUMENT document,
void* buffer,
unsigned long buflen);
+// Deprecated. Use FPDFDest_GetDestPageIndex() instead.
+//
// Get the page index of |dest|.
//
// document - handle to the document.
// dest - handle to the destination.
//
// Returns the page index containing |dest|. Page indices start from 0.
+// On an error, returns 0 or -1. Note that 0 can mean the first page, hence
+// do not use this API.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest);
+// Get the page index of |dest|.
+//
+// document - handle to the document.
+// dest - handle to the destination.
+//
+// Returns the -based page index containing |dest|. Returns -1 on error.
+FPDF_EXPORT long FPDF_CALLCONV FPDFDest_GetDestPageIndex(FPDF_DOCUMENT document,
+ FPDF_DEST dest);
+
// Get the view (fit type) specified by |dest|.
// Experimental API. Subject to change.
//