diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-05-09 19:38:45 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-05-09 19:43:04 +0000 |
| commit | b85b43a64e3d3d7e623b4bcd99b08ef8f6fc7a43 (patch) | |
| tree | 58d4726a94512ba16e15d535b40795ef65cde0c0 /src/extension/execution-env.cpp | |
| parent | fix bug compiling (diff) | |
| download | inkscape-b85b43a64e3d3d7e623b4bcd99b08ef8f6fc7a43.tar.gz inkscape-b85b43a64e3d3d7e623b4bcd99b08ef8f6fc7a43.zip | |
Reset old code to reaply fixed
Diffstat (limited to '')
| -rw-r--r-- | src/extension/execution-env.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index bde04d924..7e233d215 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -22,8 +22,6 @@ #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" @@ -54,6 +52,19 @@ 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; @@ -178,14 +189,24 @@ ExecutionEnv::commit (void) { void ExecutionEnv::reselect (void) { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Inkscape::Selection * selection = NULL; - if(desktop) { - selection = desktop->getSelection(); - if (!desktop->on_live_extension) { - selection->restoreBackup(); + 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); } } + return; } |
