X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fshape-editor.cpp;h=bfe407957c8f98aa982d83deb45a70bd173aa919;hb=3ee72fa327a9af0a8a75c0a223f4e89d4a765478;hp=b5fd85858c954f9b4dcf515074f367273c653421;hpb=2def8728116a0645a04e42d9c7d91502e6de4cbc;p=inkscape.git diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index b5fd85858..bfe407957 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -317,22 +317,22 @@ void ShapeEditor::set_item_lpe_path_parameter(SPItem *item, SPObject *lpeobject, Why not make a reload function in NodePath and in KnotHolder? */ void ShapeEditor::reset_item (SubType type, bool keep_knotholder) { - SPObject *item = sp_desktop_document(desktop)->getObjectByRepr(listener_attached_for); + /// note that it is not certain that this is an SPItem; it could be a LivePathEffectObject. + SPObject *obj = sp_desktop_document(desktop)->getObjectByRepr(listener_attached_for); switch (type) { case SH_NODEPATH: - if ( (this->nodepath) && (IS_LIVEPATHEFFECT(this->nodepath->object)) ) { - SPObject *obj = this->nodepath->object; - char * key = g_strdup(this->nodepath->repr_key); - set_item_lpe_path_parameter(SP_ITEM(item), obj, key); // the above checks for nodepath, so it is indeed a path that we are editing + if ( (nodepath) && (IS_LIVEPATHEFFECT(nodepath->object)) ) { + char * key = g_strdup(nodepath->repr_key); + set_item_lpe_path_parameter(nodepath->item, nodepath->object, key); // the above checks for nodepath, so it is indeed a path that we are editing g_free(key); } else { - set_item(SP_ITEM(item), SH_NODEPATH); - } + set_item(SP_ITEM(obj), SH_NODEPATH); + } break; case SH_KNOTHOLDER: if (this->knotholder) { - set_item(SP_ITEM(item), SH_KNOTHOLDER, keep_knotholder); + set_item(SP_ITEM(obj), SH_KNOTHOLDER, keep_knotholder); } break; }