summaryrefslogtreecommitdiffstats
path: root/src/sp-object.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-02-23 22:17:37 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-02-23 22:17:37 +0000
commited54c75dc7f31deae37ab89162da9127fb0e3b9a (patch)
treefe5809ff5f17199e7fa773cd47ef877b4a8125d3 /src/sp-object.cpp
parentAdded flexible/fixed to fillet chamfer and fix bugs (diff)
parenton a File->Open, set the viewBox if it did not previously exist, same as was ... (diff)
downloadinkscape-ed54c75dc7f31deae37ab89162da9127fb0e3b9a.tar.gz
inkscape-ed54c75dc7f31deae37ab89162da9127fb0e3b9a.zip
update to trunk
(bzr r13645.1.21)
Diffstat (limited to 'src/sp-object.cpp')
-rw-r--r--src/sp-object.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 7d24a978e..1094b88a7 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -115,7 +115,7 @@ static gchar *sp_object_get_unique_id(SPObject *object,
SPObject::SPObject()
: cloned(0), uflags(0), mflags(0), hrefcount(0), _total_hrefcount(0),
document(NULL), parent(NULL), children(NULL), _last_child(NULL),
- next(NULL), id(NULL), repr(NULL), refCount(1),
+ next(NULL), id(NULL), repr(NULL), refCount(1),hrefList(std::list<SPObject*>()),
_successor(NULL), _collection_policy(SPObject::COLLECT_WITH_PARENT),
_label(NULL), _default_label(NULL)
{
@@ -254,7 +254,7 @@ SPObject *sp_object_unref(SPObject *object, SPObject *owner)
return NULL;
}
-SPObject *sp_object_href(SPObject *object, gpointer /*owner*/)
+SPObject *sp_object_href(SPObject *object, SPObject* owner)
{
g_return_val_if_fail(object != NULL, NULL);
g_return_val_if_fail(SP_IS_OBJECT(object), NULL);
@@ -262,10 +262,13 @@ SPObject *sp_object_href(SPObject *object, gpointer /*owner*/)
object->hrefcount++;
object->_updateTotalHRefCount(1);
+ if(owner)
+ object->hrefList.push_front(owner);
+
return object;
}
-SPObject *sp_object_hunref(SPObject *object, gpointer /*owner*/)
+SPObject *sp_object_hunref(SPObject *object, SPObject* owner)
{
g_return_val_if_fail(object != NULL, NULL);
g_return_val_if_fail(SP_IS_OBJECT(object), NULL);
@@ -274,6 +277,9 @@ SPObject *sp_object_hunref(SPObject *object, gpointer /*owner*/)
object->hrefcount--;
object->_updateTotalHRefCount(-1);
+ if(owner)
+ object->hrefList.remove(owner);
+
return NULL;
}