[Libreoffice-commits] core.git: vcl/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 27 07:34:14 UTC 2021
vcl/source/graphic/VectorGraphicSearch.cxx | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 9cbed06bad6d203181b1210e9d811aafd696de46
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jan 26 21:05:35 2021 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jan 27 08:33:29 2021 +0100
pdfium: use PDFiumPage in SearchContext
Change-Id: I4bdf292c32bbfcfb046e301b4a62771e974f6da0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109995
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
index 447c4638493f..b835962e25ef 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -28,7 +28,7 @@ class SearchContext
{
private:
std::unique_ptr<vcl::pdf::PDFiumDocument>& mpPdfDocument;
- FPDF_PAGE mpPage;
+ std::unique_ptr<vcl::pdf::PDFiumPage> mpPage;
FPDF_TEXTPAGE mpTextPage;
FPDF_SCHHANDLE mpSearchHandle;
@@ -40,7 +40,6 @@ public:
SearchContext(std::unique_ptr<vcl::pdf::PDFiumDocument>& pPdfDocument, sal_Int32 nPageIndex)
: mpPdfDocument(pPdfDocument)
- , mpPage(nullptr)
, mpTextPage(nullptr)
, mpSearchHandle(nullptr)
, mnPageIndex(nPageIndex)
@@ -55,7 +54,7 @@ public:
if (mpTextPage)
FPDFText_ClosePage(mpTextPage);
if (mpPage)
- FPDF_ClosePage(mpPage);
+ mpPage.reset();
}
basegfx::B2DSize getPageSize()
@@ -85,16 +84,16 @@ public:
FPDFText_ClosePage(mpTextPage);
if (mpPage)
- FPDF_ClosePage(mpPage);
+ mpPage.reset();
maSearchString = rSearchString;
maOptions = rOptions;
- mpPage = FPDF_LoadPage(mpPdfDocument->getPointer(), mnPageIndex);
+ mpPage = mpPdfDocument->openPage(mnPageIndex);
if (!mpPage)
return false;
- mpTextPage = FPDFText_LoadPage(mpPage);
+ mpTextPage = FPDFText_LoadPage(mpPage->getPointer());
if (!mpTextPage)
return false;
More information about the Libreoffice-commits
mailing list