diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 77b2db6f69a6fc83c66a6b55428ba099dfac5e19..afd36d2ddef30cf1a68293cd86112984c86cf416 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
-#define __SP_LPE_ITEM_CPP__
-
/** \file
* Base class for live path effect items
*/
* Authors:
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Bastien Bouclet <bgkweb@gmail.com>
+ * Abhishek Sharma
*
* Copyright (C) 2008 authors
*
static void
sp_lpe_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- sp_object_read_attr(object, "inkscape:path-effect");
+ object->readAttr( "inkscape:path-effect" );
if (((SPObjectClass *) parent_class)->build) {
((SPObjectClass *) parent_class)->build(object, document, repr);
@@ -681,7 +680,7 @@ sp_lpe_item_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape:
(* ((SPObjectClass *) (parent_class))->child_added) (object, child, ref);
if (SP_IS_LPE_ITEM(object) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(object))) {
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
if ( ochild && SP_IS_LPE_ITEM(ochild) ) {
sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(ochild));
}
sp_lpe_item_remove_child (SPObject * object, Inkscape::XML::Node * child)
{
if (SP_IS_LPE_ITEM(object) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(object))) {
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
if ( ochild && SP_IS_LPE_ITEM(ochild) ) {
sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(ochild));
}
@@ -814,6 +813,10 @@ bool sp_lpe_item_fork_path_effects_if_necessary(SPLPEItem *lpeitem, unsigned int
// so that each object has its own independent copy of the effect.
// Note: replacing path effects messes up the path effect list
+ // Clones of the LPEItem will increase the refcount of the lpeobjects.
+ // Therefore, nr_of_allowed_users should be increased with the number of clones (i.e. refs to the lpeitem)
+ nr_of_allowed_users += SP_OBJECT(lpeitem)->hrefcount;
+
std::vector<LivePathEffectObject const *> old_lpeobjs, new_lpeobjs;
PathEffectList effect_list = sp_lpe_item_get_effect_list(lpeitem);
for (PathEffectList::iterator it = effect_list.begin(); it != effect_list.end(); it++)
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :