From a7f2b2ba3f13ceb60376802f4a31e104153839e8 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Feb 2015 03:00:37 +0100 Subject: At first, I was thinking "I just have to go to the selection file, and change that GSList* with a std::list, then resolve the few problems" So, i tried that. And I will continue tomorrow, and the days after, on and on. (bzr r13922.1.1) --- src/sp-object.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 7d24a978e..3ea480f66 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -382,14 +382,14 @@ void SPObject::changeCSS(SPCSSAttr *css, gchar const *attr) sp_repr_css_change(this->getRepr(), css, attr); } -GSList *SPObject::childList(bool add_ref, Action) { - GSList *l = NULL; +SelContainer SPObject::childList(bool add_ref, Action) { + SelContainer l; for ( SPObject *child = firstChild() ; child; child = child->getNext() ) { if (add_ref) { sp_object_ref (child); } - l = g_slist_prepend (l, child); + l.push_front(child); } return l; -- cgit v1.2.3 From 7e4b6f793d31d3245bd8afbf6f10aa255ac3e7ae Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Feb 2015 20:20:09 +0100 Subject: added a set to the Selection (bzr r13922.1.6) --- src/sp-object.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 3ea480f66..6cc5d7114 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -382,14 +382,14 @@ void SPObject::changeCSS(SPCSSAttr *css, gchar const *attr) sp_repr_css_change(this->getRepr(), css, attr); } -SelContainer SPObject::childList(bool add_ref, Action) { - SelContainer l; +std::vector SPObject::childList(bool add_ref, Action) { + std::vector l; for ( SPObject *child = firstChild() ; child; child = child->getNext() ) { if (add_ref) { sp_object_ref (child); } - l.push_front(child); + l.push_back(child); } return l; -- cgit v1.2.3 From 280053e5ddfcdf158f62d2d6a72681b3092d2168 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 2 May 2015 03:47:39 +0200 Subject: Fixed comparison function used in sorts (bzr r14085) --- src/sp-object.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index d4b8a15c0..0bb8c240f 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -357,6 +357,10 @@ int sp_object_compare_position(SPObject const *first, SPObject const *second) return result; } +bool sp_object_compare_position_bool(SPObject const *first, SPObject const *second){ + return sp_object_compare_position(first,second)<0; +} + SPObject *SPObject::appendChildRepr(Inkscape::XML::Node *repr) { if ( !cloned ) { -- cgit v1.2.3 From 676707120d5527ff8c8c8c89ea33d1eadf9cf1b4 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 14 Jul 2015 13:04:32 +0200 Subject: Fix for circular references detection in almost all cases, fixing https://bugs.launchpad.net/inkscape/+bug/167247 and a few of its duplicates. This fix is aimed at preventing any sort of circular references with the URIReference::_acceptObject method, checking the absence of loops in the reference+child tree. There can be some performance improvements done if we add a pointer from cloned sub-objects to their origin sub-object. The remaining cases that are not fixed can involve non-trivial loops using one or more "url()" stylesheet references. Being able to take them into account would require a non-obvious style.cpp refactoring making use of URIReference for this kind of reference (and not handling manually the signals in the styling code, which would probably be a good thing to do anyway) (bzr r14245) --- src/sp-object.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 0bb8c240f..db66eb3e6 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -721,6 +721,9 @@ void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, uns } this->cloned = cloned; + /* Invoke derived methods, if any */ + this->build(document, repr); + if ( !cloned ) { this->document->bindObjectToRepr(this->repr, this); @@ -754,8 +757,6 @@ void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, uns g_assert(this->getId() == NULL); } - /* Invoke derived methods, if any */ - this->build(document, repr); /* Signalling (should be connected AFTER processing derived methods */ sp_repr_add_listener(repr, &object_event_vector, this); -- cgit v1.2.3