Remove unused flags from document_search_bar_find()

Passed-in flags was always 0, so the argument is not useful.
Also, this function expected Scintilla search flags rather than Geany
ones, making the API confusing for no good reason.
This commit is contained in:
Colomban Wendling 2014-08-19 03:40:52 +02:00
parent 8812e39e2e
commit bdc0f720e7
3 changed files with 6 additions and 6 deletions

View File

@ -442,7 +442,7 @@ static void do_toolbar_search(const gchar *text, gboolean incremental, gboolean
gboolean result;
setup_find(text, backwards);
result = document_search_bar_find(doc, search_data.text, 0, incremental, backwards);
result = document_search_bar_find(doc, search_data.text, incremental, backwards);
if (search_data.search_bar)
ui_set_search_entry_background(toolbar_get_widget_child_by_name("SearchEntry"), result);
}
@ -474,7 +474,7 @@ void on_toolbutton_search_clicked(GtkAction *action, gpointer user_data)
const gchar *text = gtk_entry_get_text(GTK_ENTRY(entry));
setup_find(text, FALSE);
result = document_search_bar_find(doc, search_data.text, 0, FALSE, FALSE);
result = document_search_bar_find(doc, search_data.text, FALSE, FALSE);
if (search_data.search_bar)
ui_set_search_entry_background(entry, result);
}

View File

@ -1956,7 +1956,7 @@ gboolean document_save_file(GeanyDocument *doc, gboolean force)
/* special search function, used from the find entry in the toolbar
* return TRUE if text was found otherwise FALSE
* return also TRUE if text is empty */
gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gint flags, gboolean inc,
gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gboolean inc,
gboolean backwards)
{
gint start_pos, search_pos;
@ -1974,7 +1974,7 @@ gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gint fl
ttf.chrg.cpMin = start_pos;
ttf.chrg.cpMax = backwards ? 0 : sci_get_length(doc->editor->sci);
ttf.lpstrText = (gchar *)text;
search_pos = sci_find_text(doc->editor->sci, flags, &ttf);
search_pos = sci_find_text(doc->editor->sci, 0, &ttf);
/* if no match, search start (or end) to cursor */
if (search_pos == -1)
@ -1989,7 +1989,7 @@ gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gint fl
ttf.chrg.cpMin = 0;
ttf.chrg.cpMax = start_pos + strlen(text);
}
search_pos = sci_find_text(doc->editor->sci, flags, &ttf);
search_pos = sci_find_text(doc->editor->sci, 0, &ttf);
}
if (search_pos != -1)

View File

@ -238,7 +238,7 @@ void document_open_file_list(const gchar *data, gsize length);
void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft,
const gchar *forced_enc);
gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gint flags, gboolean inc,
gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gboolean inc,
gboolean backwards);
gint document_find_text(GeanyDocument *doc, const gchar *text, const gchar *original_text,