summaryrefslogtreecommitdiffstats
path: root/src/libcola/straightener.cpp
diff options
context:
space:
mode:
authorAndrew Higginson <at.higginson@gmail.com>2011-12-27 21:04:47 +0000
committerAndrew <at.higginson@gmail.com>2011-12-27 21:04:47 +0000
commit80960b623a99aae1402ab651b2974ef544ed3b03 (patch)
treeba49d42c2789e9e11f805e2d5263e10f9fedeef8 /src/libcola/straightener.cpp
parenttry to fix bug (diff)
parentGDL: Cherry-pick upstream patch 73852 (2011-03-23) - Add missing return value. (diff)
downloadinkscape-80960b623a99aae1402ab651b2974ef544ed3b03.tar.gz
inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.zip
merged with trunk so I can build again...
(bzr r10092.1.36)
Diffstat (limited to 'src/libcola/straightener.cpp')
-rw-r--r--src/libcola/straightener.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcola/straightener.cpp b/src/libcola/straightener.cpp
index e237c03c3..0ecd82faa 100644
--- a/src/libcola/straightener.cpp
+++ b/src/libcola/straightener.cpp
@@ -3,8 +3,10 @@
** vim: ts=4 sw=4 et tw=0 wm=0
*/
/**
- * \brief Functions to automatically generate constraints for the
+ * Functions to automatically generate constraints for the
* rectangular node overlap removal problem.
+ */
+/*
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
@@ -25,6 +27,8 @@
using std::set;
using std::vector;
using std::list;
+using std::pair;
+using std::make_pair;
namespace straightener {
@@ -108,7 +112,7 @@ namespace straightener {
int compare_events(const void *a, const void *b) {
Event *ea=*(Event**)a;
Event *eb=*(Event**)b;
- if(ea->v!=NULL&&ea->v==eb->v||ea->e!=NULL&&ea->e==eb->e) {
+ if((ea->v!=NULL&&ea->v==eb->v)||(ea->e!=NULL&&ea->e==eb->e)) {
// when comparing opening and closing from object
// open must come first
if(ea->type==Open) return -1;
@@ -263,8 +267,8 @@ namespace straightener {
// node is on an edge
Edge *edge=(*i)->edge;
if(!edge->isEnd(v->id)
- &&(l!=NULL&&!edge->isEnd(l->id)||l==NULL)
- &&(r!=NULL&&!edge->isEnd(r->id)||r==NULL)) {
+ &&((l!=NULL&&!edge->isEnd(l->id))||l==NULL)
+ &&((r!=NULL&&!edge->isEnd(r->id))||r==NULL)) {
if(lastNode!=NULL) {
//printf(" Rule A: Constraint: v%d +g <= v%d\n",lastNode->id,(*i)->id);
cs.push_back(createConstraint(lastNode,*i,dim));