diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-02-01 17:07:13 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-01 17:07:13 +0000 |
commit | 71a7d377ff36a0be1af1848d5cac0ccb83ae725d (patch) | |
tree | c7f26301bbfcd45126900f7bbc0dc88f5e8a8946 /public/fpdf_doc.h | |
parent | 1fc533150a27257de4830559a14499f2e903dce9 (diff) | |
download | pdfium-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/fpdf_doc.h')
-rw-r--r-- | public/fpdf_doc.h | 13 |
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. // |