draw: remove useless vars

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-09-02 14:03:27 +02:00
parent 022879e8be
commit a5397fd724
1 changed files with 5 additions and 10 deletions

View File

@ -308,7 +308,6 @@ draw_text_markup_expand(draw_parser_data_t *data,
.priv = data, .priv = data,
.on_element = &draw_markup_on_element, .on_element = &draw_markup_on_element,
}; };
char *text = NULL;
GError *error = NULL; GError *error = NULL;
bool ret = false; bool ret = false;
@ -317,7 +316,7 @@ draw_text_markup_expand(draw_parser_data_t *data,
if(!markup_parse(&p, str, slen)) if(!markup_parse(&p, str, slen))
goto bailout; goto bailout;
if(!pango_parse_markup(p.text.s, p.text.len, 0, &data->attr_list, &text, NULL, &error)) if(!pango_parse_markup(p.text.s, p.text.len, 0, &data->attr_list, &data->text, NULL, &error))
{ {
warn("cannot parse pango markup: %s", error ? error->message : "unknown error"); warn("cannot parse pango markup: %s", error ? error->message : "unknown error");
if(error) if(error)
@ -325,9 +324,7 @@ draw_text_markup_expand(draw_parser_data_t *data,
goto bailout; goto bailout;
} }
/* stole text */ data->len = a_strlen(data->text);
data->text = text;
data->len = a_strlen(text);
ret = true; ret = true;
bailout: bailout:
@ -1032,11 +1029,9 @@ draw_text_extents(xcb_connection_t *conn, int phys_screen, font_t *font,
parser_data->connection = conn; parser_data->connection = conn;
parser_data->phys_screen = phys_screen; parser_data->phys_screen = phys_screen;
if(draw_text_markup_expand(parser_data, text, len))
{ if(!draw_text_markup_expand(parser_data, text, len))
text = parser_data->text; return geom;
len = parser_data->len;
}
surface = cairo_xcb_surface_create(conn, phys_screen, surface = cairo_xcb_surface_create(conn, phys_screen,
draw_screen_default_visual(s), draw_screen_default_visual(s),