From 34f5057fbea1cfa01356915d0e8edf2296a4149b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 4 Feb 2021 20:48:46 +0100 Subject: 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 --- vcl/source/graphic/VectorGraphicSearch.cxx | 8 ++++---- vcl/source/pdf/PDFiumLibrary.cxx | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'vcl') 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 -- cgit