summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e366d3)
raw | patch | inline | side by side (parent: 6e366d3)
author | miklosh <miklosh@users.sourceforge.net> | |
Sun, 6 Aug 2006 21:29:57 +0000 (21:29 +0000) | ||
committer | miklosh <miklosh@users.sourceforge.net> | |
Sun, 6 Aug 2006 21:29:57 +0000 (21:29 +0000) |
src/extension/internal/cairo-pdf-out.cpp | patch | blob | history |
index 52eb668c9eec6932adc8991ad5cd0dcbd2524228..c73faaef60d7372717a53cb6a1b54cc9ffa597e8 100644 (file)
}\r
\r
\r
-static void\r
+static unsigned int\r
pdf_print_document_to_file(SPDocument *doc, gchar const *filename)\r
{\r
Inkscape::Extension::Print *mod;\r
mod->arena = NRArena::create();\r
mod->dkey = sp_item_display_key_new(1);\r
mod->root = sp_item_invoke_show(mod->base, mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY);\r
+ \r
/* Print document */\r
ret = mod->begin(doc);\r
- sp_item_invoke_print(mod->base, &context);\r
- ret = mod->finish();\r
+ if (ret) {\r
+ sp_item_invoke_print(mod->base, &context);\r
+ ret = mod->finish();\r
+ }\r
+ \r
/* Release arena */\r
sp_item_invoke_hide(mod->base, mod->dkey);\r
mod->base = NULL;\r
mod->set_param_string("destination", oldoutput);\r
g_free(oldoutput);\r
\r
- return;\r
+ return ret;\r
}\r
\r
\r
CairoPdfOutput::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar *uri)\r
{\r
Inkscape::Extension::Extension * ext;\r
+ unsigned int ret;\r
\r
ext = Inkscape::Extension::db.get(SP_MODULE_KEY_PRINT_CAIRO_PDF);\r
if (ext == NULL)\r
@@ -103,8 +108,11 @@ CairoPdfOutput::save (Inkscape::Extension::Output *mod, SPDocument *doc, const g
\r
gchar * final_name;\r
final_name = g_strdup_printf("> %s", uri);\r
- pdf_print_document_to_file(doc, final_name);\r
+ ret = pdf_print_document_to_file(doc, final_name);\r
g_free(final_name);\r
+ \r
+ if (!ret)\r
+ throw Inkscape::Extension::Output::save_failed();\r
\r
return;\r
}\r