src/gtkhtml.c

changeset 1004
c4dc44bbbc18
parent 985
3735b78b55a1
child 1057
0161606a8549
equal deleted inserted replaced
1003:be33487bc33d 1004:c4dc44bbbc18
2960 gdk_text_measure(cfont, text, num) < 0) { 2960 gdk_text_measure(cfont, text, num) < 0) {
2961 int pos = num / 2; 2961 int pos = num / 2;
2962 static int count = 0; 2962 static int count = 0;
2963 count ++; 2963 count ++;
2964 while (pos < num && (!isspace(text[pos]) || text[pos] == '\n')) pos++; 2964 while (pos < num && (!isspace(text[pos]) || text[pos] == '\n')) pos++;
2965 if (pos == num) { 2965 if (pos >= num - 1) {
2966 pos = num/2; 2966 pos = num/2;
2967 while (pos > 0 && (!isspace(text[pos]) || text[pos] == '\n')) pos--; 2967 while (pos > 0 && (!isspace(text[pos]) || text[pos] == '\n')) pos--;
2968 if (!pos) pos = num / 2; 2968 if (!pos) pos = num / 2;
2969 } 2969 }
2970 gtk_html_add_text(html, cfont, fore, back, text, pos + 1, uline, strike, url); 2970 gtk_html_add_text(html, cfont, fore, back, text, pos + 1, uline, strike, url);

mercurial