[gtksourceview] Fix annotation and test for find and replace.



commit a4df524f4c4fe61c58037089542d803a9c1c59c6
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jun 23 13:45:01 2010 +0200

    Fix annotation and test for find and replace.

 gtksourceview/gtksourceiter.c |    8 ++++----
 tests/test-widget.py          |   15 +++++++--------
 2 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/gtksourceview/gtksourceiter.c b/gtksourceview/gtksourceiter.c
index 0f1ad7b..4c3d853 100644
--- a/gtksourceview/gtksourceiter.c
+++ b/gtksourceview/gtksourceiter.c
@@ -572,8 +572,8 @@ breakup_string (const char *string,
  * @iter: start of search.
  * @str: a search string.
  * @flags: flags affecting how the search is done.
- * @match_start: (out) (allow-none): return location for start of match, or %NULL.
- * @match_end: (out) (allow-none): return location for end of match, or %NULL.
+ * @match_start: (out caller-allocates) (allow-none): return location for start of match, or %NULL.
+ * @match_end: (out caller-allocates) (allow-none): return location for end of match, or %NULL.
  * @limit: (allow-none): bound for the search, or %NULL for the end of the buffer.
  *
  * Searches forward for @str. Any match is returned by setting
@@ -692,8 +692,8 @@ gtk_source_iter_forward_search (const GtkTextIter   *iter,
  * @iter: a #GtkTextIter where the search begins.
  * @str: search string.
  * @flags: bitmask of flags affecting the search.
- * @match_start: (out) (allow-none) return location for start of match, or %NULL.
- * @match_end: (out) (allow-none): return location for end of match, or %NULL.
+ * @match_start: (out caller-allocates) (allow-none) return location for start of match, or %NULL.
+ * @match_end: (out caller-allocates) (allow-none): return location for end of match, or %NULL.
  * @limit: (allow-none): location of last possible @match_start, or %NULL for start of buffer.
  *
  * Same as gtk_text_iter_backward_search(), but supports case insensitive
diff --git a/tests/test-widget.py b/tests/test-widget.py
index afbff8d..7fe69ea 100644
--- a/tests/test-widget.py
+++ b/tests/test-widget.py
@@ -371,16 +371,16 @@ class Window(Gtk.Window):
         if dialog.run_search():
             i = self._buf.get_iter_at_mark(self._buf.get_insert())
 
-            searched, start, end = i.forward_search(dialog.get_search_text(),
-                                                    search_flags, None)
+            searched, start, end = GtkSource.iter_forward_search(i, dialog.get_search_text(),
+                                                                 search_flags, None)
             if searched:
                 self._buf.select_range(start, end)
             else:
                 end = i
                 i = self._buf.get_start_iter()
 
-                searched, start, end = i.forward_search(dialog.get_search_text(),
-                                                        search_flags, end)
+                searched, start, end = GtkSource.iter_forward_search(i, dialog.get_search_text(),
+                                                                     search_flags, end)
                 if searched:
                     self._buf.select_range(start, end)
 
@@ -395,15 +395,14 @@ class Window(Gtk.Window):
         i = self._buf.get_start_iter()
 
         while True:
-            searched, start, end = i.forward_search(dialog.get_search_text(),
-                                                    search_flags, None)
+            searched, start, end = GtkSource.iter_forward_search(i, dialog.get_search_text(),
+                                                                 search_flags, None)
 
             if not searched:
                 break
 
             self._buf.delete(start, end)
-            # FIXME
-            #self._buf.insert(start, dialog.get_replace_text(), -1)
+            self._buf.insert(start, dialog.get_replace_text())
             i = start
 
     def quit_cb(self, action):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]