diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-05-01 00:26:56 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <mc@M0nst3r.bouyguesbox.fr> | 2015-05-01 00:26:56 +0000 |
| commit | 6307c00b5774db5e914415127b302cca5e21345b (patch) | |
| tree | 083366e46db29d29c080d6f6f4caf34445bd52d6 /src/xml/repr-util.cpp | |
| parent | cmake: Fix various issues with cmake builds (diff) | |
| download | inkscape-6307c00b5774db5e914415127b302cca5e21345b.tar.gz inkscape-6307c00b5774db5e914415127b302cca5e21345b.zip | |
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)
Diffstat (limited to 'src/xml/repr-util.cpp')
| -rw-r--r-- | src/xml/repr-util.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
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. * |
