From 7bd76a463da8860fc6308505ab2e264610fb5981 Mon Sep 17 00:00:00 2001 From: gouldtj Date: Sun, 6 Jan 2008 23:00:23 +0000 Subject: [PATCH] r17534@shi: ted | 2008-01-06 14:56:29 -0800 Scripting now maintains the output_extension parameter accross the script. This was necissary because the file written out gets the the parameter of what it was written out with, while the original document gets fixed. Even though the current document gets corrected by the output function, the script hands back the one that is written out. Basically, this means that we need to handle it in this file. And now we do. Fixes lp: 167132 --- src/extension/implementation/script.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 3ebe173f3..09dc9eb30 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -41,6 +41,7 @@ FIXME: #include "ui/view/view.h" #include "desktop-handles.h" +#include "desktop.h" #include "selection.h" #include "sp-namedview.h" #include "io/sys.h" @@ -737,6 +738,11 @@ Script::effect(Inkscape::Extension::Effect *module, exit(1); } + SPDesktop *desktop = (SPDesktop *)doc; + sp_namedview_document_from_window(desktop); + + gchar * orig_output_extension = g_strdup(sp_document_repr_root(desktop->doc())->attribute("inkscape:output_extension")); + std::list params; module->paramListString(params); @@ -760,9 +766,6 @@ Script::effect(Inkscape::Extension::Effect *module, return; } - SPDesktop *desktop = (SPDesktop *) doc; - sp_namedview_document_from_window(desktop); - if (desktop != NULL) { Inkscape::Util::GSListConstIterator selected = sp_desktop_selection(desktop)->itemList(); @@ -803,7 +806,10 @@ Script::effect(Inkscape::Extension::Effect *module, doc->doc()->emitReconstructionFinish(); mydoc->release(); sp_namedview_update_layers_from_document(desktop); + + sp_document_repr_root(desktop->doc())->setAttribute("inkscape:output_extension", orig_output_extension); } + g_free(orig_output_extension); return; } -- 2.30.2