From 71a7d377ff36a0be1af1848d5cac0ccb83ae725d Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 1 Feb 2018 17:07:13 +0000 Subject: 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 Reviewed-by: Lei Zhang --- public/fpdf_doc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'public') 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. // -- cgit v1.2.3