summaryrefslogtreecommitdiffstats
path: root/src/xml/repr-sorting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/repr-sorting.cpp')
-rw-r--r--src/xml/repr-sorting.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xml/repr-sorting.cpp b/src/xml/repr-sorting.cpp
index 056236d33..fd485925b 100644
--- a/src/xml/repr-sorting.cpp
+++ b/src/xml/repr-sorting.cpp
@@ -13,9 +13,14 @@ Inkscape::XML::Node const *LCA(Inkscape::XML::Node const *a, Inkscape::XML::Node
{
using Inkscape::Algorithms::longest_common_suffix;
Inkscape::XML::Node const *ancestor = longest_common_suffix<Inkscape::XML::NodeConstParentIterator>(
- a, b, NULL, &same_repr
- );
- if ( ancestor && ancestor->type() != Inkscape::XML::DOCUMENT_NODE ) {
+ a, b, NULL, &same_repr);
+ bool OK = false;
+ if (ancestor) {
+ if (ancestor->type() != Inkscape::XML::DOCUMENT_NODE) {
+ OK = true;
+ }
+ }
+ if ( OK ) {
return ancestor;
} else {
return NULL;