diff options
author | Nicolas Pena <npm@chromium.org> | 2017-03-10 11:59:17 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-10 19:04:24 +0000 |
commit | 5c1961dfa0b1828eb2db38dc637548584c5cc704 (patch) | |
tree | 3346f34e13738c2b997e46428e255c3ded0f0ebc /fpdfsdk | |
parent | 52c73c24ab053e839182d3cdac6cbb758ce3a196 (diff) | |
download | pdfium-5c1961dfa0b1828eb2db38dc637548584c5cc704.tar.xz |
Add public method FPDFText_GetTextIndexFromCharIndex
BUG=pdfium:676
Change-Id: I46de35a86769dc2f7f73ac3552306356ca3289a5
Reviewed-on: https://pdfium-review.googlesource.com/2955
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_searchex.cpp | 8 | ||||
-rw-r--r-- | fpdfsdk/fpdfview_c_api_test.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_searchex.cpp b/fpdfsdk/fpdf_searchex.cpp index f82db37b5a..13729167ed 100644 --- a/fpdfsdk/fpdf_searchex.cpp +++ b/fpdfsdk/fpdf_searchex.cpp @@ -15,3 +15,11 @@ FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex) { return static_cast<CPDF_TextPage*>(text_page) ->CharIndexFromTextIndex(nTextIndex); } + +DLLEXPORT int STDCALL +FPDFText_GetTextIndexFromCharIndex(FPDF_TEXTPAGE text_page, int nCharIndex) { + if (!text_page) + return -1; + return static_cast<CPDF_TextPage*>(text_page)->TextIndexFromCharIndex( + nCharIndex); +} diff --git a/fpdfsdk/fpdfview_c_api_test.c b/fpdfsdk/fpdfview_c_api_test.c index c603f59acc..df3ef19d64 100644 --- a/fpdfsdk/fpdfview_c_api_test.c +++ b/fpdfsdk/fpdfview_c_api_test.c @@ -168,6 +168,7 @@ int CheckPDFiumCApi() { // fpdf_searchex.h CHK(FPDFText_GetCharIndexFromTextIndex); + CHK(FPDFText_GetTextIndexFromCharIndex); // fpdf_structtree.h CHK(FPDF_StructTree_GetForPage); |