diff options
| -rw-r--r-- | src/box3d-side.cpp | 2 | ||||
| -rw-r--r-- | src/draw-context.cpp | 2 | ||||
| -rw-r--r-- | src/path-chemistry.cpp | 2 | ||||
| -rw-r--r-- | src/selection-chemistry.cpp | 15 | ||||
| -rw-r--r-- | src/sp-ellipse.cpp | 4 | ||||
| -rw-r--r-- | src/sp-item-group.cpp | 2 | ||||
| -rw-r--r-- | src/sp-item.cpp | 2 | ||||
| -rw-r--r-- | src/sp-lpe-item.cpp | 61 | ||||
| -rw-r--r-- | src/sp-lpe-item.h | 9 | ||||
| -rw-r--r-- | src/sp-path.cpp | 24 | ||||
| -rw-r--r-- | src/sp-shape.cpp | 2 | ||||
| -rw-r--r-- | src/sp-spiral.cpp | 10 | ||||
| -rw-r--r-- | src/sp-star.cpp | 7 | ||||
| -rw-r--r-- | src/tweak-context.cpp | 2 | ||||
| -rw-r--r-- | src/ui/clipboard.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-editor.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/node-toolbar.cpp | 2 |
18 files changed, 78 insertions, 76 deletions
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp index d3d3b82a2..4d8b1e2d7 100644 --- a/src/box3d-side.cpp +++ b/src/box3d-side.cpp @@ -207,7 +207,7 @@ void Box3DSide::set_shape() { * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ this->setCurveInsync( c, TRUE); - if (sp_lpe_item_has_path_effect(this) && sp_lpe_item_path_effects_enabled(this)) { + if (hasPathEffect() && sp_lpe_item_path_effects_enabled(this)) { SPCurve *c_lpe = c->copy(); bool success = sp_lpe_item_perform_path_effect(this, c_lpe); diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 09366526a..a0241852c 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -574,7 +574,7 @@ static void spdc_flush_white(SPDrawContext *dc, SPCurve *gc) Inkscape::XML::Node *repr; if (dc->white_item) { repr = dc->white_item->getRepr(); - has_lpe = sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(dc->white_item)); + has_lpe = SP_LPE_ITEM(dc->white_item)->hasPathEffectRecursive(); } else { repr = xml_doc->createElement("svg:path"); // Set style diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index e1924664b..52569dd21 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -628,7 +628,7 @@ sp_selected_path_reverse(SPDesktop *desktop) SPCurve *rcurve = path->get_curve_reference()->create_reverse(); gchar *str = sp_svg_write_path(rcurve->get_pathvector()); - if ( sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(path)) ) { + if ( path->hasPathEffectRecursive() ) { path->getRepr()->setAttribute("inkscape:original-d", str); } else { path->getRepr()->setAttribute("d", str); diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 64ecd6e04..8a414eb4b 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1182,9 +1182,10 @@ void sp_selection_paste_livepatheffect(SPDesktop *desktop) static void sp_selection_remove_livepatheffect_impl(SPItem *item) { - if ( item && SP_IS_LPE_ITEM(item) && - sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) { - sp_lpe_item_remove_all_path_effects(SP_LPE_ITEM(item), false); + if ( SPLPEItem *lpeitem = dynamic_cast<SPLPEItem*>(item) ) { + if ( lpeitem->hasPathEffect() ) { + sp_lpe_item_remove_all_path_effects(SP_LPE_ITEM(item), false); + } } } @@ -2318,9 +2319,9 @@ void sp_selection_next_patheffect_param(SPDesktop * dt) Inkscape::Selection *selection = sp_desktop_selection(dt); if ( selection && !selection->isEmpty() ) { SPItem *item = selection->singleItem(); - if ( item && SP_IS_SHAPE(item)) { - if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) { - sp_lpe_item_edit_next_param_oncanvas(SP_LPE_ITEM(item), dt); + if ( SPLPEItem *lpeitem = dynamic_cast<SPLPEItem*>(item) ) { + if (lpeitem->hasPathEffect()) { + sp_lpe_item_edit_next_param_oncanvas(lpeitem, dt); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("The selection has no applied path effect.")); } @@ -2679,7 +2680,7 @@ sp_select_clone_original(SPDesktop *desktop) original = SP_FLOWTEXT(item)->get_frame(NULL); // first frame only } else if (SP_IS_LPE_ITEM(item)) { // check if the applied LPE is Clone original, if so, go to the refered path - Inkscape::LivePathEffect::Effect* lpe = sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(item), Inkscape::LivePathEffect::CLONE_ORIGINAL); + Inkscape::LivePathEffect::Effect* lpe = SP_LPE_ITEM(item)->getPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL); if (lpe) { Inkscape::LivePathEffect::Parameter *lpeparam = lpe->getParameter("linkedpath"); if (Inkscape::LivePathEffect::OriginalPathParam *pathparam = dynamic_cast<Inkscape::LivePathEffect::OriginalPathParam *>(lpeparam)) { diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 73628a928..2d73ff35f 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -144,7 +144,7 @@ void SPGenericEllipse::update_patheffect(bool write) { /* fixme: Think (Lauris) */ /* Can't we use arcto in this method? */ void SPGenericEllipse::set_shape() { - if (sp_lpe_item_has_broken_path_effect(this)) { + if (hasBrokenPathEffect()) { g_warning ("The ellipse shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as ellipse will remove the bad LPE"); if (this->getRepr()->attribute("d")) { @@ -233,7 +233,7 @@ void SPGenericEllipse::set_shape() { this->setCurveInsync( curve, TRUE); this->setCurveBeforeLPE(curve); - if (sp_lpe_item_has_path_effect(this) && sp_lpe_item_path_effects_enabled(this)) { + if (hasPathEffect() && sp_lpe_item_path_effects_enabled(this)) { SPCurve *c_lpe = curve->copy(); bool success = sp_lpe_item_perform_path_effect(this, c_lpe); diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index ca5ca1615..bdcfe46d0 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -765,7 +765,7 @@ void SPGroup::update_patheffect(bool write) { } } - if (sp_lpe_item_has_path_effect(this) && sp_lpe_item_path_effects_enabled(this)) { + if (hasPathEffect() && sp_lpe_item_path_effects_enabled(this)) { for (PathEffectList::iterator it = this->path_effect_list->begin(); it != this->path_effect_list->end(); it++) { LivePathEffectObject *lpeobj = (*it)->lpeobject; diff --git a/src/sp-item.cpp b/src/sp-item.cpp index bdcbefbba..a99bf85cc 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -1287,7 +1287,7 @@ void SPItem::adjust_livepatheffect (Geom::Affine const &postmul, bool set) { if ( SP_IS_LPE_ITEM(this) ) { SPLPEItem *lpeitem = SP_LPE_ITEM (this); - if ( sp_lpe_item_has_path_effect(lpeitem) ) { + if ( lpeitem->hasPathEffect() ) { sp_lpe_item_fork_path_effects_if_necessary(lpeitem); // now that all LPEs are forked_if_necessary, we can apply the transform diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index c86730048..b3e6182a4 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -181,7 +181,7 @@ void SPLPEItem::modified(unsigned int flags) { Inkscape::XML::Node* SPLPEItem::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { if (flags & SP_OBJECT_WRITE_EXT) { - if ( sp_lpe_item_has_path_effect(this) ) { + if ( hasPathEffect() ) { std::string href = patheffectlist_write_svg(*this->path_effect_list); repr->setAttribute("inkscape:path-effect", href.c_str()); } else { @@ -206,7 +206,7 @@ bool sp_lpe_item_perform_path_effect(SPLPEItem *lpeitem, SPCurve *curve) { return false; } - if (sp_lpe_item_has_path_effect(lpeitem) && sp_lpe_item_path_effects_enabled(lpeitem)) { + if (lpeitem->hasPathEffect() && sp_lpe_item_path_effects_enabled(lpeitem)) { for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it) { LivePathEffectObject *lpeobj = (*it)->lpeobject; @@ -292,16 +292,16 @@ sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write) } } - SPLPEItem *top; + SPLPEItem *top = NULL; if (wholetree) { - SPObject *prev_parent = lpeitem; - SPObject *parent = prev_parent->parent; - while (parent && SP_IS_LPE_ITEM(parent) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(parent))) { + SPLPEItem *prev_parent = lpeitem; + SPLPEItem *parent = dynamic_cast<SPLPEItem*>(prev_parent->parent); + while (parent && parent->hasPathEffectRecursive()) { prev_parent = parent; - parent = prev_parent->parent; + parent = dynamic_cast<SPLPEItem*>(prev_parent->parent); } - top = SP_LPE_ITEM(prev_parent); + top = prev_parent; } else { top = lpeitem; @@ -356,8 +356,7 @@ sp_lpe_item_cleanup_original_path_recursive(SPLPEItem *lpeitem) } else if (SP_IS_PATH(lpeitem)) { Inkscape::XML::Node *repr = lpeitem->getRepr(); - if (!sp_lpe_item_has_path_effect_recursive(lpeitem) - && repr->attribute("inkscape:original-d")) { + if (!lpeitem->hasPathEffectRecursive() && repr->attribute("inkscape:original-d")) { repr->setAttribute("d", repr->attribute("inkscape:original-d")); repr->setAttribute("inkscape:original-d", NULL); } @@ -495,57 +494,58 @@ void sp_lpe_item_up_current_path_effect(SPLPEItem *lpeitem) } /** used for shapes so they can see if they should also disable shape calculation and read from d= */ -bool sp_lpe_item_has_broken_path_effect(SPLPEItem const *lpeitem) +bool SPLPEItem::hasBrokenPathEffect() const { - if (lpeitem->path_effect_list->empty()) + if (path_effect_list->empty()) { return false; + } // go through the list; if some are unknown or invalid, return true - PathEffectList const effect_list = sp_lpe_item_get_effect_list(lpeitem); - for (PathEffectList::const_iterator it = effect_list.begin(); it != effect_list.end(); ++it) + for (PathEffectList::const_iterator it = path_effect_list->begin(); it != path_effect_list->end(); ++it) { LivePathEffectObject *lpeobj = (*it)->lpeobject; - if (!lpeobj || !lpeobj->get_lpe()) + if (!lpeobj || !lpeobj->get_lpe()) { return true; + } } return false; } -bool sp_lpe_item_has_path_effect(SPLPEItem const *lpeitem) +bool SPLPEItem::hasPathEffect() const { - if (lpeitem->path_effect_list->empty()) + if (path_effect_list->empty()) { return false; + } // go through the list; if some are unknown or invalid, we are not an LPE item! - PathEffectList const effect_list = sp_lpe_item_get_effect_list(lpeitem); - for (PathEffectList::const_iterator it = effect_list.begin(); it != effect_list.end(); ++it) + for (PathEffectList::const_iterator it = path_effect_list->begin(); it != path_effect_list->end(); ++it) { LivePathEffectObject *lpeobj = (*it)->lpeobject; - if (!lpeobj || !lpeobj->get_lpe()) + if (!lpeobj || !lpeobj->get_lpe()) { return false; + } } return true; } -bool sp_lpe_item_has_path_effect_recursive(SPLPEItem const *lpeitem) +bool SPLPEItem::hasPathEffectRecursive() const { - SPObject const *parent = lpeitem->parent; if (parent && SP_IS_LPE_ITEM(parent)) { - return sp_lpe_item_has_path_effect(lpeitem) || sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(parent)); + return hasPathEffect() || SP_LPE_ITEM(parent)->hasPathEffectRecursive(); } else { - return sp_lpe_item_has_path_effect(lpeitem); + return hasPathEffect(); } } Inkscape::LivePathEffect::Effect* -sp_lpe_item_has_path_effect_of_type(SPLPEItem *lpeitem, int type) +SPLPEItem::getPathEffectOfType(int type) { std::list<Inkscape::LivePathEffect::LPEObjectReference *>::iterator i; - for (i = lpeitem->path_effect_list->begin(); i != lpeitem->path_effect_list->end(); ++i) { + for (i = path_effect_list->begin(); i != path_effect_list->end(); ++i) { Inkscape::LivePathEffect::Effect* lpe = (*i)->lpeobject->get_lpe(); if (lpe && (lpe->effectType() == type)) { return lpe; @@ -560,8 +560,9 @@ bool sp_lpe_item_can_accept_freehand_shape(SPLPEItem *lpeitem) if (!SP_IS_PATH(lpeitem)) return false; - if (sp_lpe_item_has_path_effect_of_type(lpeitem, Inkscape::LivePathEffect::FREEHAND_SHAPE)) + if (lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::FREEHAND_SHAPE)) { return false; + } return true; } @@ -577,7 +578,7 @@ void sp_lpe_item_edit_next_param_oncanvas(SPLPEItem *lpeitem, SPDesktop *dt) void SPLPEItem::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { SPItem::child_added(child, ref); - if (sp_lpe_item_has_path_effect_recursive(this)) { + if (this->hasPathEffectRecursive()) { SPObject *ochild = this->get_child_by_repr(child); if ( ochild && SP_IS_LPE_ITEM(ochild) ) { @@ -586,7 +587,7 @@ void SPLPEItem::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref } } void SPLPEItem::remove_child(Inkscape::XML::Node * child) { - if (sp_lpe_item_has_path_effect_recursive(this)) { + if (this->hasPathEffectRecursive()) { SPObject *ochild = this->get_child_by_repr(child); if ( ochild && SP_IS_LPE_ITEM(ochild) ) { @@ -717,7 +718,7 @@ bool sp_lpe_item_fork_path_effects_if_necessary(SPLPEItem *lpeitem, unsigned int { bool forked = false; - if ( sp_lpe_item_has_path_effect(lpeitem) ) { + if ( lpeitem->hasPathEffect() ) { // If one of the path effects is used by 2 or more items, fork it // so that each object has its own independent copy of the effect. // Note: replacing path effects messes up the path effect list diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h index 925ff34d8..81adb938a 100644 --- a/src/sp-lpe-item.h +++ b/src/sp-lpe-item.h @@ -69,6 +69,11 @@ public: virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); virtual void update_patheffect(bool write); + + bool hasPathEffect() const; + bool hasPathEffectRecursive() const; + Inkscape::LivePathEffect::Effect* getPathEffectOfType(int type); + bool hasBrokenPathEffect() const; }; void sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write); @@ -80,10 +85,6 @@ void sp_lpe_item_remove_all_path_effects(SPLPEItem *lpeitem, bool keep_paths); void sp_lpe_item_remove_current_path_effect(SPLPEItem *lpeitem, bool keep_paths); void sp_lpe_item_down_current_path_effect(SPLPEItem *lpeitem); void sp_lpe_item_up_current_path_effect(SPLPEItem *lpeitem); -bool sp_lpe_item_has_path_effect(SPLPEItem const *lpeitem); -bool sp_lpe_item_has_broken_path_effect(SPLPEItem const *lpeitem); -bool sp_lpe_item_has_path_effect_recursive(SPLPEItem const *lpeitem); -Inkscape::LivePathEffect::Effect* sp_lpe_item_has_path_effect_of_type(SPLPEItem *lpeitem, int type); bool sp_lpe_item_can_accept_freehand_shape(SPLPEItem *lpeitem); void sp_lpe_item_edit_next_param_oncanvas(SPLPEItem *lpeitem, SPDesktop *dt); PathEffectList sp_lpe_item_get_effect_list(SPLPEItem *lpeitem); diff --git a/src/sp-path.cpp b/src/sp-path.cpp index 6a503c6b2..af2f02328 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -74,7 +74,7 @@ gchar* SPPath::description() { int count = this->nodesInPath(); char *lpe_desc = g_strdup(""); - if (sp_lpe_item_has_path_effect(this)) { + if (hasPathEffect()) { Glib::ustring s; PathEffectList effect_list = sp_lpe_item_get_effect_list(this); @@ -259,20 +259,20 @@ void SPPath::update(SPCtx *ctx, guint flags) { } Geom::Affine SPPath::set_transform(Geom::Affine const &transform) { - if (!this->_curve) { // 0 nodes, nothing to transform + if (!_curve) { // 0 nodes, nothing to transform return Geom::identity(); } // Transform the original-d path if this is a valid LPE this, other else the (ordinary) path - if (this->_curve_before_lpe && sp_lpe_item_has_path_effect_recursive(this)) { - if (sp_lpe_item_has_path_effect_of_type(this, Inkscape::LivePathEffect::CLONE_ORIGINAL)) { + if (_curve_before_lpe && hasPathEffectRecursive()) { + if (getPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL)) { // if path has the CLONE_ORIGINAL LPE applied, don't write the transform to the pathdata, but write it 'unoptimized' return transform; } else { - this->_curve_before_lpe->transform(transform); + _curve_before_lpe->transform(transform); } } else { - this->_curve->transform(transform); + _curve->transform(transform); } // Adjust stroke @@ -301,8 +301,8 @@ void SPPath::update_patheffect(bool write) { g_message("sp_path_update_patheffect"); #endif - if (this->_curve_before_lpe && sp_lpe_item_has_path_effect_recursive(this)) { - SPCurve *curve = this->_curve_before_lpe->copy(); + if (_curve_before_lpe && hasPathEffectRecursive()) { + SPCurve *curve = _curve_before_lpe->copy(); /* if a path has an lpeitem applied, then reset the curve to the _curve_before_lpe. * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ this->setCurveInsync(curve, TRUE); @@ -315,7 +315,7 @@ g_message("sp_path_update_patheffect"); g_message("sp_path_update_patheffect writes 'd' attribute"); #endif - if ( this->_curve != NULL ) { + if (_curve) { gchar *str = sp_svg_write_path(this->_curve->get_pathvector()); repr->setAttribute("d", str); g_free(str); @@ -385,7 +385,7 @@ SPCurve * SPPath::get_original_curve () const */ SPCurve* SPPath::get_curve_for_edit () const { - if (_curve_before_lpe && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(this))) { + if (_curve_before_lpe && hasPathEffectRecursive()) { return get_original_curve(); } else { return getCurve(); @@ -398,7 +398,7 @@ SPCurve* SPPath::get_curve_for_edit () const */ const SPCurve* SPPath::get_curve_reference () const { - if (_curve_before_lpe && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(this))) { + if (_curve_before_lpe && hasPathEffectRecursive()) { return _curve_before_lpe; } else { return _curve; @@ -411,7 +411,7 @@ const SPCurve* SPPath::get_curve_reference () const */ SPCurve* SPPath::get_curve () { - if (_curve_before_lpe && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(this))) { + if (_curve_before_lpe && hasPathEffectRecursive()) { return _curve_before_lpe; } else { return _curve; diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index 8f3d5117f..7efe28dd8 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -1003,7 +1003,7 @@ SPCurve * SPShape::getCurve() const */ SPCurve * SPShape::getCurveBeforeLPE() const { - if (sp_lpe_item_has_path_effect(this)) { + if (hasPathEffect()) { if (_curve_before_lpe) { return this->_curve_before_lpe->copy(); } diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index 0c5ef253f..e911e722c 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -326,7 +326,7 @@ void SPSpiral::set_shape() { SPSpiral *spiral = this; SPSpiral* shape = spiral; - if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(shape))) { + if (hasBrokenPathEffect()) { g_warning ("The spiral shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as spiral will remove the bad LPE"); if (shape->getRepr()->attribute("d")) { @@ -380,12 +380,12 @@ void SPSpiral::set_shape() { /* Reset the shape'scurve to the "original_curve" * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ - shape->setCurveInsync( c, TRUE); - shape->setCurveBeforeLPE( c ); + setCurveInsync( c, TRUE); + setCurveBeforeLPE( c ); - if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) { + if (hasPathEffect() && sp_lpe_item_path_effects_enabled(this)) { SPCurve *c_lpe = c->copy(); - bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe); + bool success = sp_lpe_item_perform_path_effect(this, c_lpe); if (success) { shape->setCurveInsync( c_lpe, TRUE); diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 10c3267b2..c2c0883e5 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -378,7 +378,7 @@ void SPStar::set_shape() { // perhaps we should convert all our shapes into LPEs without source path // and with knotholders for parameters, then this situation will be handled automatically // by disabling the entire stack (including the shape LPE) - if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(this))) { + if (hasBrokenPathEffect()) { g_warning ("The star shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as star will remove the bad LPE"); if (this->getRepr()->attribute("d")) { @@ -395,7 +395,6 @@ void SPStar::set_shape() { SPCurve *c = new SPCurve (); - gint sides = this->sides; bool not_rounded = (fabs (this->rounded) < 1e-4); // note that we pass randomized=true to sp_star_get_xy, because the curve must be randomized; @@ -461,9 +460,9 @@ void SPStar::set_shape() { this->setCurveInsync( c, TRUE); this->setCurveBeforeLPE( c ); - if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(this)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(this))) { + if (hasPathEffect() && sp_lpe_item_path_effects_enabled(this)) { SPCurve *c_lpe = c->copy(); - bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (this), c_lpe); + bool success = sp_lpe_item_perform_path_effect(this, c_lpe); if (success) { this->setCurveInsync( c_lpe, TRUE); diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 65106e651..cfd1effcc 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -636,7 +636,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P if (newrepr) { newrepr->setAttribute("d", str); } else { - if (SP_IS_LPE_ITEM(item) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(item))) { + if (SP_IS_LPE_ITEM(item) && SP_LPE_ITEM(item)->hasPathEffectRecursive()) { item->getRepr()->setAttribute("inkscape:original-d", str); } else { item->getRepr()->setAttribute("d", str); diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 1d91a3b4d..ed28cabbd 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -724,7 +724,7 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) // For lpe items, copy lpe stack if applicable if (SP_IS_LPE_ITEM(item)) { SPLPEItem *lpeitem = SP_LPE_ITEM (item); - if (sp_lpe_item_has_path_effect(lpeitem)) { + if (lpeitem->hasPathEffect()) { for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it) { LivePathEffectObject *lpeobj = (*it)->lpeobject; diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 6dc9c1ee3..2319d2c70 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -279,7 +279,7 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel) current_lpeitem = lpeitem; set_sensitize_all(true); - if ( sp_lpe_item_has_path_effect(lpeitem) ) { + if ( lpeitem->hasPathEffect() ) { Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem); if (lpe) { showParams(*lpe); diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index ac023beaa..673eba97a 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1201,8 +1201,8 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE) Geom::PathVector pathv = builder.peek() * (_edit_transform * _i2d_transform).inverse(); _spcurve->set_pathvector(pathv); if (alert_LPE) { - if (SP_IS_LPE_ITEM(_path) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(_path))) { - PathEffectList effect_list = sp_lpe_item_get_effect_list(SP_LPE_ITEM(_path)); + if (_path->hasPathEffect()) { + PathEffectList effect_list = sp_lpe_item_get_effect_list(_path); LivePathEffect::LPEPowerStroke *lpe_pwr = dynamic_cast<LivePathEffect::LPEPowerStroke*>( effect_list.front()->lpeobject->get_lpe() ); if (lpe_pwr) { lpe_pwr->adjustForNewPath(pathv); diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index c3e5b22ce..2348acc46 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -317,7 +317,7 @@ static void sp_node_toolbox_sel_changed(Inkscape::Selection *selection, GObject GtkAction* w = GTK_ACTION( g_object_get_data( tbl, "nodes_lpeedit" ) ); SPItem *item = selection->singleItem(); if (item && SP_IS_LPE_ITEM(item)) { - if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) { + if (SP_LPE_ITEM(item)->hasPathEffect()) { gtk_action_set_sensitive(w, TRUE); } else { gtk_action_set_sensitive(w, FALSE); |
