summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-01-06 23:00:23 +0000
committergouldtj <gouldtj@users.sourceforge.net>2008-01-06 23:00:23 +0000
commit4160534b19d7a19dca9579421e30c2e20497b8fe (patch)
tree92c50132bbb8b2827f2e12ebcea8d190247ed4fb /src/extension/implementation/script.cpp
parentFix missing tooltips in LPE's. (Closes LP: #178471) (diff)
downloadinkscape-4160534b19d7a19dca9579421e30c2e20497b8fe.tar.gz
inkscape-4160534b19d7a19dca9579421e30c2e20497b8fe.zip
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 (bzr r4414)
Diffstat (limited to 'src/extension/implementation/script.cpp')
-rw-r--r--src/extension/implementation/script.cpp12
1 files 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<std::string> 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<SPItem *> 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;
}