summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14db443)
raw | patch | inline | side by side (parent: 14db443)
author | ulferikson <ulferikson@users.sourceforge.net> | |
Sat, 5 Aug 2006 21:09:06 +0000 (21:09 +0000) | ||
committer | ulferikson <ulferikson@users.sourceforge.net> | |
Sat, 5 Aug 2006 21:09:06 +0000 (21:09 +0000) |
src/extension/internal/pdf-out.cpp | patch | blob | history | |
src/extension/internal/pdf.cpp | patch | blob | history |
index 5cf859161167fcac71e2dfcfed03f09fab4cc2b8..d75be83df2aeb6121ec97e6263049a8aebd90be6 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
PdfOutput::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_PDF);\r
if (ext == NULL)\r
@@ -103,9 +108,12 @@ PdfOutput::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar
\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
\r
index bd65cd3182d8df11f1ce5028418306f54f3a246c..dde35c39192046ebcb716264e16c0a0fc4eb2e67 100644 (file)
_stream = 0;\r
_latin1_encoded_fonts.clear();\r
\r
- return 0;\r
+ return 1;\r
}\r
\r
unsigned int\r