WebView 1.0 Beta 6: fix new line in <pre> text (ViewSouce), speed optimizations

git-svn-id: svn://kolibrios.org@4726 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2014-03-31 18:01:40 +00:00
parent caaecffc19
commit 9bef1cf48b
2 changed files with 11 additions and 8 deletions

View File

@ -127,6 +127,7 @@ void TWebBrowser::Parse(){
byte ignor_param;
char temp[768];
dword bufpos = bufpointer;
int line_len;
b_text = i_text = u_text = s_text = blq_text = t_html = t_body =
li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab =
@ -165,6 +166,7 @@ void TWebBrowser::Parse(){
chrcat(#line, ' ');
bukva = temp = NULL;
Perenos();
break;
}
case '\9':
if (pre_text) //èíà÷å èä¸ì íà 0x0d
@ -224,7 +226,7 @@ void TWebBrowser::Parse(){
if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
if (!ignor_param) && (bukva <>' ')
{
if (strlen(#tag)<sizeof(tag)) strcat(#tag, #bukva);
if (strlen(#tag)<sizeof(tag)) chrcat(#tag, bukva);
}
else
{
@ -240,7 +242,7 @@ void TWebBrowser::Parse(){
if (strcmp(#tag, "/condition")!=0) break;
}
if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/
if (tagparam) && (strlen(#tagparam) < 4000) GetNextParam();
if (tagparam) GetNextParam();
if (stolbec + strlen(#line) > list.column_max) Perenos();
DrawPage();
@ -251,13 +253,14 @@ void TWebBrowser::Parse(){
default:
DEFAULT_MARK:
if (bukva<=15) bukva=' ';
line_len = strlen(#line);
if (!pre_text) && (bukva == ' ')
{
if (line[strlen(#line)-1]==' ') break; //óáğàòü 2 ïğîáåëà ïîäğÿä
if (!stolbec) && (!line) break; //ñòğîêà íå ìîæåò íà÷èíàòüñÿ ñ ïğîáåëà
if (line[line_len-1]==' ') break; //no double spaces
if (!stolbec) && (!line) break; //no paces at the beginning of the line
}
if (strlen(#line)<sizeof(line)) chrcat(#line, bukva);
if (stolbec + strlen(#line) > list.column_max) Perenos();
if (line_len < sizeof(line)) chrcat(#line, bukva);
if (stolbec + line_len > list.column_max) Perenos();
}
}
DrawPage();

View File

@ -29,14 +29,14 @@
char homepage[] = FROM "html\homepage.htm";
#ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.0 Beta 5.5";
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.0 Beta 6";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n";
#else
char version[]=" Text-based Browser 1.0 Beta 5";
char version[]=" Text-based Browser 1.0 Beta 6";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";