Skip to content

Commit 20e4b25

Browse files
lightdarkgreenvkareh
authored andcommitted
baobab-chart: Avoid implicit cast and unneeded variable
1 parent 5b40c1c commit 20e4b25

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

baobab/src/baobab-chart.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ struct _BaobabChartPrivate
7373
GList *first_item;
7474
GList *last_item;
7575
GList *highlighted_item;
76-
GList *tooltip_item;
7776
};
7877

7978
/* Signals */
@@ -260,7 +259,6 @@ baobab_chart_init (BaobabChart *chart)
260259
priv->first_item = NULL;
261260
priv->last_item = NULL;
262261
priv->highlighted_item = NULL;
263-
priv->tooltip_item = NULL;
264262
}
265263

266264
static void
@@ -1003,8 +1001,8 @@ baobab_chart_set_item_highlight (GtkWidget *chart,
10031001

10041002
static void
10051003
baobab_chart_highlight_item_at_position (GtkWidget *widget,
1006-
gint x,
1007-
gint y)
1004+
gdouble x,
1005+
gdouble y)
10081006
{
10091007
BaobabChartPrivate *priv;
10101008
BaobabChartClass *class;
@@ -1050,15 +1048,9 @@ static gint
10501048
baobab_chart_motion_notify (GtkWidget *widget,
10511049
GdkEventMotion *event)
10521050
{
1053-
BaobabChartPrivate *priv;
1054-
10551051
/* Highlight any item the pointer is over */
10561052
baobab_chart_highlight_item_at_position (widget, event->x, event->y);
10571053

1058-
/* Set the tooltip item to the highlighted item, if any */
1059-
priv = BAOBAB_CHART (widget)->priv;
1060-
priv->tooltip_item = priv->highlighted_item;
1061-
10621054
/* Continue receiving motion notifies */
10631055
gdk_event_request_motions (event);
10641056

@@ -1081,15 +1073,9 @@ static gint
10811073
baobab_chart_enter_notify (GtkWidget *widget,
10821074
GdkEventCrossing *event)
10831075
{
1084-
BaobabChartPrivate *priv;
1085-
10861076
/* Highlight any item the pointer is over */
10871077
baobab_chart_highlight_item_at_position (widget, event->x, event->y);
10881078

1089-
/* Set the tooltip item to the highlighted item, if any */
1090-
priv = BAOBAB_CHART (widget)->priv;
1091-
priv->tooltip_item = priv->highlighted_item;
1092-
10931079
return FALSE;
10941080
}
10951081

@@ -1189,10 +1175,10 @@ baobab_chart_query_tooltip (GtkWidget *widget,
11891175

11901176
priv = BAOBAB_CHART (widget)->priv;
11911177

1192-
if (priv->tooltip_item == NULL)
1178+
if (priv->highlighted_item == NULL)
11931179
return FALSE;
11941180

1195-
item = (BaobabChartItem *) priv->tooltip_item->data;
1181+
item = (BaobabChartItem *) priv->highlighted_item->data;
11961182

11971183
if ( (item->name == NULL) || (item->size == NULL) )
11981184
return FALSE;

0 commit comments

Comments
 (0)