aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-02-02 07:37:47 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-02-02 07:37:47 +0000
commit42da7f35774533ed6f47d47bf885724883b33890 (patch)
tree68d9151d342dfdcf12c113a6aa078015e064bac8 /src/compose.c
parent8ad7e4e7c796b1cd12513576eb3481be7d706b6a (diff)
compose.c::get_indent_length() use GtkTextIter for the loop.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@72 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compose.c b/src/compose.c
index 1c057c92..e36ecfc5 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -1992,18 +1992,18 @@ typedef enum {
static guint get_indent_length(GtkTextBuffer *textbuf, guint start_pos,
guint text_len)
{
+ GtkTextIter iter;
guint i_len = 0;
- guint i, ch_len, alnum_cnt = 0;
+ guint ch_len, alnum_cnt = 0;
IndentState state = WAIT_FOR_INDENT_CHAR;
gchar cbuf[CHAR_BUF_SIZE];
gboolean is_space;
gboolean is_indent;
+ gboolean iter_next = TRUE;
-#warning FIXME_GTK2 use GtkTextIter
- for (i = start_pos; i < text_len; i++) {
- GtkTextIter iter;
+ gtk_text_buffer_get_iter_at_offset(textbuf, &iter, start_pos);
- gtk_text_buffer_get_iter_at_offset(textbuf, &iter, i);
+ while (iter_next == TRUE) {
GET_CHAR(&iter, cbuf, ch_len);
if (ch_len > 1)
break;
@@ -2048,6 +2048,7 @@ static guint get_indent_length(GtkTextBuffer *textbuf, guint start_pos,
}
i_len++;
+ iter_next = gtk_text_iter_forward_char(&iter);
}
out: