diff options
-rw-r--r-- | include/vcl/filter/PDFiumLibrary.hxx | 5 | ||||
-rw-r--r-- | vcl/source/graphic/VectorGraphicSearch.cxx | 8 | ||||
-rw-r--r-- | vcl/source/pdf/PDFiumLibrary.cxx | 11 |
3 files changed, 19 insertions, 5 deletions
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index ab0b5db7e608..807a64cfab4e 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -162,7 +162,10 @@ public: PDFiumSearchHandle(FPDF_SCHHANDLE pSearchHandle); ~PDFiumSearchHandle(); - FPDF_SCHHANDLE getPointer() { return mpSearchHandle; } + bool findNext(); + bool findPrev(); + int getSearchResultIndex(); + int getSearchCount(); }; class VCL_DLLPUBLIC PDFiumTextPage final 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 |