summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosh Andler <scislac@gmail.com>2010-08-13 14:54:19 +0000
committerJosh Andler <scislac@gmail.com>2010-08-13 14:54:19 +0000
commitd6d599ea50b5b7b5b0a8390db04f7271cebfebc0 (patch)
treeb6fab38bb17a2f02bb19a047bf8403edac9bcac4 /src
parentTranslations. Romanian translation update by Cristian Secară. (diff)
downloadinkscape-d6d599ea50b5b7b5b0a8390db04f7271cebfebc0.tar.gz
inkscape-d6d599ea50b5b7b5b0a8390db04f7271cebfebc0.zip
Revs 9706-9709 from trunk to fix Uniconvertor and 3 connector crashes
(bzr r9606.1.48)
Diffstat (limited to 'src')
-rw-r--r--src/conn-avoid-ref.cpp7
-rw-r--r--src/connector-context.cpp33
2 files changed, 30 insertions, 10 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index 88c84a84c..a918f8745 100644
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -63,8 +63,8 @@ SPAvoidRef::~SPAvoidRef()
const bool routerInstanceExists = (item->document->router != NULL);
if (shapeRef && routerInstanceExists) {
- Router *router = shapeRef->router();
- router->removeShape(shapeRef);
+ // Deleting the shapeRef will remove it completely from
+ // an existing Router instance.
delete shapeRef;
}
shapeRef = NULL;
@@ -329,7 +329,8 @@ void SPAvoidRef::handleSettingChange(void)
{
g_assert(shapeRef);
- router->removeShape(shapeRef);
+ // Deleting the shapeRef will remove it completely from
+ // an existing Router instance.
delete shapeRef;
shapeRef = NULL;
}
diff --git a/src/connector-context.cpp b/src/connector-context.cpp
index b0e192190..f7d18a33f 100644
--- a/src/connector-context.cpp
+++ b/src/connector-context.cpp
@@ -1756,12 +1756,22 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item)
if (cc->active_conn == item)
{
- // Just adjust handle positions.
- Geom::Point startpt = *(curve->first_point()) * i2d;
- sp_knot_set_position(cc->endpt_handle[0], startpt, 0);
+ if (curve->is_empty())
+ {
+ // Connector is invisible because it is clipped to the boundary of
+ // two overlpapping shapes.
+ sp_knot_hide(cc->endpt_handle[0]);
+ sp_knot_hide(cc->endpt_handle[1]);
+ }
+ else
+ {
+ // Just adjust handle positions.
+ Geom::Point startpt = *(curve->first_point()) * i2d;
+ sp_knot_set_position(cc->endpt_handle[0], startpt, 0);
- Geom::Point endpt = *(curve->last_point()) * i2d;
- sp_knot_set_position(cc->endpt_handle[1], endpt, 0);
+ Geom::Point endpt = *(curve->last_point()) * i2d;
+ sp_knot_set_position(cc->endpt_handle[1], endpt, 0);
+ }
return;
}
@@ -1824,6 +1834,13 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item)
G_CALLBACK(endpt_handler), cc);
}
+ if (curve->is_empty())
+ {
+ // Connector is invisible because it is clipped to the boundary
+ // of two overlpapping shapes. So, it doesn't need endpoints.
+ return;
+ }
+
Geom::Point startpt = *(curve->first_point()) * i2d;
sp_knot_set_position(cc->endpt_handle[0], startpt, 0);
@@ -1887,8 +1904,10 @@ static bool cc_item_is_shape(SPItem *item)
bool cc_item_is_connector(SPItem *item)
{
if (SP_IS_PATH(item)) {
- if (SP_PATH(item)->connEndPair.isAutoRoutingConn()) {
- g_assert( SP_PATH(item)->original_curve ? !(SP_PATH(item)->original_curve->is_closed()) : !(SP_PATH(item)->curve->is_closed()) );
+ bool closed = SP_PATH(item)->original_curve ? SP_PATH(item)->original_curve->is_closed() : SP_PATH(item)->curve->is_closed();
+ if (SP_PATH(item)->connEndPair.isAutoRoutingConn() && !closed) {
+ // To be considered a connector, an object must be a non-closed
+ // path that is marked with a "inkscape:connector-type" attribute.
return true;
}
}