summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-03-17 13:33:47 +0100
committerDave Davenport <qball@gmpclient.org>2017-03-17 13:33:47 +0100
commitdfeb5940d4c447bb5c71104726ab416a04e6bfb4 (patch)
tree93fd22032780e42f81b302c0b536376e630cfda7 /source
parent000c1139254857fb944e3ad6c6bd06dc4b07f034 (diff)
Reduce scope and unneeded check.
Diffstat (limited to 'source')
-rw-r--r--source/dialogs/drun.c2
-rw-r--r--source/widgets/textbox.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c
index 2acc2593..ed7e5b51 100644
--- a/source/dialogs/drun.c
+++ b/source/dialogs/drun.c
@@ -514,7 +514,7 @@ static int drun_token_match ( const Mode *data, GRegex **tokens, unsigned int in
int test = 0;
GRegex *ftokens[2] = { tokens[j], NULL };
// Match name
- if ( !test && rmpd->entry_list[index].name &&
+ if ( rmpd->entry_list[index].name &&
helper_token_match ( ftokens, rmpd->entry_list[index].name ) ) {
test = 1;
}
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c
index 0f2d95ee..77d7ef28 100644
--- a/source/widgets/textbox.c
+++ b/source/widgets/textbox.c
@@ -333,8 +333,6 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
textbox *tb = (textbox *) wid;
unsigned int offset = ( tb->flags & TB_INDICATOR ) ? DOT_OFFSET : 0;
- int cursor_x = 0;
- int cursor_y = 0;
if ( tb->changed ) {
__textbox_update_pango_text ( tb );
@@ -371,8 +369,8 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
// convert to byte location.
char *offset = g_utf8_offset_to_pointer ( text, cursor_offset );
pango_layout_get_cursor_pos ( tb->layout, offset - text, &pos, NULL );
- cursor_x = pos.x / PANGO_SCALE;
- cursor_y = pos.y / PANGO_SCALE;
+ int cursor_x = pos.x / PANGO_SCALE;
+ int cursor_y = pos.y / PANGO_SCALE;
int cursor_height = pos.height / PANGO_SCALE;
int cursor_width = 2;
cairo_rectangle ( draw, x + cursor_x, y + cursor_y, cursor_width, cursor_height );