Revision 3177

View differences:

src/textview.c
249 249
static gboolean textview_uri_security_check	(TextView	*textview,
250 250
						 RemoteURI	*uri);
251 251
static void textview_uri_list_remove_all	(GSList		*uri_list);
252
static void textview_uri_list_update_offsets	(TextView	*textview,
253
						 gint		 start,
254
						 gint		 add);
252 255

  
253 256

  
254 257
TextView *textview_create(void)
......
509 512

  
510 513
		gtk_text_buffer_get_end_iter(buffer, &iter);
511 514
		textview->body_pos = gtk_text_iter_get_offset(&iter);
515
		debug_print("textview_show_message: body_pos: %d\n",
516
			    textview->body_pos);
512 517
	} else {
513 518
		gtk_text_buffer_get_end_iter(buffer, &iter);
514 519
		mark = gtk_text_buffer_get_mark(buffer, "attach-file-pos");
......
627 632

  
628 633
		gtk_text_buffer_get_end_iter(buffer, &iter);
629 634
		textview->body_pos = gtk_text_iter_get_offset(&iter);
635
		debug_print("textview_show_part: body_pos: %d\n",
636
			    textview->body_pos);
630 637
		if (!mimeinfo->main)
631 638
			gtk_text_buffer_insert(buffer, &iter, "\n", 1);
632 639
	} else {
......
1045 1052
			g_free(filename);
1046 1053
		} else if (prefs_common.show_attached_files_first) {
1047 1054
			gint count;
1055
			gint prev_pos, new_pos;
1048 1056

  
1049 1057
			mark = gtk_text_buffer_get_mark(buffer, "attach-file-pos");
1050 1058

  
1051 1059
			gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
1060
			prev_pos = gtk_text_iter_get_offset(&iter);
1052 1061
			count = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mark), "attach-file-count"));
1053 1062
			if (count == 0) {
1054 1063
				textview_insert_pad(textview, &iter, 4);
......
1056 1065
			}
1057 1066
			textview_add_part_widget(textview, &iter, mimeinfo, buf);
1058 1067
			gtk_text_buffer_move_mark(buffer, mark, &iter);
1068
			new_pos = gtk_text_iter_get_offset(&iter);
1069
			textview_uri_list_update_offsets(textview, new_pos, new_pos - prev_pos);
1059 1070
			g_object_set_data(G_OBJECT(mark), "attach-file-count", GINT_TO_POINTER(count + 1));
1060 1071
			gtk_text_buffer_get_end_iter(buffer, &iter);
1061 1072
		} else {
......
2202 2213
		RemoteURI *uri_ = (RemoteURI *)cur->data;
2203 2214

  
2204 2215
		if (start_pos == uri_->start && end_pos == uri_->end) {
2216
			debug_print("uri found: (%d, %d): %s\n",
2217
				    start_pos, end_pos, uri_->uri);
2205 2218
			uri = uri_;
2206 2219
			break;
2207 2220
		}
......
2700 2713

  
2701 2714
	g_slist_free(uri_list);
2702 2715
}
2716

  
2717
static void textview_uri_list_update_offsets(TextView *textview, gint start, gint add)
2718
{
2719
	GSList *cur;
2720

  
2721
	debug_print("textview_uri_list_update_offsets: from %d: add %d\n", start, add);
2722

  
2723
	for (cur = textview->uri_list; cur != NULL; cur = cur->next) {
2724
		RemoteURI *uri = (RemoteURI *)cur->data;
2725

  
2726
		if (uri->start >= start) {
2727
			debug_print("textview_uri_list_update_offsets: update: (%d, %d) -> (%d, %d)\n", uri->start, uri->end, uri->start + add, uri->end + add);
2728
			uri->start += add;
2729
			uri->end += add;
2730
		}
2731
	}
2732
}
NEWS
1 1
Changes of Sylpheed
2 2

  
3
* 3.3.0rc (release candidate)
4

  
5
    * The Japanese manual was updated.
6
    * The bug that hyperlinks did not respond when 'Show attached files
7
      first on message view' option was set was fixed.
8
    * Some compilation fixes were made.
9
    * Win32: .eml file association was added to installer.
10
    * Win32: mailto and .eml association are automatically set to default
11
      on Windows 7 on installation.
12

  
3 13
* 3.3.0beta2 (development)
4 14

  
5 15
    * The ability of opening external rfc822 format message files (.eml) was
ChangeLog
1
2012-10-29
2

  
3
	* src/textview.c: fixed hyperlink when 'Show attached files first on
4
	  message view' option was set ([sylpheed:35477]).
5

  
1 6
2012-10-12
2 7

  
3 8
	* libsylph/imap.c: fixed MSVC compilation (thanks to Gisle Vanem).

Also available in: Unified diff