summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es>2018-06-06 19:54:37 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es>2018-06-06 19:54:37 +0000
commit418e2db02e4c6ed7ebccd0d518f2c6331704f050 (patch)
tree48c573fdf1737bc87167ac7d2b65aa14dfb0b5c5 /src/extension/implementation/script.cpp
parentRemove tables that should not be exposed to user from OpenType table list. (diff)
downloadinkscape-418e2db02e4c6ed7ebccd0d518f2c6331704f050.tar.gz
inkscape-418e2db02e4c6ed7ebccd0d518f2c6331704f050.zip
Fixes to extension system and simplify the code
Diffstat (limited to '')
-rw-r--r--src/extension/implementation/script.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index d77695bf1..d725ff8cc 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -690,11 +690,17 @@ void Script::effect(Inkscape::Extension::Effect *module,
if (desktop) {
Inkscape::Selection * selection = desktop->getSelection();
- if (!selection->isEmpty()) {
- selection->setBackup();
+ if (selection) {
+ //No working dialog run once
+ if (!selection->isEmpty()) {
+ selection->setBackup();
+ } else {
+ selection->restoreBackup();
+ }
+ params = selection->params;
+ module->paramListString(params);
+ selection->clear();
}
- params = selection->params;
- module->paramListString(params);
}
file_listener fileout;
@@ -758,12 +764,10 @@ void Script::effect(Inkscape::Extension::Effect *module,
//set the current layer
desktop->setCurrentLayer(layer);
}
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (desktop) {
Inkscape::Selection * selection = desktop->getSelection();
- if (selection && selection->isEmpty() && !desktop->on_live_extension) {
+ if (selection && selection->isEmpty()) {
selection->restoreBackup();
- selection->emptyBackup();
}
}
}