summaryrefslogtreecommitdiffstats
path: root/src/extension/execution-env.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-11-03 00:55:01 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-05-09 19:42:10 +0000
commit61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778 (patch)
tree3ed5e5b78b00cf25892a3a18e118eee41cbc15ec /src/extension/execution-env.cpp
parentFix typo (diff)
downloadinkscape-61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778.tar.gz
inkscape-61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778.zip
Start migrating 0.92 patch to master
Diffstat (limited to '')
-rw-r--r--src/extension/execution-env.cpp37
1 files changed, 8 insertions, 29 deletions
diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp
index 7e233d215..bde04d924 100644
--- a/src/extension/execution-env.cpp
+++ b/src/extension/execution-env.cpp
@@ -22,6 +22,8 @@
#include "selection.h"
#include "effect.h"
#include "document.h"
+#include "desktop.h"
+#include "inkscape.h"
#include "document-undo.h"
#include "desktop.h"
#include "object/sp-namedview.h"
@@ -52,19 +54,6 @@ ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Imp
_show_working(show_working),
_show_errors(show_errors)
{
- SPDesktop *desktop = (SPDesktop *)_doc;
- sp_namedview_document_from_window(desktop);
-
- if (desktop != NULL) {
- auto selected = desktop->getSelection()->items();
- for(auto x = selected.begin(); x != selected.end(); ++x){
- Glib::ustring selected_id;
- selected_id = (*x)->getId();
- _selected.insert(_selected.end(), selected_id);
- //std::cout << "Selected: " << selected_id << std::endl;
- }
- }
-
genDocCache();
return;
@@ -189,24 +178,14 @@ ExecutionEnv::commit (void) {
void
ExecutionEnv::reselect (void) {
- if (_doc == NULL) { return; }
- SPDocument * doc = _doc->doc();
- if (doc == NULL) { return; }
-
- SPDesktop *desktop = (SPDesktop *)_doc;
- sp_namedview_document_from_window(desktop);
-
- if (desktop == NULL) { return; }
-
- Inkscape::Selection * selection = desktop->getSelection();
-
- for (std::list<Glib::ustring>::iterator i = _selected.begin(); i != _selected.end(); ++i) {
- SPObject * obj = doc->getObjectById(i->c_str());
- if (obj != NULL) {
- selection->add(obj);
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ Inkscape::Selection * selection = NULL;
+ if(desktop) {
+ selection = desktop->getSelection();
+ if (!desktop->on_live_extension) {
+ selection->restoreBackup();
}
}
-
return;
}