Code

A simple layout document as to what, why and how is cppification.
[inkscape.git] / src / extension / internal / pdfinput / pdf-input.cpp
index 476f0daf617aaeecb56666ca9349d88c4e773481..b507118035e053acac0efe1be82e0bf688f2faaf 100644 (file)
@@ -589,7 +589,7 @@ void PdfImportDialog::_setPreviewPage(int page) {
 /**
  * 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
@@ -661,9 +661,9 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
     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);
@@ -734,9 +734,10 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * 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;
 }