diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-03 00:10:02 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-03 00:10:02 +0000 |
| commit | d2df0412f728dd5bb54537dfdfe7c35b34d40e0e (patch) | |
| tree | e2703384779e83312c456399999997fcc289c5cf /src/path-chemistry.cpp | |
| parent | Merge branch 'master' into powerpencil (diff) | |
| parent | change assignment to equality (diff) | |
| download | inkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.tar.gz inkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.zip | |
Merge branch 'master' into powerpencil
Diffstat (limited to 'src/path-chemistry.cpp')
| -rw-r--r-- | src/path-chemistry.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 7840c4ca8..b824d15c7 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -237,13 +237,12 @@ ObjectSet::breakApart(bool skip_undo) item->deleteObject(false); - GSList *list = curve->split(); + std::list<SPCurve *> list = curve->split(); curve->unref(); std::vector<Inkscape::XML::Node*> reprs; - for (GSList *l = list; l != NULL; l = l->next) { - curve = (SPCurve *) l->data; + for (auto curve:list) { Inkscape::XML::Node *repr = parent->document()->createElement("svg:path"); repr->setAttribute("style", style); @@ -266,7 +265,7 @@ ObjectSet::breakApart(bool skip_undo) repr->setPosition(pos > 0 ? pos : 0); // if it's the first one, restore id - if (l == list) + if (curve == *(list.begin())) repr->setAttribute("id", id); reprs.push_back(repr); @@ -275,7 +274,6 @@ ObjectSet::breakApart(bool skip_undo) } setReprList(reprs); - g_slist_free(list); g_free(style); g_free(path_effect); } @@ -368,7 +366,12 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& { continue; } - + //TODO: decide if we want to unlink clones or not, for now keep previous functionality retaining clones as is + SPUse *use = dynamic_cast<SPUse *>(item); + if (use) { + continue; + } + SPPath *path = dynamic_cast<SPPath *>(item); if (path && !path->_curve_before_lpe) { // remove connector attributes @@ -395,9 +398,13 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& continue; } - + + SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item); + if (lpeitem) { + lpeitem->removeAllPathEffects(true); + } + if (group) { - group->removeAllPathEffects(true); std::vector<SPItem*> item_list = sp_item_group_item_list(group); std::vector<Inkscape::XML::Node*> item_to_select; @@ -423,6 +430,8 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& Inkscape::XML::Node *parent = item->getRepr()->parent(); // remember id char const *id = item->getRepr()->attribute("id"); + // remember class + char const *class_attr = item->getRepr()->attribute("class"); // remember title gchar *title = item->title(); // remember description @@ -437,6 +446,8 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& // restore id repr->setAttribute("id", id); + // restore class + repr->setAttribute("class", class_attr); // add the new repr to the parent parent->appendChild(repr); SPObject* newObj = document->getObjectByRepr(repr); @@ -553,8 +564,6 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) return g_repr; } - - SP_LPE_ITEM(item)->removeAllPathEffects(true); SPCurve *curve = NULL; { SPShape *shape = dynamic_cast<SPShape *>(item); |
