diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index 476f0daf617aaeecb56666ca9349d88c4e773481..b507118035e053acac0efe1be82e0bf688f2faaf 100644 (file)
/**
* Parses the selected page of the given PDF document using PdfParser.
*/
-Document *
+SPDocument *
PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
// Initialize the globalParams variable for poppler
Catalog *catalog = pdf_doc->getCatalog();
Page *page = catalog->getPage(page_num);
- Document *doc = sp_document_new(NULL, TRUE, TRUE);
- bool saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive(doc, false); // No need to undo in this temporary document
+ SPDocument *doc = SPDocument::createNewDoc(NULL, TRUE, TRUE);
+ bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+ SPDocumentUndo::set_undo_sensitive(doc, false); // No need to undo in this temporary document
// Create builder
gchar *docname = g_path_get_basename(uri);
delete builder;
g_free(docname);
delete pdf_doc;
+ delete dlg;
// Restore undo
- sp_document_set_undo_sensitive(doc, saved);
+ SPDocumentUndo::set_undo_sensitive(doc, saved);
return doc;
}