summaryrefslogtreecommitdiffstats
path: root/src/sp-conn-end-pair.cpp
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2006-05-28 04:03:35 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2006-05-28 04:03:35 +0000
commit71871ca275fef9517a5fb41f23f99c5da37fea57 (patch)
tree9e5cd9dc775d4395bc00c701d67c464043b03ff6 /src/sp-conn-end-pair.cpp
parentcenter the tree on the current layer (diff)
downloadinkscape-71871ca275fef9517a5fb41f23f99c5da37fea57.tar.gz
inkscape-71871ca275fef9517a5fb41f23f99c5da37fea57.zip
* src/sp-conn-end-pair.cpp: Detach connectors from empty groups
before trying to route connectors to them. This is required since empty groups have no physical position. Fixes bug #1448811. (bzr r1034)
Diffstat (limited to 'src/sp-conn-end-pair.cpp')
-rw-r--r--src/sp-conn-end-pair.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp
index a1c4697e5..c5cc75251 100644
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
@@ -19,6 +19,7 @@
#include "libavoid/vertices.h"
#include "libavoid/router.h"
#include "document.h"
+#include "sp-item-group.h"
SPConnEndPair::SPConnEndPair(SPPath *const owner)
@@ -138,6 +139,20 @@ void
SPConnEndPair::getAttachedItems(SPItem *h2attItem[2]) const {
for (unsigned h = 0; h < 2; ++h) {
h2attItem[h] = this->_connEnd[h]->ref.getObject();
+
+ // Deal with the case of the attached object being an empty group.
+ // A group containing no items does not have a valid bbox, so
+ // causes problems for the auto-routing code. Also, since such a
+ // group no longer has an onscreen representation and can only be
+ // selected through the XML editor, it makes sense just to detach
+ // connectors from them.
+ if (SP_IS_GROUP(h2attItem[h])) {
+ if (SP_GROUP(h2attItem[h])->group->getItemCount() == 0) {
+ // This group is empty, so detach.
+ sp_conn_end_detach(_path, h);
+ h2attItem[h] = NULL;
+ }
+ }
}
}