diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-10-11 03:34:08 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-10-11 03:34:08 +0000 |
| commit | 05c9f6824d14012a71528bd204bcdd4e6624db29 (patch) | |
| tree | 3df43f36edb9c89ba3ffce431c81b0e16e322b4e /src/extension/internal/pdfinput | |
| parent | Fix for 246153 : Broken style indicator (diff) | |
| download | inkscape-05c9f6824d14012a71528bd204bcdd4e6624db29.tar.gz inkscape-05c9f6824d14012a71528bd204bcdd4e6624db29.zip | |
Fix for 426763 : Cancelling import leads to error message
(bzr r11777)
Diffstat (limited to 'src/extension/internal/pdfinput')
| -rw-r--r-- | src/extension/internal/pdfinput/pdf-input.cpp | 8 | ||||
| -rw-r--r-- | src/extension/internal/pdfinput/pdf-input.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 6b6107444..d2d594017 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -588,12 +588,19 @@ void PdfImportDialog::_setPreviewPage(int page) { //////////////////////////////////////////////////////////////////////////////// +bool +PdfInput::wasCancelled () { + return _cancelled; +} + /** * Parses the selected page of the given PDF document using PdfParser. */ SPDocument * PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + _cancelled = false; + // Initialize the globalParams variable for poppler if (!globalParams) { globalParams = new GlobalParams(); @@ -648,6 +655,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { if (inkscape_use_gui()) { dlg = new PdfImportDialog(pdf_doc, uri); if (!dlg->showDialog()) { + _cancelled = true; delete dlg; delete pdf_doc; return NULL; diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index 75fcfa69a..e9da5b27c 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -135,7 +135,9 @@ public: SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); - + virtual bool wasCancelled(); +private: + bool _cancelled; }; } // namespace Implementation |
