diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-11-25 20:50:40 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-11-25 20:50:40 +0000 |
| commit | 8e07cf502ee5cfd1a31a394e19b39be80322413f (patch) | |
| tree | c07281c7985a8b79dc9abc905e5cb0f2c6c68e7e /src/selection-chemistry.cpp | |
| parent | Disable preference widget to allow saving fonts in non-px units (diff) | |
| download | inkscape-8e07cf502ee5cfd1a31a394e19b39be80322413f.tar.gz inkscape-8e07cf502ee5cfd1a31a394e19b39be80322413f.zip | |
Fix applying LPE to clones (through the "+" button in the LPE dialog).
The caller to sp_selection_clone_original_path_lpe expects a new path to be selected, and it will change the SVG "id" of that selected path.
The bug was that sp_selection_clone_original_path_lpe no longer selected the new path, it maintained the selection of the path to be "clone_original_path'ed". And thus the path referenced by the original clone got its ID changed. Horror resulted. Fixed by selecting the newly created path, as before.
Added code to the caller that checks if the newly selected path is not nullptr, and that it is not the same as the selected path before the call.
(bzr r13761)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index ffa149cee..ca39ca4c7 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2884,10 +2884,12 @@ void sp_selection_clone_original_path_lpe(SPDesktop *desktop) if (desktop == NULL) { return; } - + + Inkscape::Selection *selection = sp_desktop_selection(desktop); + Inkscape::SVGOStringStream os; SPObject * firstItem = NULL; - for (const GSList * item = desktop->selection->itemList(); item != NULL; item = item->next) { + for (const GSList * item = selection->itemList(); item != NULL; item = item->next) { if (SP_IS_SHAPE(item->data) || SP_IS_TEXT(item->data)) { if (firstItem) { os << "|"; @@ -2927,6 +2929,10 @@ void sp_selection_clone_original_path_lpe(SPDesktop *desktop) } DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_CLONE_ORIGINAL_PATH_LPE, _("Fill between many")); + // select the new object: + selection->set(clone); + + Inkscape::GC::release(clone); } else { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select path(s) to fill.")); } |
