From: cilix42 Date: Tue, 29 Jul 2008 14:56:10 +0000 (+0000) Subject: Remove now obsolete functions X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f3a66fd7107a518ece46e251bb8248975de66bc7;p=inkscape.git Remove now obsolete functions --- diff --git a/src/node-context.cpp b/src/node-context.cpp index 66e535ac3..bff972408 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -121,12 +121,6 @@ sp_node_context_dispose(GObject *object) nc->sel_changed_connection.disconnect(); nc->sel_changed_connection.~connection(); - // TODO: should this be here? - SPItem *item = sp_desktop_selection(ec->desktop)->singleItem(); - if (item && SP_IS_LPE_ITEM(item)) { - sp_lpe_item_remove_temporary_canvasitems(SP_LPE_ITEM(item), ec->desktop); - } - delete nc->shape_editor; if (nc->_node_message_context) { diff --git a/src/selection.cpp b/src/selection.cpp index 33be17a8e..acab9396c 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -192,10 +192,6 @@ void Selection::_add(SPObject *obj) { add_3D_boxes_recursively(obj); - if (SP_IS_LPE_ITEM(obj)) { - sp_lpe_item_add_temporary_canvasitems(SP_LPE_ITEM(obj), desktop()); - } - _release_connections[obj] = obj->connectRelease(sigc::mem_fun(*this, (void (Selection::*)(SPObject *))&Selection::remove)); _modified_connections[obj] = obj->connectModified(sigc::mem_fun(*this, &Selection::_schedule_modified)); } @@ -262,10 +258,6 @@ void Selection::_remove(SPObject *obj) { remove_3D_boxes_recursively(obj); - if (SP_IS_LPE_ITEM(obj)) { - sp_lpe_item_remove_temporary_canvasitems(SP_LPE_ITEM(obj), desktop()); - } - _objs = g_slist_remove(_objs, obj); } diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index 4c182788f..c88b5eb3f 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -234,16 +234,7 @@ void ShapeEditor::set_item(SPItem *item, SubType type, bool keep_knotholder) { switch(type) { case SH_NODEPATH: if (SP_IS_LPE_ITEM(item)) { - //SPLPEItem *lpeitem = SP_LPE_ITEM(item); - //Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem); - //if (!(lpe && lpe->isVisible() && lpe->providesKnotholder())) { - // only create nodepath if the item either doesn't have an LPE - // or the LPE is invisible or it doesn't provide a knotholder itself - this->nodepath = sp_nodepath_new(desktop, item, - (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0)); - //} else if (lpe && lpe->isVisible()) { - // sp_lpe_item_add_temporary_canvasitems(lpeitem, desktop); - //} + this->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0)); } if (this->nodepath) { this->nodepath->shape_editor = this; diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 4089e8a24..1138c3ccd 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -120,9 +120,6 @@ sp_lpe_item_init(SPLPEItem *lpeitem) lpeitem->current_path_effect = NULL; new (&lpeitem->lpe_modified_connection) sigc::connection(); - - lpeitem->adding_helperpaths = false; - lpeitem->removing_helperpaths = false; } static void @@ -375,13 +372,6 @@ sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write) top = lpeitem; } - // TODO: ditch inkscape_active_desktop() - SPDesktop *desktop = inkscape_active_desktop(); - if (desktop) { - //sp_lpe_item_remove_temporary_canvasitems(lpeitem, desktop); - //sp_lpe_item_add_temporary_canvasitems(lpeitem, desktop); - } - if (SP_LPE_ITEM_CLASS (G_OBJECT_GET_CLASS (top))->update_patheffect) { SP_LPE_ITEM_CLASS (G_OBJECT_GET_CLASS (top))->update_patheffect (top, write); } @@ -769,43 +759,6 @@ bool sp_lpe_item_path_effects_enabled(SPLPEItem *lpeitem) return lpeitem->path_effects_enabled > 0; } -void -sp_lpe_item_add_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop) -{ - if (lpeitem->adding_helperpaths) { - return; - } - lpeitem->adding_helperpaths = true; - // FIXME: for some reason it seems that we must create the variable lpe AFTER checking - // for adding_helperpaths == true; otherwise we get a crash on startup. why?? - Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem); - if (lpe) { - // TODO: can we just update the tempitem's SPCurve instead of recreating it each time? - lpe->addHelperPaths(lpeitem, desktop); - } - lpeitem->adding_helperpaths = false; -} - -void -sp_lpe_item_remove_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop) -{ - g_return_if_fail(lpeitem); - g_return_if_fail(desktop); - - if (lpeitem->removing_helperpaths) { - return; - } - lpeitem->removing_helperpaths = true; - - // destroy all temporary canvasitems created by LPEs - std::vector::iterator i; - for (i = lpeitem->lpe_helperpaths.begin(); i != lpeitem->lpe_helperpaths.end(); ++i) { - desktop->remove_temporary_canvasitem(*i); - } - - lpeitem->removing_helperpaths = false; -} - /* Local Variables: mode:c++ diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h index c92616cca..c5dc4048b 100644 --- a/src/sp-lpe-item.h +++ b/src/sp-lpe-item.h @@ -42,9 +42,6 @@ struct SPLPEItem : public SPItem { Inkscape::LivePathEffect::LPEObjectReference* current_path_effect; std::vector lpe_helperpaths; - bool adding_helperpaths; - bool removing_helperpaths; - sigc::connection lpe_modified_connection; }; @@ -76,8 +73,6 @@ Inkscape::LivePathEffect::LPEObjectReference* sp_lpe_item_get_current_lpereferen Inkscape::LivePathEffect::Effect* sp_lpe_item_get_current_lpe(SPLPEItem *lpeitem); bool sp_lpe_item_set_current_path_effect(SPLPEItem *lpeitem, Inkscape::LivePathEffect::LPEObjectReference* lperef); bool sp_lpe_item_path_effects_enabled(SPLPEItem *lpeitem); -void sp_lpe_item_add_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop); -void sp_lpe_item_remove_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop); #endif /* !SP_LPE_ITEM_H_SEEN */