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/xml/repr-util.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/xml/repr-util.cpp') diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 12280ea5a..447f2ff40 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -259,7 +259,7 @@ gchar const *sp_xml_ns_prefix_uri(gchar const *prefix) * -1 first object's position is less than the second * @todo Rewrite this function's description to be understandable */ -int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second) +bool sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second) { int p1, p2; if (first->parent() == second->parent()) { @@ -276,9 +276,9 @@ int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::No g_assert(ancestor != NULL); if (ancestor == first) { - return 1; + return false; } else if (ancestor == second) { - return -1; + return true; } else { Inkscape::XML::Node const *to_first = AncetreFils(first, ancestor); Inkscape::XML::Node const *to_second = AncetreFils(second, ancestor); @@ -288,9 +288,9 @@ int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::No } } - if (p1 > p2) return 1; - if (p1 < p2) return -1; - return 0; + if (p1 > p2) return false; + if (p1 < p2) return true; + return false; /* effic: Assuming that the parent--child relationship is consistent (i.e. that the parent really does contain first and second among -- cgit v1.2.3 From 6307c00b5774db5e914415127b302cca5e21345b Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 1 May 2015 02:26:56 +0200 Subject: Fixed crash bug due to some overlooked function changed in the recent merge. Also fixed the layer ordering in the widget, which was messed up by the same bug in a way i haven't quite sorted out (so the fact that this patch fixed it is quite a mystery, but i won't complain) (bzr r14079) --- src/xml/repr-util.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/xml/repr-util.cpp') diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 3858f08a7..305f1b292 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -260,7 +260,7 @@ gchar const *sp_xml_ns_prefix_uri(gchar const *prefix) * -1 first object's position is less than the second * @todo Rewrite this function's description to be understandable */ -bool sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second) +int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second) { int p1, p2; if (first->parent() == second->parent()) { @@ -277,9 +277,9 @@ bool sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::N g_assert(ancestor != NULL); if (ancestor == first) { - return false; + return 1; } else if (ancestor == second) { - return true; + return -1; } else { Inkscape::XML::Node const *to_first = AncetreFils(first, ancestor); Inkscape::XML::Node const *to_second = AncetreFils(second, ancestor); @@ -289,9 +289,9 @@ bool sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::N } } - if (p1 > p2) return false; - if (p1 < p2) return true; - return false; + if (p1 > p2) return 1; + if (p1 < p2) return -1; + return 0; /* effic: Assuming that the parent--child relationship is consistent (i.e. that the parent really does contain first and second among @@ -310,6 +310,11 @@ bool sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::N pjrm */ } +bool sp_repr_compare_position_bool(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second){ + return sp_repr_compare_position_bool(first, second)<0; +} + + /** * Find an element node using an unique attribute. * -- cgit v1.2.3 From d865487a94fb0f2b5fba2bb332011ec7a7420ae7 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 2 May 2015 01:08:34 +0200 Subject: Fix segfault due to an infinite recursion (due to a typo) (bzr r14083) --- src/xml/repr-util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xml/repr-util.cpp') diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 305f1b292..4cbe930a1 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -311,7 +311,7 @@ int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::No } bool sp_repr_compare_position_bool(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second){ - return sp_repr_compare_position_bool(first, second)<0; + return sp_repr_compare_position(first, second)<0; } -- cgit v1.2.3