diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2013-09-26 19:25:44 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2013-09-26 19:25:44 +0000 |
| commit | 04966dbfbdc8b43e9a02fd939a511be93c6fe9f5 (patch) | |
| tree | 4668de4db9c5bcc1db6245acbc95063cbaeb8b14 /src/file.cpp | |
| parent | More refactoring, creation of member methods, ... (diff) | |
| download | inkscape-04966dbfbdc8b43e9a02fd939a511be93c6fe9f5.tar.gz inkscape-04966dbfbdc8b43e9a02fd939a511be93c6fe9f5.zip | |
Fix for Bug #1229605 (inkscape crashes when canceled import pdf).
Fixed bugs:
- https://launchpad.net/bugs/1229605
(bzr r12595)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/file.cpp b/src/file.cpp index b19fe21ff..e0675e8cf 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1143,7 +1143,8 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, Inkscape::Extension::Extension *key) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; - + bool cancelled = false; + //DEBUG_MESSAGE( fileImport, "file_import( in_doc:%p uri:[%s], key:%p", in_doc, uri, key ); SPDocument *doc; try { @@ -1152,6 +1153,9 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, doc = NULL; } catch (Inkscape::Extension::Input::open_failed &e) { doc = NULL; + } catch (Inkscape::Extension::Input::open_cancelled &e) { + doc = NULL; + cancelled = true; } if (doc != NULL) { @@ -1248,7 +1252,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, DocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT, _("Import")); return new_obj; - } else { + } else if (!cancelled) { gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), uri.c_str()); sp_ui_error_dialog(text); g_free(text); |
