Commit 94188249 authored by David Tardon's avatar David Tardon Committed by Patrick Storz
Browse files

adapt to poppler 0.58

parent bfc70139
......@@ -131,6 +131,10 @@ if(ENABLE_POPPLER)
POPPLER_VERSION VERSION_EQUAL "0.29.0")
set(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API ON)
endif()
if(POPPLER_VERSION VERSION_GREATER "0.58.0" OR
POPPLER_VERSION VERSION_EQUAL "0.58.0")
set(POPPLER_NEW_OBJECT_API ON)
endif()
else()
set(ENABLE_POPPLER_CAIRO OFF)
endif()
......
......@@ -107,6 +107,9 @@
/* Use color space API from Poppler >= 0.29.0 */
#cmakedefine POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API 1
/* Use object API from Poppler >= 0.58.0 */
#cmakedefine POPPLER_NEW_OBJECT_API 1
/* Define to 1 if you have the `pow' function. */
#cmakedefine HAVE_POW 1
......
......@@ -846,14 +846,20 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
}
// Parse the document structure
#if defined(POPPLER_NEW_OBJECT_API)
Object obj = page->getContents();
#else
Object obj;
page->getContents(&obj);
#endif
if (!obj.isNull()) {
pdf_parser->parse(&obj);
}
// Cleanup
#if !defined(POPPLER_NEW_OBJECT_API)
obj.free();
#endif
delete pdf_parser;
delete builder;
g_free(docname);
......
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