Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8913 → Rev 8912

/programs/cmm/quark/prepare_page.h
9,6 → 9,8
{
dword ptr;
int line_end;
dword line_length = 0;
dword line_start = textbuf.p;
 
list.count=0;
selection.cancel();
19,24 → 21,21
 
for (ptr = textbuf.p; ptr < textbuf.p + textbuf.len; ptr++)
{
if (ptr - lines.get_last() * list.font_w + 16 >= list.w)
line_length += list.font_w;
if (line_length + 30 >= list.w) || (ESBYTE[ptr] == '\n')
{
//if (ESBYTE[ptr+1] == '\r') ptr++;
//searching a 'white' for a normal word-break
for(line_end = ptr; line_end != lines.get_last(); line_end--) {
if (__isWhite(ESBYTE[line_end])) {
ptr = line_end + 1;
break;
for(line_end = ptr; line_end != line_start; line_end--)
{
if (__isWhite(ESBYTE[line_end])) { ptr=line_end+1; break; }
}
}
line_length = ptr - line_start * list.font_w;
list.count++;
lines.add(ptr);
} else if (ESBYTE[ptr] == '\x0D') {
if (ESBYTE[ptr+1] == '\x0A') ptr++;
list.count++;
lines.add(ptr+1);
} else if (ESBYTE[ptr] == '\x0A') {
list.count++;
lines.add(ptr+1);
line_start = ptr;
line_length = 0;
}
}
lines.add(ptr);