Skip to content

Commit da30cb7

Browse files
author
sfeam
committed
replace redundant code
1 parent 6fa082e commit da30cb7

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/datafile.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: datafile.c,v 1.355 2017-09-18 22:24:03 sfeam Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: datafile.c,v 1.356 2017-09-18 23:57:33 sfeam Exp $"); }
33
#endif
44

55
/* GNUPLOT - datafile.c */
@@ -116,6 +116,7 @@ static char *RCSid() { return RCSid("$Id: datafile.c,v 1.355 2017-09-18 22:24:03
116116
#include "misc.h"
117117
#include "parse.h"
118118
#include "plot.h"
119+
#include "plot2d.h" /* For reevaluate_plot_title() */
119120
#include "readline.h"
120121
#include "util.h"
121122
#include "breaders.h"
@@ -2862,7 +2863,6 @@ df_set_key_title(struct curve_points *plot)
28622863
&& histogram_opts.type == HT_STACKED_IN_TOWERS) {
28632864
/* In this case it makes no sense to treat key titles in the usual */
28642865
/* way, so we assume that it is supposed to be an xtic label. */
2865-
/* FIXME EAM - This style should default to notitle! */
28662866
double xpos = plot->histogram_sequence + plot->histogram->start;
28672867
add_tic_user(&axis_array[FIRST_X_AXIS], df_key_title, xpos, -1);
28682868
free(df_key_title);
@@ -2872,15 +2872,7 @@ df_set_key_title(struct curve_points *plot)
28722872

28732873
/* What if there was already a title specified? */
28742874
if (df_plot_title_at) {
2875-
struct value a;
2876-
evaluate_inside_using = TRUE;
2877-
evaluate_at(df_plot_title_at, &a);
2878-
evaluate_inside_using = FALSE;
2879-
if (a.type == STRING) {
2880-
free(plot->title);
2881-
plot->title = a.v.string_val;
2882-
} else
2883-
int_warn(NO_CARET, "\ttitle did not evaluate to a string!?\n");
2875+
reevaluate_plot_title(plot);
28842876
return;
28852877
}
28862878

0 commit comments

Comments
 (0)