summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-12-22 19:17:01 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-12-22 19:17:01 +0000
commitf589e1fdc71cba2025d940232f132ab0622adda7 (patch)
tree5bff3f1249fa4403bc5077bf4a385650451487a2 /src/file.cpp
parentAllow extensions to throw more fine-grained exceptions (diff)
downloadinkscape-f589e1fdc71cba2025d940232f132ab0622adda7.tar.gz
inkscape-f589e1fdc71cba2025d940232f132ab0622adda7.zip
Show appropriate warning if non-existent export ID is specified
Fixed bug: - https://bugs.launchpad.net/inkscape/+bug/1739497
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index e5caaaca0..9cf0448e1 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -658,6 +658,13 @@ file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri,
SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved."));
doc->getReprRoot()->setAttribute("inkscape:version", sp_version_to_string( save ));
return false;
+ } catch (Inkscape::Extension::Output::export_id_not_found &e) {
+ gchar *text = g_strdup_printf(_("File could not be saved:\nNo object with ID '%s' found."), e.id);
+ SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved."));
+ sp_ui_error_dialog(text);
+ g_free(text);
+ doc->getReprRoot()->setAttribute("inkscape:version", sp_version_to_string( save ));
+ return false;
} catch (Inkscape::Extension::Output::no_overwrite &e) {
return sp_file_save_dialog(parentWindow, doc, save_method);
} catch (...) {