Unbreak the build with poppler-0.83.0.

ok juanfra@ (maintainer)
This commit is contained in:
kili 2020-01-02 20:33:43 +00:00
parent 3176b07745
commit 7418a9269f
2 changed files with 33 additions and 1 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.36 2019/11/06 12:31:08 kili Exp $
# $OpenBSD: Makefile,v 1.37 2020/01/02 20:33:43 kili Exp $
COMMENT = creates DjVu files from PDF files
V = 0.9.14
DISTNAME = pdf2djvu-${V}
REVISION = 0
CATEGORIES = graphics

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-pdf-backend_cc,v 1.4 2020/01/02 20:33:43 kili Exp $
Fix build with poppler-0.83.0.
Index: pdf-backend.cc
--- pdf-backend.cc.orig
+++ pdf-backend.cc
@@ -103,7 +103,7 @@ static void poppler_error_handler(void *data, ErrorCat
pdf::Environment::Environment()
{
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
setErrorCallback(poppler_error_handler, nullptr);
}
@@ -499,12 +499,11 @@ bool pdf::get_glyph(splash::Splash *splash, splash::Fo
void pdf::Renderer::convert_path(pdf::gfx::State *state, splash::Path &splash_path)
{
/* Source was copied from <poppler/SplashOutputDev.c>. */
- pdf::gfx::Subpath *subpath;
- pdf::gfx::Path *path = state->getPath();
+ const pdf::gfx::Path *path = state->getPath();
int n_subpaths = path->getNumSubpaths();
for (int i = 0; i < n_subpaths; i++)
{
- subpath = path->getSubpath(i);
+ const pdf::gfx::Subpath *subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0)
{
double x1, y1, x2, y2, x3, y3;