summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation
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
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 'src/extension/implementation')
-rw-r--r--src/extension/implementation/implementation.cpp17
-rw-r--r--src/extension/implementation/implementation.h2
-rw-r--r--src/extension/implementation/script.cpp18
3 files changed, 12 insertions, 25 deletions
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp
index e05dbf3c4..6e6100d2b 100644
--- a/src/extension/implementation/implementation.cpp
+++ b/src/extension/implementation/implementation.cpp
@@ -27,23 +27,6 @@ namespace Inkscape {
namespace Extension {
namespace Implementation {
-ImplementationDocumentCache::ImplementationDocumentCache (Inkscape::UI::View::View * view)
- : _view(view)
-{
- SPDesktop *desktop = (SPDesktop*)view;
- Inkscape::Selection * selection = NULL;
- if (desktop) {
- selection = desktop->getSelection();
- if (selection && !selection->params.empty()) {
- selection->restoreBackup();
- if (!desktop->on_live_extension) {
- selection->emptyBackup();
- }
- }
- }
- return;
-}
-
Gtk::Widget *
Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const */*filename*/) {
return module->autogui(NULL, NULL);
diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h
index 5bb909ef2..cf41e5517 100644
--- a/src/extension/implementation/implementation.h
+++ b/src/extension/implementation/implementation.h
@@ -56,7 +56,7 @@ class ImplementationDocumentCache {
*/
Inkscape::UI::View::View * _view;
public:
- ImplementationDocumentCache (Inkscape::UI::View::View * view);
+ ImplementationDocumentCache (Inkscape::UI::View::View * view) { return; };
virtual ~ImplementationDocumentCache ( ) { return; };
Inkscape::UI::View::View const * view ( ) { return _view; };
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();
}
}
}