diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-04 20:48:46 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-05 09:07:55 +0100 |
commit | 34f5057fbea1cfa01356915d0e8edf2296a4149b (patch) | |
tree | 587fa4768025f0330272991acc9f3fbb92478ecc /vcl | |
parent | b7d2acfe34238e4aa9e71f2a843978576f608c12 (diff) |
pdfium: add remaining FPDF_SCHHANDLE wrappers
So we don't have to expose the raw search handle in the public header
anymore.
Change-Id: I410314424e5a1d3a977c8e3de6f500f7c9a0a332
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110426
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/graphic/VectorGraphicSearch.cxx | 8 | ||||
-rw-r--r-- | vcl/source/pdf/PDFiumLibrary.cxx | 11 |
2 files changed, 15 insertions, 4 deletions
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx index 59e51ea795e2..aabfd220f651 100644 --- a/vcl/source/graphic/VectorGraphicSearch.cxx +++ b/vcl/source/graphic/VectorGraphicSearch.cxx @@ -118,7 +118,7 @@ public: bool next() { - if (mpSearchHandle && FPDFText_FindNext(mpSearchHandle->getPointer())) + if (mpSearchHandle && mpSearchHandle->findNext()) { mnCurrentIndex = index(); return true; @@ -128,7 +128,7 @@ public: bool previous() { - if (mpSearchHandle && FPDFText_FindPrev(mpSearchHandle->getPointer())) + if (mpSearchHandle && mpSearchHandle->findPrev()) { mnCurrentIndex = index(); return true; @@ -139,14 +139,14 @@ public: int index() { if (mpSearchHandle) - return FPDFText_GetSchResultIndex(mpSearchHandle->getPointer()); + return mpSearchHandle->getSearchResultIndex(); return -1; } int size() { if (mpSearchHandle) - return FPDFText_GetSchCount(mpSearchHandle->getPointer()); + return mpSearchHandle->getSearchCount(); return -1; } diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 9a13ae930fb5..ca4da3489c6b 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -1126,6 +1126,17 @@ PDFiumSearchHandle::~PDFiumSearchHandle() FPDFText_FindClose(mpSearchHandle); } +bool PDFiumSearchHandle::findNext() { return FPDFText_FindNext(mpSearchHandle); } + +bool PDFiumSearchHandle::findPrev() { return FPDFText_FindPrev(mpSearchHandle); } + +int PDFiumSearchHandle::getSearchResultIndex() +{ + return FPDFText_GetSchResultIndex(mpSearchHandle); +} + +int PDFiumSearchHandle::getSearchCount() { return FPDFText_GetSchCount(mpSearchHandle); } + } // end vcl::pdf #endif // HAVE_FEATURE_PDFIUM |