From d5fb49645b11b52509bc95bbe747c18387adc394 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Thu, 8 Sep 2011 01:40:17 -0700 Subject: [PATCH 2/3] searching (and finding) hidden text no longer produces random results by looking at uninitialized data Signed-off-by: Dima Kogan --- gschem/src/o_misc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c index 49b7161..01e0596 100644 --- a/gschem/src/o_misc.c +++ b/gschem/src/o_misc.c @@ -416,13 +416,15 @@ int o_edit_find_text (GSCHEM_TOPLEVEL *w_current, const GList *o_list, } } - if (o_current->type == OBJ_TEXT) { + if (o_current->type == OBJ_TEXT && + (o_is_visible (toplevel, o_current) || toplevel->show_hidden_text)) { + const gchar *str = o_text_get_string (toplevel, o_current); /* replaced strcmp with strstr to simplify the search */ if (strstr (str,stext)) { if (!skiplast) { a_zoom(w_current, ZOOM_FULL, DONTCARE, A_PAN_DONT_REDRAW); - world_get_single_object_bounds (toplevel, o_current, &x1, &y1, &x2, &y2); + g_assert( world_get_single_object_bounds (toplevel, o_current, &x1, &y1, &x2, &y2) ); text_screen_height = SCREENabs (w_current, y2 - y1); /* this code will zoom/pan till the text screen height is about */ /* 50 pixels high, perhaps a future enhancement will be to make */ -- 1.7.5.4