Code

Remove now obsolete functions
authorcilix42 <cilix42@users.sourceforge.net>
Tue, 29 Jul 2008 14:56:10 +0000 (14:56 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Tue, 29 Jul 2008 14:56:10 +0000 (14:56 +0000)
src/node-context.cpp
src/selection.cpp
src/shape-editor.cpp
src/sp-lpe-item.cpp
src/sp-lpe-item.h

index 66e535ac3100c795144d8b8e2e192f5d179a3d3a..bff972408c8910055f80c846d4f99f5c3489141b 100644 (file)
@@ -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) {
index 33be17a8ef19528943e33b6b7ec8bf92d2da0373..acab9396c86bb29b758a951e8b06d9dfb888373f 100644 (file)
@@ -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);
 }
 
index 4c182788f3cb78c727e7ae9cfb1ec6e65da50cfd..c88b5eb3f453baa938ecc8ed6ea595fdfa8c9102 100644 (file)
@@ -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;
index 4089e8a2445db45e8b87b8fa021f9b7ebf43d040..1138c3ccde7695a47707cab0380ac7cf30f29aeb 100644 (file)
@@ -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<Inkscape::Display::TemporaryItem*>::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++
index c92616ccade3716657592892282e8c8f5f2df443..c5dc4048bce257806466457a090e4d1f8a1cc126 100644 (file)
@@ -42,9 +42,6 @@ struct SPLPEItem : public SPItem {
     Inkscape::LivePathEffect::LPEObjectReference* current_path_effect;
     std::vector<Inkscape::Display::TemporaryItem*> 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 */