From 0daf8c64238778aaff20dec44140ad90c81b0d5e Mon Sep 17 00:00:00 2001 From: mjwybrow Date: Sat, 11 Feb 2006 01:57:03 +0000 Subject: [PATCH] * src/sp-conn-end-pair.cpp, src/conn-avoid-ref.cpp: Fix two bugs from my commit yesterday. --- ChangeLog | 5 +++++ src/conn-avoid-ref.cpp | 6 +++--- src/sp-conn-end-pair.cpp | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5c6c3a82..f55fd6ba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-02-11 Michael Wybrow + + * src/sp-conn-end-pair.cpp, src/conn-avoid-ref.cpp: + Fix two bugs from my commit yesterday. + 2006-02-10 Michael Wybrow * src/sp-conn-end-pair.cpp, src/sp-conn-end-pair.h, diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index 8fbdfb673..d7cca60f9 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -120,9 +120,9 @@ GSList *SPAvoidRef::getAttachedConnectors(const unsigned int type) Avoid::IntList::iterator finish = conns.end(); for (Avoid::IntList::iterator i = conns.begin(); i != finish; ++i) { const gchar *connId = g_quark_to_string(*i); - SPItem *item = SP_ITEM(item->document->getObjectById(connId)); - g_assert(item != NULL); - list = g_slist_prepend(list, item); + SPItem *citem = SP_ITEM(item->document->getObjectById(connId)); + g_assert(citem != NULL); + list = g_slist_prepend(list, citem); } return list; } diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp index bb5d89107..5b36f8796 100644 --- a/src/sp-conn-end-pair.cpp +++ b/src/sp-conn-end-pair.cpp @@ -220,14 +220,18 @@ SPConnEndPair::update(void) void SPConnEndPair::storeIds(void) { if (_connEnd[0]->href) { - GQuark itemId = g_quark_from_string(_connEnd[0]->href); + // href begins with a '#' which we don't want. + const char *startId = _connEnd[0]->href + 1; + GQuark itemId = g_quark_from_string(startId); _connRef->setEndPointId(Avoid::VertID::src, itemId); } else { _connRef->setEndPointId(Avoid::VertID::src, 0); } if (_connEnd[1]->href) { - GQuark itemId = g_quark_from_string(_connEnd[1]->href); + // href begins with a '#' which we don't want. + const char *endId = _connEnd[1]->href + 1; + GQuark itemId = g_quark_from_string(endId); _connRef->setEndPointId(Avoid::VertID::tar, itemId); } else { -- 2.30.2