Commit e2ca769f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53402 954022d7-b5bf-4e40-9824-e11837661b57
parent 76ce2235
......@@ -566,6 +566,110 @@ CDocument.prototype =
this.Interface_Update_TextPr();
},
LoadTestDocument4 : function()
{
g_oIdCounter.Set_Load(true);
editor.ShowParaMarks = true;
Debug_ParaRunMode = true;
// Добавляем тестовый текст к документу
this.DrawingDocument.m_bIsNoSendChangeDocument = false;
this.DrawingDocument.m_bIsOpeningDocument = true;
this.DrawingDocument.TargetStart();
var Strings = ["History", "A box of punched cards with several program decks.", "Before text editors existed, computer text was punched into punched cards with keypunch machines. The text was carried as a physical box of these thin cardboard cards, and read into a card-reader. Magnetic tape or disk \"card-image\" files created from such card decks often had no line-separation characters at all, commonly assuming fixed-length 80-character records. An alternative to cards was punched paper tape, generated by teletype (TTY) machines; these did need special characters to indicate ends of records.", "The first text editors were line editors oriented to teletype- or typewriter- style terminals, which did not provide a window or screen-oriented display. They usually had very short commands (to minimize typing) that reproduced the current line. Among them were a command to print a selected section(s) of the file on the typewriter (or printer) in case of necessity. An \"edit cursor\", an imaginary insertion point, could be moved by special commands that operated with line numbers of specific text strings (context). Later, the context strings were extended to regular expressions. To see the changes, the file needed to be printed on the printer. These \"line-based text editors\" were considered revolutionary improvements over keypunch machines. In case typewriter-based terminals were not available, they were adapted to keypunch equipment. In this case the user needed to punch the commands into the separate deck of cards and feed them into the computer in order to edit the file.", "When computer terminals with video screens became available, screen-based text editors (sometimes termed just \"screen editors\") became common. One of the earliest \"full screen\" editors was O26 - which was written for the operator console of the CDC 6000 series machines in 1967. Another early full screen editor is vi. Written in the 1970s, vi is still a standard editor[1] for Unix and Linux operating systems. Vi and Emacs are popular editors on these systems. The productivity of editing using full-screen editors (compared to the line-based editors) motivated many of the early purchases of video terminals."];
var oldPara = this.Content[this.Content.length - 1];
var Para = new Paragraph( this.DrawingDocument, this, 0, 50, 50, X_Right_Field, Y_Bottom_Field );
Para.Content = [];
oldPara.Set_DocumentNext(Para);
Para.Set_DocumentPrev(oldPara);
var bWord = false;
var Run = undefined;
this.Content = [];
this.Content.push( Para );
for ( var j = 0; j < 100; j++ )
{
var Pos = 0;
for ( var i = 0; i < Strings.length; i++ )
{
switch ( i )
{
case 0 :
{
Para.Style_Add( this.Styles.Get_Default_Heading(0) );
break;
}
default:
{
Para.Pr.Jc = align_Justify;
break;
}
}
for ( var Index = 0; Index < Strings[i].length; Index++ )
{
if ( " " != Strings[i].charAt( Index ) )
{
if ( false === bWord )
{
Run = new ParaRun( this );
Para.Content.push( Run );
bWord = true;
}
Run.Content.push( new ParaText( Strings[i].charAt( Index ) ) );
}
else
{
if ( true === bWord )
{
bWord = false;
Run = new ParaRun( this );
Para.Content.push( Run );
}
Run.Content.push( new ParaSpace() );
}
}
Run = new ParaRun( this );
Run.Content.push( new ParaEnd() );
Para.Content.push( Run );
bWord = false;
oldPara = Para;
Para = new Paragraph( this.DrawingDocument, this, 0, 50, 50, X_Right_Field, Y_Bottom_Field );
Para.Content = [];
oldPara.Set_DocumentNext(Para);
Para.Set_DocumentPrev(oldPara);
this.Content.push( Para );
Pos = 0;
}
}
Run = new ParaRun( this );
Run.Content.push( new ParaEnd() );
Para.Content.push( Run );
this.HdrFtr.Content[0].Header.First = null;
this.HdrFtr.Content[0].Header.Even = null;
this.HdrFtr.Content[0].Header.Odd = null;
this.HdrFtr.Content[0].Footer.First = null;
this.HdrFtr.Content[0].Footer.Even = null;
this.HdrFtr.Content[0].Footer.Odd = null;
this.Recalculate(false, false, { Inline : { Pos : 0, PageNum : 0 }, Flow : [], HdrFtr : [] } );
var Rand = Math.floor( Math.random() * 100 );
g_oIdCounter.Set_UserId("" + Rand);
g_oIdCounter.Set_Load(false);
},
LoadTestDocument : function()
{
g_oIdCounter.Set_Load(true);
......@@ -587,6 +691,100 @@ CDocument.prototype =
oldPara.Set_DocumentNext(Para);
Para.Set_DocumentPrev(oldPara);
var bWord = false;
var Run = undefined;
this.Content = [];
this.Content.push( Para );
for ( var j = 0; j < 100; j++ )
{
var Pos = 0;
for ( var i = 0; i < Strings.length; i++ )
{
switch ( i )
{
case 0 :
{
Para.Style_Add( this.Styles.Get_Default_Heading(0) );
break;
}
default:
{
Para.Pr.Jc = align_Justify;
break;
}
}
for ( var Index = 0; Index < Strings[i].length; Index++ )
{
if ( " " != Strings[i].charAt( Index ) )
{
Run = new ParaRun( this );
Para.Content.push( Run );
Run.Content.push( new ParaText( Strings[i].charAt( Index ) ) );
}
else
{
Run = new ParaRun( this );
Para.Content.push( Run );
Run.Content.push( new ParaSpace() );
}
}
Run = new ParaRun( this );
Run.Content.push( new ParaEnd() );
Para.Content.push( Run );
bWord = false;
oldPara = Para;
Para = new Paragraph( this.DrawingDocument, this, 0, 50, 50, X_Right_Field, Y_Bottom_Field );
Para.Content = [];
oldPara.Set_DocumentNext(Para);
Para.Set_DocumentPrev(oldPara);
this.Content.push( Para );
Pos = 0;
}
}
Run = new ParaRun( this );
Run.Content.push( new ParaEnd() );
Para.Content.push( Run );
this.HdrFtr.Content[0].Header.First = null;
this.HdrFtr.Content[0].Header.Even = null;
this.HdrFtr.Content[0].Header.Odd = null;
this.HdrFtr.Content[0].Footer.First = null;
this.HdrFtr.Content[0].Footer.Even = null;
this.HdrFtr.Content[0].Footer.Odd = null;
this.Recalculate(false, false, { Inline : { Pos : 0, PageNum : 0 }, Flow : [], HdrFtr : [] } );
var Rand = Math.floor( Math.random() * 100 );
g_oIdCounter.Set_UserId("" + Rand);
g_oIdCounter.Set_Load(false);
},
LoadTestDocument3 : function()
{
g_oIdCounter.Set_Load(true);
editor.ShowParaMarks = true;
Debug_ParaRunMode = true;
// Добавляем тестовый текст к документу
this.DrawingDocument.m_bIsNoSendChangeDocument = false;
this.DrawingDocument.m_bIsOpeningDocument = true;
this.DrawingDocument.TargetStart();
var Strings = ["History", "A box of punched cards with several program decks.", "Before text editors existed, computer text was punched into punched cards with keypunch machines. The text was carried as a physical box of these thin cardboard cards, and read into a card-reader. Magnetic tape or disk \"card-image\" files created from such card decks often had no line-separation characters at all, commonly assuming fixed-length 80-character records. An alternative to cards was punched paper tape, generated by teletype (TTY) machines; these did need special characters to indicate ends of records.", "The first text editors were line editors oriented to teletype- or typewriter- style terminals, which did not provide a window or screen-oriented display. They usually had very short commands (to minimize typing) that reproduced the current line. Among them were a command to print a selected section(s) of the file on the typewriter (or printer) in case of necessity. An \"edit cursor\", an imaginary insertion point, could be moved by special commands that operated with line numbers of specific text strings (context). Later, the context strings were extended to regular expressions. To see the changes, the file needed to be printed on the printer. These \"line-based text editors\" were considered revolutionary improvements over keypunch machines. In case typewriter-based terminals were not available, they were adapted to keypunch equipment. In this case the user needed to punch the commands into the separate deck of cards and feed them into the computer in order to edit the file.", "When computer terminals with video screens became available, screen-based text editors (sometimes termed just \"screen editors\") became common. One of the earliest \"full screen\" editors was O26 - which was written for the operator console of the CDC 6000 series machines in 1967. Another early full screen editor is vi. Written in the 1970s, vi is still a standard editor[1] for Unix and Linux operating systems. Vi and Emacs are popular editors on these systems. The productivity of editing using full-screen editors (compared to the line-based editors) motivated many of the early purchases of video terminals."];
var oldPara = this.Content[this.Content.length - 1];
var Para = new Paragraph( this.DrawingDocument, this, 0, 50, 50, X_Right_Field, Y_Bottom_Field );
Para.Content = [];
oldPara.Set_DocumentNext(Para);
Para.Set_DocumentPrev(oldPara);
var bWord = false;
var Run = undefined;
Run = new ParaRun( this );
......@@ -675,6 +873,7 @@ CDocument.prototype =
g_oIdCounter.Set_Load(false);
},
LoadTestDocument2 : function()
{
g_oIdCounter.Set_Load(true);
......@@ -1442,6 +1641,11 @@ CDocument.prototype =
this.Pages[PageIndex].EndPos = Count - 1;
console.log("LastRecalc: " + ((new Date().getTime() - StartTime) / 1000) );
console.log("RangesCount: " + RunRangesCount );
console.log("RangesElementCount: " + RunRangesElementsCount );
RunRangesCount = 0;
RunRangesElementsCount = 0;
}
if ( true === bReDraw )
......@@ -1496,22 +1700,22 @@ CDocument.prototype =
return;
}
//this.Recalculate_Page( _PageIndex, _bStart, _StartIndex );
if ( _PageIndex > this.FullRecalc.StartPage + 2 )
{
this.FullRecalc.Id = setTimeout( Document_Recalculate_Page, 20 );
/*
this.FullRecalc.Id = setTimeout( function()
{
var LogicDocument = editor.WordControl.m_oLogicDocument;
var FullRecalc = LogicDocument.FullRecalc;
LogicDocument.Recalculate_Page( FullRecalc.PageIndex, FullRecalc.Start, FullRecalc.StartIndex );
}, 10 );
*/
}
else
this.Recalculate_Page( _PageIndex, _bStart, _StartIndex );
this.Recalculate_Page( _PageIndex, _bStart, _StartIndex );
// if ( _PageIndex > this.FullRecalc.StartPage + 2 )
// {
// this.FullRecalc.Id = setTimeout( Document_Recalculate_Page, 20 );
// /*
// this.FullRecalc.Id = setTimeout( function()
// {
// var LogicDocument = editor.WordControl.m_oLogicDocument;
// var FullRecalc = LogicDocument.FullRecalc;
// LogicDocument.Recalculate_Page( FullRecalc.PageIndex, FullRecalc.Start, FullRecalc.StartIndex );
// }, 10 );
// */
// }
// else
// this.Recalculate_Page( _PageIndex, _bStart, _StartIndex );
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment