summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 42138ee)
raw | patch | inline | side by side (parent: 42138ee)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 12 Jun 2008 17:05:57 +0000 (17:05 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 12 Jun 2008 17:05:57 +0000 (17:05 +0000) |
src/extension/internal/pdfinput/pdf-input.cpp | patch | blob | history |
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index 1de74541bb6e2f6013a5cb7757687fca420a1a14..e34c76cb1e84330ad990e0c1421376f6fbd836d0 100644 (file)
#include "pdf-parser.h"
#include "document-private.h"
+#include "application/application.h"
#include "dialogs/dialog-events.h"
#include <gtk/gtkdialog.h>
return NULL;
}
- PdfImportDialog *dlg = new PdfImportDialog(pdf_doc, uri);
- if (!dlg->showDialog()) {
- delete dlg;
- delete pdf_doc;
- return NULL;
+ PdfImportDialog *dlg = NULL;
+ if (Inkscape::NSApplication::Application::getUseGui()) {
+ dlg = new PdfImportDialog(pdf_doc, uri);
+ if (!dlg->showDialog()) {
+ delete dlg;
+ delete pdf_doc;
+ return NULL;
+ }
}
// Get needed page
- int page_num = dlg->getSelectedPage();
+ int page_num;
+ if (dlg)
+ page_num = dlg->getSelectedPage();
+ else
+ page_num = 1;
Catalog *catalog = pdf_doc->getCatalog();
Page *page = catalog->getPage(page_num);
// Get preferences
Inkscape::XML::Node *prefs = builder->getPreferences();
- dlg->getImportSettings(prefs);
+ if (dlg)
+ dlg->getImportSettings(prefs);
// Apply crop settings
PDFRectangle *clipToBox = NULL;