Commit 50168604 authored by Volker Krause's avatar Volker Krause
Browse files

Try to fix build without Poppler

KPOPPLER_VERSION isn't defined in that case, so using that in an unguarded
header is a problem.
parent e65397b4
......@@ -80,13 +80,17 @@ QTransform KItinerary::PopplerUtils::currentTransform(GfxState *state)
return QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
}
QPainterPath PopplerUtils::convertPath(GFXPATH_CONST GfxPath *path, Qt::FillRule fillRule)
QPainterPath PopplerUtils::convertPath(const GfxPath *path, Qt::FillRule fillRule)
{
QPainterPath qpp;
qpp.setFillRule(fillRule);
for (auto i = 0; i < path->getNumSubpaths(); ++i) {
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 83, 0)
const auto subpath = path->getSubpath(i);
#else
const auto subpath = const_cast<GfxPath*>(path)->getSubpath(i);
#endif
if (subpath->getNumPoints() > 0) {
qpp.moveTo(subpath->getX(0), subpath->getY(0));
for (auto j = 1;j < subpath->getNumPoints();) {
......
......@@ -28,12 +28,6 @@ class QPainterPath;
class QPen;
class QTransform;
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 83, 0)
#define GFXPATH_CONST const
#else
#define GFXPATH_CONST
#endif
namespace KItinerary {
/** Utilities for interacting with Poppler. */
......@@ -47,7 +41,7 @@ namespace PopplerUtils
QTransform currentTransform(GfxState *state);
/** Convets a Poppler path into a Qt path. */
QPainterPath convertPath(GFXPATH_CONST GfxPath *path, Qt::FillRule fillRule);
QPainterPath convertPath(const GfxPath *path, Qt::FillRule fillRule);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment