
Hi all,
Is the number of times an spobject is cloned (svg "use") counted? It would be a really great help in fixing a bug. So what I'd like to have is: SPObject obj; obj->clone_count or something similar.
Thanks, Johan

On Sun, May 30, 2010 at 4:59 PM, <J.B.C.Engelen@...1578...> wrote:
Hi all,
Is the number of times an spobject is cloned (svg "use") counted?
Not as such, but every clone has a SPUseReference pointing to its original. That is a subclass of URIReference, and in that class we have _setObject which does:
if (_obj) { sp_object_href(_obj, _owner); _release_connection = _obj->connectRelease(sigc::mem_fun(*this, &URIReference::_release)); }
So, yes, when you clone an object, its hrefcount is incremented. This is not unique to clones, but then, other situations where it is also incremented (grepping finds only using object as marker) should be treated the same anyway.

-----Original Message----- From: bulia byak [mailto:buliabyak@...400...] Sent: 01 June 2010 21:21 To: Engelen, J.B.C. (Johan) Cc: Inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] SPObject counting clones
On Sun, May 30, 2010 at 4:59 PM, <J.B.C.Engelen@...1578...>
wrote:
Hi all,
Is the number of times an spobject is cloned (svg "use") counted?
Not as such, but every clone has a SPUseReference pointing to its original. That is a subclass of URIReference, and in that class we have _setObject which does:
if (_obj) { sp_object_href(_obj, _owner); _release_connection =
_obj->connectRelease(sigc::mem_fun(*this, &URIReference::_release)); }
So, yes, when you clone an object, its hrefcount is incremented. This is not unique to clones, but then, other situations where it is also incremented (grepping finds only using object as marker) should be treated the same anyway.
Thanks for providing the solution :-) I think I fixed LPE forking now. Works splendid with clones now.
Ciao, Johan
participants (2)
-
unknown@example.com
-
bulia byak