aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/Tabular.c18
-rw-r--r--generic/Track.c24
2 files changed, 28 insertions, 14 deletions
diff --git a/generic/Tabular.c b/generic/Tabular.c
index 009576f..eed5c41 100644
--- a/generic/Tabular.c
+++ b/generic/Tabular.c
@@ -125,7 +125,7 @@ Init(Item item,
tab->connection_anchor = ZnAnchorSW;
tab->pos.x = tab->pos.y = 0.0;
- field_set->wi = wi;
+ field_set->item = item;
field_set->label_format = NULL;
/*
@@ -318,7 +318,7 @@ ToArea(Item item,
static void
Draw(Item item)
{
- FIELD.DrawFields(&((TabularItem) item)->field_set, item);
+ FIELD.DrawFields(&((TabularItem) item)->field_set);
}
@@ -332,7 +332,7 @@ Draw(Item item)
static void
Render(Item item)
{
- FIELD.RenderFields(&((TabularItem) item)->field_set, item);
+ FIELD.RenderFields(&((TabularItem) item)->field_set);
}
@@ -579,7 +579,7 @@ Index(Item item,
int *index)
{
return FIELD.FieldIndex(&((TabularItem) item)->field_set, field,
- item, index_spec, index);
+ index_spec, index);
}
@@ -596,7 +596,10 @@ InsertChars(Item item,
int *index,
char *chars)
{
- FIELD.FieldInsertChars(&((TabularItem) item)->field_set, field, index, chars);
+ if (FIELD.FieldInsertChars(&((TabularItem) item)->field_set,
+ field, index, chars)) {
+ ITEM.Invalidate(item, ZN_COORDS_FLAG);
+ }
}
@@ -613,7 +616,10 @@ DeleteChars(Item item,
int *first,
int *last)
{
- FIELD.FieldDeleteChars(&((TabularItem) item)->field_set, field, first, last);
+ if (FIELD.FieldDeleteChars(&((TabularItem) item)->field_set,
+ field, first, last)) {
+ ITEM.Invalidate(item, ZN_COORDS_FLAG);
+ }
}
diff --git a/generic/Track.c b/generic/Track.c
index e7ebc6b..14c3de2 100644
--- a/generic/Track.c
+++ b/generic/Track.c
@@ -415,7 +415,7 @@ Init(Item item,
track->speed_vector.x = 0.0;
track->speed_vector.y = 10.0;
}
- field_set->wi = wi;
+ field_set->item = item;
field_set->label_format = NULL;
/*
* Then try to see if some fields are needed.
@@ -1264,7 +1264,7 @@ Draw(Item item)
/*
* Draw the label.
*/
- FIELD.DrawFields(&track->field_set, item);
+ FIELD.DrawFields(&track->field_set);
}
@@ -1525,7 +1525,7 @@ Render(Item item)
/*
* Render the label.
*/
- FIELD.RenderFields(&track->field_set, item);
+ FIELD.RenderFields(&track->field_set);
#endif
}
@@ -2099,10 +2099,10 @@ Part(Item item,
*part_spec = Tcl_NewIntObj(*part);
}
else {
+ part_str = "";
switch (*part) {
default:
case ZN_NO_PART:
- part_str = "";
break;
case CURRENT_POSITION:
part_str = "position";
@@ -2119,7 +2119,9 @@ Part(Item item,
break;
}
}
- *part_spec = NewStringObj(part_str);
+ if (part_str[0]) {
+ *part_spec = NewStringObj(part_str);
+ }
}
}
return ZN_OK;
@@ -2142,7 +2144,7 @@ Index(Item item,
int *index)
{
return FIELD.FieldIndex(&((TrackItem) item)->field_set, field,
- item, index_spec, index);
+ index_spec, index);
}
@@ -2159,7 +2161,10 @@ InsertChars(Item item,
int *index,
char *chars)
{
- FIELD.FieldInsertChars(&((TrackItem) item)->field_set, field, index, chars);
+ if (FIELD.FieldInsertChars(&((TrackItem) item)->field_set,
+ field, index, chars)) {
+ ITEM.Invalidate(item, ZN_COORDS_FLAG);
+ }
}
@@ -2176,7 +2181,10 @@ DeleteChars(Item item,
int *first,
int *last)
{
- FIELD.FieldDeleteChars(&((TrackItem) item)->field_set, field, first, last);
+ if (FIELD.FieldDeleteChars(&((TrackItem) item)->field_set,
+ field, first, last)) {
+ ITEM.Invalidate(item, ZN_COORDS_FLAG);
+ }
}