Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Tue, 19 Aug 2014 01:40:52 UTC Commit: bdc0f720e7509ca3fcd65b0c3dab051f1efc9a53 https://github.com/geany/geany/commit/bdc0f720e7509ca3fcd65b0c3dab051f1efc9a...
Log Message: ----------- 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.
Modified Paths: -------------- src/callbacks.c src/document.c src/document.h
Modified: src/callbacks.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -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); }
Modified: src/document.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -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)
Modified: src/document.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -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,
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).