From f589e1fdc71cba2025d940232f132ab0622adda7 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Fri, 22 Dec 2017 20:17:01 +0100 Subject: Show appropriate warning if non-existent export ID is specified Fixed bug: - https://bugs.launchpad.net/inkscape/+bug/1739497 --- src/file.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/file.cpp') 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 (...) { -- cgit v1.2.3