From 72f9ed8e6a94b65a3fbc9582179e6e72330ff144 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 19 Aug 2012 01:40:03 +0200 Subject: Added "virtual pad" to SPGroup and SPSwitch. There was some weird try by someone else. SPGroup should work as expected, SPSwitch may still be buggy. (bzr r11608.1.16) --- src/sp-conn-end-pair.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-conn-end-pair.cpp') diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp index 17e9e7397..05495477b 100644 --- a/src/sp-conn-end-pair.cpp +++ b/src/sp-conn-end-pair.cpp @@ -203,7 +203,7 @@ SPConnEndPair::getAttachedItems(SPItem *h2attItem[2]) const { // 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) { + if (SP_GROUP(h2attItem[h])->getItemCount() == 0) { // This group is empty, so detach. sp_conn_end_detach(_path, h); h2attItem[h] = NULL; -- cgit v1.2.3 From 2f4efa8a787d175807a40b5bbafb1197e4dcc318 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 30 Nov 2012 14:22:44 -0500 Subject: Step 1. Remove junk and keep functionality. (bzr r11894.1.1) --- src/sp-conn-end-pair.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/sp-conn-end-pair.cpp') diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp index 17e9e7397..8e89b28fb 100644 --- a/src/sp-conn-end-pair.cpp +++ b/src/sp-conn-end-pair.cpp @@ -82,9 +82,7 @@ sp_conn_end_pair_build(SPObject *object) { object->readAttr( "inkscape:connector-type" ); object->readAttr( "inkscape:connection-start" ); - object->readAttr( "inkscape:connection-start-point" ); object->readAttr( "inkscape:connection-end" ); - object->readAttr( "inkscape:connection-end-point" ); object->readAttr( "inkscape:connector-curvature" ); } @@ -164,10 +162,6 @@ SPConnEndPair::setAttr(unsigned const key, gchar const *const value) case SP_ATTR_CONNECTION_END: this->_connEnd[(key == SP_ATTR_CONNECTION_START ? 0 : 1)]->setAttacherHref(value, _path); break; - case SP_ATTR_CONNECTION_START_POINT: - case SP_ATTR_CONNECTION_END_POINT: - this->_connEnd[(key == SP_ATTR_CONNECTION_START_POINT ? 0 : 1)]->setAttacherEndpoint(value, _path); - break; } } @@ -175,15 +169,10 @@ SPConnEndPair::setAttr(unsigned const key, gchar const *const value) void SPConnEndPair::writeRepr(Inkscape::XML::Node *const repr) const { - char const * const attr_strs[] = {"inkscape:connection-start", "inkscape:connection-start-point", - "inkscape:connection-end", "inkscape:connection-end-point"}; + char const * const attr_strs[] = {"inkscape:connection-start", "inkscape:connection-end"}; for (unsigned handle_ix = 0; handle_ix < 2; ++handle_ix) { if (this->_connEnd[handle_ix]->ref.getURI()) { - repr->setAttribute(attr_strs[2*handle_ix], this->_connEnd[handle_ix]->ref.getURI()->toString()); - std::ostringstream ostr; - ostr<<(this->_connEnd[handle_ix]->type == ConnPointDefault ? "d":"u") << - this->_connEnd[handle_ix]->id; - repr->setAttribute(attr_strs[2*handle_ix+1], ostr.str().c_str()); + repr->setAttribute(attr_strs[handle_ix], this->_connEnd[handle_ix]->ref.getURI()->toString()); } } repr->setAttribute("inkscape:connector-curvature", Glib::Ascii::dtostr(_connCurvature).c_str()); @@ -222,7 +211,7 @@ void SPConnEndPair::getEndpoints(Geom::Point endPts[]) const for (unsigned h = 0; h < 2; ++h) { if ( h2attItem[h] ) { g_assert(h2attItem[h]->avoidRef); - endPts[h] = h2attItem[h]->avoidRef->getConnectionPointPos(_connEnd[h]->type, _connEnd[h]->id); + endPts[h] = h2attItem[h]->avoidRef->getConnectionPointPos(); } else if (!curve->is_empty()) { -- cgit v1.2.3 From ad5c6ceab1420aabbe4c751080bce8b2363abd11 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Mon, 3 Mar 2014 22:44:59 +0100 Subject: More memory leak fixes (Bug #1275170) (bzr r13105) --- src/sp-conn-end-pair.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/sp-conn-end-pair.cpp') diff --git a/src/sp-conn-end-pair.cpp b/src/sp-conn-end-pair.cpp index 52a421550..dbd4f2e94 100644 --- a/src/sp-conn-end-pair.cpp +++ b/src/sp-conn-end-pair.cpp @@ -171,8 +171,11 @@ SPConnEndPair::writeRepr(Inkscape::XML::Node *const repr) const { char const * const attr_strs[] = {"inkscape:connection-start", "inkscape:connection-end"}; for (unsigned handle_ix = 0; handle_ix < 2; ++handle_ix) { - if (this->_connEnd[handle_ix]->ref.getURI()) { - repr->setAttribute(attr_strs[handle_ix], this->_connEnd[handle_ix]->ref.getURI()->toString()); + const Inkscape::URI* U = this->_connEnd[handle_ix]->ref.getURI(); + if (U) { + gchar *str = U->toString(); + repr->setAttribute(attr_strs[handle_ix], str); + g_free(str); } } repr->setAttribute("inkscape:connector-curvature", Glib::Ascii::dtostr(_connCurvature).c_str()); -- cgit v1.2.3