Commit 0bc4d86e authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander.Trofimov

совместное редактирование формул

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56599 954022d7-b5bf-4e40-9824-e11837661b57
parent e6bd0d83
...@@ -247,45 +247,22 @@ function CTableId() ...@@ -247,45 +247,22 @@ function CTableId()
case historyitem_type_Math : Element = new ParaMath(false); break; case historyitem_type_Math : Element = new ParaMath(false); break;
case historyitem_type_MathContent : Element = new CMathContent(); break; case historyitem_type_MathContent : Element = new CMathContent(); break;
case historyitem_type_acc : props = {ctrPrp: new CTextPr()}; case historyitem_type_acc : Element = new CAccent(); break;
Element = new CAccent(props); break; case historyitem_type_bar : Element = new CBar(); break;
case historyitem_type_bar : props = {ctrPrp: new CTextPr()}; case historyitem_type_box : Element = new CBox(); break;
Element = new CBar(props); break; case historyitem_type_borderBox : Element = new CBorderBox(); break;
case historyitem_type_box : props = {ctrPrp: new CTextPr()}; case historyitem_type_delimiter : Element = new CDelimiter(); break;
Element = new CBox(props); break; case historyitem_type_eqArr : Element = new CEqArray(); break;
case historyitem_type_borderBox : props = {ctrPrp: new CTextPr()}; case historyitem_type_frac : Element = new CFraction(); break;
Element = new CBorderBox(props); break; case historyitem_type_mathFunc : Element = new CMathFunc(); break;
case historyitem_type_delimiter : props = {ctrPrp: new CTextPr()}; case historyitem_type_groupChr : Element = new CGroupCharacter(); break;
Element = new CDelimiter(props); break; case historyitem_type_lim : Element = new CLimit(); break;
case historyitem_type_eqArr : props = {ctrPrp: new CTextPr()}; case historyitem_type_matrix : Element = new CMathMatrix(); break;
Element = new CEqArray(props); break; case historyitem_type_nary : Element = new CNary(); break;
case historyitem_type_frac : props = {ctrPrp: new CTextPr()}; case historyitem_type_phant : Element = new CPhantom(); break;
Element = new CFraction(props); break; case historyitem_type_rad : Element = new CRadical(); break;
case historyitem_type_mathFunc : props = {ctrPrp: new CTextPr()}; case historyitem_type_deg_subsup : Element = new CDegreeSubSup(); break;
Element = new CMathFunc(props); break; case historyitem_type_deg : Element = new CDegree(); break;
case historyitem_type_groupChr : props = {ctrPrp: new CTextPr()};
Element = new CGroupCharacter(props); break;
case historyitem_type_lim : props = {ctrPrp: new CTextPr()};
Element = new CLimit(props); break;
case historyitem_type_matrix : props = {ctrPrp: new CTextPr()};
Element = new CMathMatrix(props); break;
case historyitem_type_nary : props = {ctrPrp: new CTextPr()};
Element = new CNary(props); break;
case historyitem_type_integral : Element = new CIntegral(); break;
case historyitem_type_double_integral : Element = new CDoubleIntegral(); break;
case historyitem_type_triple_integral : Element = new CTripleIntegral(); break;
case historyitem_type_contour_integral : Element = new CContourIntegral(); break;
case historyitem_type_surface_integral : Element = new CSurfaceIntegral(); break;
case historyitem_type_volume_integral : Element = new CVolumeIntegral(); break;
case historyitem_type_phant : props = {ctrPrp: new CTextPr()};
Element = new CPhantom(props); break;
case historyitem_type_rad : props = {ctrPrp: new CTextPr()};
Element = new CRadical(props); break;
case historyitem_type_deg_subsup : props = {ctrPrp: new CTextPr()};
Element = new CDegreeSubSup(props); break;
case historyitem_type_iterators : Element = new CIterators(); break;
case historyitem_type_deg : props = {ctrPrp: new CTextPr()};
Element = new CDegree(props); break;
} }
if ( null !== Element ) if ( null !== Element )
......
...@@ -224,14 +224,14 @@ ParaMath.prototype = ...@@ -224,14 +224,14 @@ ParaMath.prototype =
{ {
History.Create_NewPoint(); History.Create_NewPoint();
var Items = new Array(); var Items = [];
Items.push(oContent.Content.content[0]); Items.push(oContent.Content.content[0]);
oContent.Content.content.splice( 0, 1 ); oContent.Content.content.splice( 0, 1 );
History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0}); History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0});
var oMRun = new ParaRun(this.Paragraph, true); var oMRun = new ParaRun(this.Paragraph, true);
oContent.Content.addElementToContent(oMRun); oContent.Content.addElementToContent(oMRun);
var items = new Array(); var items = [];
items.push(oMRun); items.push(oMRun);
var Pos = oContent.Content.CurPos, var Pos = oContent.Content.CurPos,
PosEnd = Pos + 1; PosEnd = Pos + 1;
......
...@@ -1249,16 +1249,16 @@ CAccent.prototype.Refresh_RecalcData = function(Data) ...@@ -1249,16 +1249,16 @@ CAccent.prototype.Refresh_RecalcData = function(Data)
CAccent.prototype.Write_ToBinary2 = function( Writer ) CAccent.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_acc ); Writer.WriteLong( historyitem_type_acc );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.chr ) if ( undefined != this.Pr.chr )
{ {
Writer.WriteLong(this.chr); Writer.WriteString2(this.Pr.chr);
Flags |= 1; Flags |= 1;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -1268,13 +1268,16 @@ CAccent.prototype.Write_ToBinary2 = function( Writer ) ...@@ -1268,13 +1268,16 @@ CAccent.prototype.Write_ToBinary2 = function( Writer )
} }
CAccent.prototype.Read_FromBinary2 = function( Reader ) CAccent.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.chr = Reader.GetLong(); props.chr = Reader.GetString2();
this.fillMathComposition (props, arrElems);
} }
\ No newline at end of file
...@@ -475,51 +475,51 @@ CBorderBox.prototype.Refresh_RecalcData = function(Data) ...@@ -475,51 +475,51 @@ CBorderBox.prototype.Refresh_RecalcData = function(Data)
CBorderBox.prototype.Write_ToBinary2 = function( Writer ) CBorderBox.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_borderBox ); Writer.WriteLong( historyitem_type_borderBox );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.hideBot ) if ( undefined != this.Pr.hideBot )
{ {
Writer.WriteBool( this.hideBot ); Writer.WriteBool( this.Pr.hideBot );
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.hideLeft ) if ( undefined != this.Pr.hideLeft )
{ {
Writer.WriteBool( this.hideLeft ); Writer.WriteBool( this.Pr.hideLeft );
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.hideRight ) if ( undefined != this.Pr.hideRight )
{ {
Writer.WriteBool( this.hideRight ); Writer.WriteBool( this.Pr.hideRight );
Flags |= 4; Flags |= 4;
} }
if ( undefined != this.hideTop ) if ( undefined != this.Pr.hideTop )
{ {
Writer.WriteBool( this.hideTop ); Writer.WriteBool( this.Pr.hideTop );
Flags |= 8; Flags |= 8;
} }
if ( undefined != this.strikeBLTR ) if ( undefined != this.Pr.strikeBLTR )
{ {
Writer.WriteBool( this.strikeBLTR ); Writer.WriteBool( this.Pr.strikeBLTR );
Flags |= 16; Flags |= 16;
} }
if ( undefined != this.strikeH ) if ( undefined != this.Pr.strikeH )
{ {
Writer.WriteBool( this.strikeH ); Writer.WriteBool( this.Pr.strikeH );
Flags |= 32; Flags |= 32;
} }
if ( undefined != this.strikeTLBR ) if ( undefined != this.Pr.strikeTLBR )
{ {
Writer.WriteBool( this.strikeTLBR ); Writer.WriteBool( this.Pr.strikeTLBR );
Flags |= 64; Flags |= 64;
} }
if ( undefined != this.strikeV ) if ( undefined != this.Pr.strikeV )
{ {
Writer.WriteBool( this.strikeV ); Writer.WriteBool( this.Pr.strikeV );
Flags |= 128; Flags |= 128;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -529,29 +529,32 @@ CBorderBox.prototype.Write_ToBinary2 = function( Writer ) ...@@ -529,29 +529,32 @@ CBorderBox.prototype.Write_ToBinary2 = function( Writer )
} }
CBorderBox.prototype.Read_FromBinary2 = function( Reader ) CBorderBox.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.hideBot = Reader.GetBool(); props.hideBot = Reader.GetBool();
if ( Flags & 2 ) if ( Flags & 2 )
this.hideLeft = Reader.GetBool(); props.hideLeft = Reader.GetBool();
if ( Flags & 4 ) if ( Flags & 4 )
this.hideRight = Reader.GetBool(); props.hideRight = Reader.GetBool();
if ( Flags & 8 ) if ( Flags & 8 )
this.hideTop = Reader.GetBool(); props.hideTop = Reader.GetBool();
if ( Flags & 16 ) if ( Flags & 16 )
this.strikeBLTR = Reader.GetBool(); props.strikeBLTR = Reader.GetBool();
if ( Flags & 32 ) if ( Flags & 32 )
this.strikeH = Reader.GetBool(); props.strikeH = Reader.GetBool();
if ( Flags & 64 ) if ( Flags & 64 )
this.strikeTLBR = Reader.GetBool(); props.strikeTLBR = Reader.GetBool();
if ( Flags & 128 ) if ( Flags & 128 )
this.strikeV = Reader.GetBool(); props.strikeV = Reader.GetBool();
this.fillMathComposition (props, arrElems);
} }
CBorderBox.prototype.Get_Id = function() CBorderBox.prototype.Get_Id = function()
{ {
...@@ -651,7 +654,7 @@ CBox.prototype.Refresh_RecalcData = function(Data) ...@@ -651,7 +654,7 @@ CBox.prototype.Refresh_RecalcData = function(Data)
CBox.prototype.Write_ToBinary2 = function( Writer ) CBox.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_box ); Writer.WriteLong( historyitem_type_box );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
...@@ -690,23 +693,26 @@ CBox.prototype.Write_ToBinary2 = function( Writer ) ...@@ -690,23 +693,26 @@ CBox.prototype.Write_ToBinary2 = function( Writer )
} }
CBox.prototype.Read_FromBinary2 = function( Reader ) CBox.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.aln = Reader.GetBool(); props.aln = Reader.GetBool();
if ( Flags & 2 ) if ( Flags & 2 )
this.brk = Reader.GetLong(); props.brk = Reader.GetLong();
if ( Flags & 4 ) if ( Flags & 4 )
this.diff = Reader.GetBool(); props.diff = Reader.GetBool();
if ( Flags & 8 ) if ( Flags & 8 )
this.noBreak = Reader.GetBool(); props.noBreak = Reader.GetBool();
if ( Flags & 16 ) if ( Flags & 16 )
this.opEmu = Reader.GetBool(); props.opEmu = Reader.GetBool();
this.fillMathComposition (props, arrElems);
} }
CBox.prototype.Get_Id = function() CBox.prototype.Get_Id = function()
{ {
...@@ -810,16 +816,16 @@ CBar.prototype.Refresh_RecalcData = function(Data) ...@@ -810,16 +816,16 @@ CBar.prototype.Refresh_RecalcData = function(Data)
CBar.prototype.Write_ToBinary2 = function( Writer ) CBar.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_bar ); Writer.WriteLong( historyitem_type_bar );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.pos ) if ( undefined != this.Pr.pos )
{ {
Writer.WriteString2( this.pos ); Writer.WriteLong( this.Pr.pos );
Flags |= 1; Flags |= 1;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -830,16 +836,18 @@ CBar.prototype.Write_ToBinary2 = function( Writer ) ...@@ -830,16 +836,18 @@ CBar.prototype.Write_ToBinary2 = function( Writer )
} }
CBar.prototype.Read_FromBinary2 = function( Reader ) CBar.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.loc = Reader.GetString2(); props.pos = Reader.GetLong();
//this.pos = Reader.GetString2();
this.fillMathComposition (props, arrElems);
} }
CBar.prototype.Get_Id = function() CBar.prototype.Get_Id = function()
{ {
...@@ -928,36 +936,36 @@ CPhantom.prototype.Refresh_RecalcData = function(Data) ...@@ -928,36 +936,36 @@ CPhantom.prototype.Refresh_RecalcData = function(Data)
CPhantom.prototype.Write_ToBinary2 = function( Writer ) CPhantom.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_phant ); Writer.WriteLong( historyitem_type_phant );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this..getBase().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.show ) if ( undefined != this.Pr.show )
{ {
Writer.WriteBool( this.show ); Writer.WriteBool( this.Pr.show );
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.transp ) if ( undefined != this.Pr.transp )
{ {
Writer.WriteBool( this.transp ); Writer.WriteBool( this.Pr.transp );
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.zeroAsc ) if ( undefined != this.Pr.zeroAsc )
{ {
Writer.WriteBool( this.zeroAsc ); Writer.WriteBool( this.Pr.zeroAsc );
Flags |= 4; Flags |= 4;
} }
if ( undefined != this.zeroDesc ) if ( undefined != this.Pr.zeroDesc )
{ {
Writer.WriteBool( this.zeroDesc ); Writer.WriteBool( this.Pr.zeroDesc );
Flags |= 8; Flags |= 8;
} }
if ( undefined != this.zeroWid ) if ( undefined != this.Pr.zeroWid )
{ {
Writer.WriteBool( this.zeroWid ); Writer.WriteBool( this.Pr.zeroWid );
Flags |= 16; Flags |= 16;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -967,23 +975,26 @@ CPhantom.prototype.Write_ToBinary2 = function( Writer ) ...@@ -967,23 +975,26 @@ CPhantom.prototype.Write_ToBinary2 = function( Writer )
} }
CPhantom.prototype.Read_FromBinary2 = function( Reader ) CPhantom.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.show = Reader.GetBool(); props.show = Reader.GetBool();
if ( Flags & 2 ) if ( Flags & 2 )
this.transp = Reader.GetBool(); props.transp = Reader.GetBool();
if ( Flags & 4 ) if ( Flags & 4 )
this.zeroAsc = Reader.GetBool(); props.zeroAsc = Reader.GetBool();
if ( Flags & 8 ) if ( Flags & 8 )
this.zeroDesc = Reader.GetBool(); props.zeroDesc = Reader.GetBool();
if ( Flags & 16 ) if ( Flags & 16 )
this.zeroWid = Reader.GetBool(); props.zeroWid = Reader.GetBool();
this.fillMathComposition (props, arrElems);
} }
CPhantom.prototype.Get_Id = function() CPhantom.prototype.Get_Id = function()
{ {
......
...@@ -498,8 +498,8 @@ CDegree.prototype.Refresh_RecalcData = function(Data) ...@@ -498,8 +498,8 @@ CDegree.prototype.Refresh_RecalcData = function(Data)
CDegree.prototype.Write_ToBinary2 = function( Writer ) CDegree.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_deg ); Writer.WriteLong( historyitem_type_deg );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
Writer.WriteString2( this.elements[0][1].Id ); Writer.WriteString2( this.getLowerIterator().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong( this.Pr.type ); Writer.WriteLong( this.Pr.type );
...@@ -507,16 +507,16 @@ CDegree.prototype.Write_ToBinary2 = function( Writer ) ...@@ -507,16 +507,16 @@ CDegree.prototype.Write_ToBinary2 = function( Writer )
} }
CDegree.prototype.Read_FromBinary2 = function( Reader ) CDegree.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
var Element1 = g_oTableId.Get_ById( Reader.GetString2() ); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
Element1.Parent = this; arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.elements[0][1] = Element1;
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
this.Pr.type = Reader.GetLong(); props.type = Reader.GetLong();
this.fillMathComposition (props, arrElems);
} }
CDegree.prototype.Get_Id = function() CDegree.prototype.Get_Id = function()
{ {
...@@ -1188,8 +1188,9 @@ CDegreeSubSup.prototype.Refresh_RecalcData = function(Data) ...@@ -1188,8 +1188,9 @@ CDegreeSubSup.prototype.Refresh_RecalcData = function(Data)
CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer ) CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_deg_subsup ); Writer.WriteLong( historyitem_type_deg_subsup );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
Writer.WriteString2( this.elements[0][1].Id ); Writer.WriteString2( this.getUpperIterator().Id );
Writer.WriteString2( this.getLowerIterator().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong( this.Pr.type ); Writer.WriteLong( this.Pr.type );
...@@ -1211,22 +1212,22 @@ CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer ) ...@@ -1211,22 +1212,22 @@ CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer )
} }
CDegreeSubSup.prototype.Read_FromBinary2 = function( Reader ) CDegreeSubSup.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = new Array();
this.elements[0][0] = Element;
var Element1 = g_oTableId.Get_ById( Reader.GetString2() ); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
Element1.Parent = this; arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.elements[0][1] = Element1; arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
this.Pr.type = Reader.GetLong(); props.type = Reader.GetLong();
if ( this.Pr.type == DEGREE_SubSup ) if ( props.type == DEGREE_SubSup )
{ {
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.Pr.alnScr = Writer.GetBool(); props.alnScr = Writer.GetBool();
} }
this.fillMathComposition (props, arrElems);
} }
CDegreeSubSup.prototype.Get_Id = function() CDegreeSubSup.prototype.Get_Id = function()
{ {
......
...@@ -466,54 +466,20 @@ CFraction.prototype.Refresh_RecalcData = function(Data) ...@@ -466,54 +466,20 @@ CFraction.prototype.Refresh_RecalcData = function(Data)
CFraction.prototype.Write_ToBinary2 = function( Writer ) CFraction.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_frac ); Writer.WriteLong( historyitem_type_frac );
Writer.WriteString2( this.elements[0][0].elements[0][0].Id );
Writer.WriteString2( this.elements[1][0].elements[0][0].Id ); Writer.WriteString2( this.getNumerator().Id );
Writer.WriteString2( this.getDenominator().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.baseJc ) if ( undefined != this.Pr.type )
{ {
Writer.WriteLong(this.baseJc); Writer.WriteLong( this.Pr.type );
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.cGp )
{
Writer.WriteLong(this.cGp);
Flags |= 2;
}
if ( undefined != this.cGpRule )
{
Writer.WriteLong(this.cGpRule);
Flags |= 4;
}
if ( undefined != this.cSp )
{
Writer.WriteLong(this.cSp);
Flags |= 8;
}
if ( undefined != this.mcs )
{
Writer.WriteLong(this.mcs);
Flags |= 16;
}
if ( undefined != this.plcHide )
{
Writer.WriteBool(this.plcHide);
Flags |= 32;
}
if ( undefined != this.rSp )
{
Writer.WriteLong(this.rSp);
Flags |= 64;
}
if ( undefined != this.rSpRule )
{
Writer.WriteLong(this.rSpRule);
Flags |= 128;
}
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos ); Writer.Seek( StartPos );
Writer.WriteLong( Flags ); Writer.WriteLong( Flags );
...@@ -521,33 +487,19 @@ CFraction.prototype.Write_ToBinary2 = function( Writer ) ...@@ -521,33 +487,19 @@ CFraction.prototype.Write_ToBinary2 = function( Writer )
} }
CFraction.prototype.Read_FromBinary2 = function( Reader ) CFraction.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this.elements[0][0]; var arrElems = [];
this.elements[0][0].elements[0][0] = Element;
var Element1 = g_oTableId.Get_ById( Reader.GetString2() ); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
Element1.Parent = this.elements[1][0]; arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.elements[1][0].elements[0][0] = Element1;
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.baseJc = Reader.GetLong(); props.type = Reader.GetLong();
if ( Flags & 2 )
this.cGp = Reader.GetLong(); this.fillMathComposition (props, arrElems);
if ( Flags & 4 )
this.cGpRule = Reader.GetLong();
if ( Flags & 8 )
this.cSp = Reader.GetLong();
if ( Flags & 16 )
this.mcs = Reader.GetLong();
if ( Flags & 32 )
this.plcHide = Reader.GetBool()
if ( Flags & 64 )
this.rSp = Reader.GetLong();
if ( Flags & 128 )
this.rSpRule = Reader.GetLong();
} }
CFraction.prototype.Get_Id = function() CFraction.prototype.Get_Id = function()
{ {
......
...@@ -119,24 +119,24 @@ CLimit.prototype.Refresh_RecalcData = function(Data) ...@@ -119,24 +119,24 @@ CLimit.prototype.Refresh_RecalcData = function(Data)
CLimit.prototype.Write_ToBinary2 = function( Writer ) CLimit.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_lim ); Writer.WriteLong( historyitem_type_lim );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getFName().Id );
Writer.WriteString2( this.elements[1][0].Id ); Writer.WriteString2( this.getIterator().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong(this.type); Writer.WriteLong(this.Pr.type);
} }
CLimit.prototype.Read_FromBinary2 = function( Reader ) CLimit.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
var Element1 = g_oTableId.Get_ById( Reader.GetString2() ); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
Element1.Parent = this; arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.elements[1][0] = Element1;
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
this.type = Reader.GetLong(); props.type = Reader.GetLong();
this.fillMathComposition (props, arrElems);
} }
CLimit.prototype.Get_Id = function() CLimit.prototype.Get_Id = function()
{ {
...@@ -193,7 +193,7 @@ CMathFunc.prototype.fillMathComposition = function(props, contents /*array*/) ...@@ -193,7 +193,7 @@ CMathFunc.prototype.fillMathComposition = function(props, contents /*array*/)
this.elements[0][0] = contents[0]; this.elements[0][0] = contents[0];
// Argument // Argument
this.element[0][1] = contents[1]; this.elements[0][1] = contents[1];
} }
CMathFunc.prototype.getPropsForWrite = function() CMathFunc.prototype.getPropsForWrite = function()
...@@ -214,22 +214,22 @@ CMathFunc.prototype.Refresh_RecalcData = function(Data) ...@@ -214,22 +214,22 @@ CMathFunc.prototype.Refresh_RecalcData = function(Data)
CMathFunc.prototype.Write_ToBinary2 = function( Writer ) CMathFunc.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_mathFunc ); Writer.WriteLong( historyitem_type_mathFunc );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getFName().Id );
Writer.WriteString2( this.elements[0][1].Id ); Writer.WriteString2( this.getArgument().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
} }
CMathFunc.prototype.Read_FromBinary2 = function( Reader ) CMathFunc.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
var Element1 = g_oTableId.Get_ById( Reader.GetString2() ); props.ctrPrp.Read_FromBinary(Reader);
Element1.Parent = this;
this.elements[0][1] = Element1;
this.CtrPrp.Read_FromBinary(Reader); this.fillMathComposition (props, arrElems);
} }
CMathFunc.prototype.Get_Id = function() CMathFunc.prototype.Get_Id = function()
{ {
......
...@@ -6749,7 +6749,6 @@ CMathContent.prototype = ...@@ -6749,7 +6749,6 @@ CMathContent.prototype =
{ {
this.content.push(obj); this.content.push(obj);
} }
this.CurPos++;
}, },
Save_Changes: function(Data, Writer) Save_Changes: function(Data, Writer)
{ {
......
...@@ -474,51 +474,51 @@ CMathMatrix.prototype.Write_ToBinary2 = function( Writer ) ...@@ -474,51 +474,51 @@ CMathMatrix.prototype.Write_ToBinary2 = function( Writer )
Writer.WriteLong( this.nCol ); Writer.WriteLong( this.nCol );
for(var i=0; i<this.nRow; i++) for(var i=0; i<this.nRow; i++)
for(var j=0; j<this.nCol; j++) for(var j=0; j<this.nCol; j++)
Writer.WriteString2( this.elements[i][j].Id ); Writer.WriteString2( this.getElement(i,j).Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.baseJc ) if ( undefined != this.Pr.baseJc )
{ {
Writer.WriteLong( this.baseJc ); Writer.WriteLong( this.Pr.baseJc );
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.cGp ) if ( undefined != this.Pr.cGp )
{ {
Writer.WriteLong( this.cGp ); Writer.WriteLong( this.Pr.cGp );
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.cGpRule ) if ( undefined != this.Pr.cGpRule )
{ {
Writer.WriteLong( this.cGpRule ); Writer.WriteLong( this.Pr.cGpRule );
Flags |= 4; Flags |= 4;
} }
if ( undefined != this.cSp ) if ( undefined != this.Pr.cSp )
{ {
Writer.WriteLong( this.cSp ); Writer.WriteLong( this.Pr.cSp );
Flags |= 8; Flags |= 8;
} }
if ( undefined != this.mcs ) if ( undefined != this.Pr.mcs )
{ {
Writer.WriteLong( this.mcs ); Writer.WriteLong( this.Pr.mcs );
Flags |= 16; Flags |= 16;
} }
if ( undefined != this.plcHide ) if ( undefined != this.Pr.plcHide )
{ {
Writer.WriteBool( this.plcHide ); Writer.WriteBool( this.Pr.plcHide );
Flags |= 32; Flags |= 32;
} }
if ( undefined != this.rSp ) if ( undefined != this.Pr.rSp )
{ {
Writer.WriteLong( this.rSp ); Writer.WriteLong( this.Pr.rSp );
Flags |= 64; Flags |= 64;
} }
if ( undefined != this.rSpRule ) if ( undefined != this.Pr.rSpRule )
{ {
Writer.WriteLong( this.rSpRule ); Writer.WriteLong( this.Pr.rSpRule );
Flags |= 128; Flags |= 128;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -528,39 +528,36 @@ CMathMatrix.prototype.Write_ToBinary2 = function( Writer ) ...@@ -528,39 +528,36 @@ CMathMatrix.prototype.Write_ToBinary2 = function( Writer )
} }
CMathMatrix.prototype.Read_FromBinary2 = function( Reader ) CMathMatrix.prototype.Read_FromBinary2 = function( Reader )
{ {
var row = Reader.GetLong(); var props = {ctrPrp: new CTextPr()};
var col = Reader.GetLong(); var arrElems = [];
for(var i=0; i<row; i++)
{ props.row = Reader.GetLong();
this.elements[i] = []; props.col = Reader.GetLong();
for(var j=0; j<col; j++) for(var i=0; i<props.row; i++)
{ for(var j=0; j<props.col; j++)
var Element = g_oTableId.Get_ById( Reader.GetString2() ); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
Element.Parent = this;
this.elements[i][j] = [];
this.elements[i][j] = Element;
}
}
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.baseJc = Reader.GetLong(); props.baseJc = Reader.GetLong();
if ( Flags & 2 ) if ( Flags & 2 )
this.cGp = Reader.GetLong(); props.cGp = Reader.GetLong();
if ( Flags & 4 ) if ( Flags & 4 )
this.cGpRule = Reader.GetLong(); props.cGpRule = Reader.GetLong();
if ( Flags & 8 ) if ( Flags & 8 )
this.cSp = Reader.GetLong(); props.cSp = Reader.GetLong();
if ( Flags & 16 ) if ( Flags & 16 )
this.mcs = Reader.GetLong(); props.mcs = Reader.GetLong();
if ( Flags & 32 ) if ( Flags & 32 )
this.plcHide = Reader.GetBool(); props.plcHide = Reader.GetBool();
if ( Flags & 64 ) if ( Flags & 64 )
this.rSp = Reader.GetLong(); props.rSp = Reader.GetLong();
if ( Flags & 128 ) if ( Flags & 128 )
this.rSpRule = Reader.GetLong() props.rSpRule = Reader.GetLong()
this.fillMathComposition (props, arrElems);
} }
CMathMatrix.prototype.Get_Id = function() CMathMatrix.prototype.Get_Id = function()
{ {
...@@ -660,36 +657,36 @@ CEqArray.prototype.Write_ToBinary2 = function( Writer ) ...@@ -660,36 +657,36 @@ CEqArray.prototype.Write_ToBinary2 = function( Writer )
var row = this.elements.length; var row = this.elements.length;
Writer.WriteLong( row ); Writer.WriteLong( row );
for(var i=0; i<row; i++) for(var i=0; i<row; i++)
Writer.WriteString2( this.elements[i][0].Id ); Writer.WriteString2( this.getElement(i).Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.baseJc ) if ( undefined != this.Pr.baseJc )
{ {
Writer.WriteLong( this.baseJc ); Writer.WriteLong( this.Pr.baseJc );
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.maxDist ) if ( undefined != this.Pr.maxDist )
{ {
Writer.WriteBool( this.maxDist ); Writer.WriteBool( this.Pr.maxDist );
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.objDist ) if ( undefined != this.Pr.objDist )
{ {
Writer.WriteBool( this.objDist ); Writer.WriteBool( this.Pr.objDist );
Flags |= 4; Flags |= 4;
} }
if ( undefined != this.rSp ) if ( undefined != this.Pr.rSp )
{ {
Writer.WriteLong( this.rSp ); Writer.WriteLong( this.Pr.rSp );
Flags |= 8; Flags |= 8;
} }
if ( undefined != this.rSpRule ) if ( undefined != this.Pr.rSpRule )
{ {
Writer.WriteLong( this.rSpRule ); Writer.WriteLong( this.Pr.rSpRule );
Flags |= 16; Flags |= 16;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -699,28 +696,28 @@ CEqArray.prototype.Write_ToBinary2 = function( Writer ) ...@@ -699,28 +696,28 @@ CEqArray.prototype.Write_ToBinary2 = function( Writer )
} }
CEqArray.prototype.Read_FromBinary2 = function( Reader ) CEqArray.prototype.Read_FromBinary2 = function( Reader )
{ {
var row = Reader.GetLong(); var props = {ctrPrp: new CTextPr()};
for(var i=0; i<row; i++) var arrElems = [];
{
var Element = g_oTableId.Get_ById( Reader.GetString2() ); props.row = Reader.GetLong();
Element.Parent = this; for(var i=0; i<props.row; i++)
this.elements[i] = []; arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.elements[i][0] = Element;
}
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.baseJc = Reader.GetLong(); props.baseJc = Reader.GetLong();
if ( Flags & 2 ) if ( Flags & 2 )
this.maxDist = Reader.GetBool(); props.maxDist = Reader.GetBool();
if ( Flags & 4 ) if ( Flags & 4 )
this.objDist = Reader.GetBool(); props.objDist = Reader.GetBool();
if ( Flags & 8 ) if ( Flags & 8 )
this.rSp = Reader.GetLong(); props.rSp = Reader.GetLong();
if ( Flags & 16 ) if ( Flags & 16 )
this.rSpRule = Reader.GetLong(); props.rSpRule = Reader.GetLong();
this.fillMathComposition (props, arrElems);
} }
CEqArray.prototype.Get_Id = function() CEqArray.prototype.Get_Id = function()
{ {
......
...@@ -317,32 +317,50 @@ CNary.prototype.Refresh_RecalcData = function(Data) ...@@ -317,32 +317,50 @@ CNary.prototype.Refresh_RecalcData = function(Data)
CNary.prototype.Write_ToBinary2 = function( Writer ) CNary.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_nary ); Writer.WriteLong( historyitem_type_nary );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.oNary.getBase().Id );
Writer.WriteString2( this.elements[0][1].Id );
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
var Flags = 0;
if ( undefined != this.getUpperIterator() )
{
Writer.WriteLong(this.getUpperIterator().Id);
Flags |= 1;
}
if ( undefined != this.getLowerIterator())
{
Writer.WriteLong(this.getLowerIterator().Id);
Flags |= 2;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos );
Writer.WriteLong( Flags );
Writer.Seek( EndPos );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.chr ) if ( undefined != this.Pr.chr )
{ {
Writer.WriteLong(this.chr); Writer.WriteLong(this.Pr.chr);
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.limLoc ) if ( undefined != this.Pr.limLoc )
{ {
Writer.WriteLong(this.limLoc); Writer.WriteLong(this.Pr.limLoc);
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.subHide ) if ( undefined != this.Pr.subHide )
{ {
Writer.WriteBool(this.subHide); Writer.WriteBool(this.Pr.subHide);
Flags |= 4; Flags |= 4;
} }
if ( undefined != this.supHide ) if ( undefined != this.Pr.supHide )
{ {
Writer.WriteBool(this.supHide); Writer.WriteBool(this.Pr.supHide);
Flags |= 8; Flags |= 8;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -352,25 +370,29 @@ CNary.prototype.Write_ToBinary2 = function( Writer ) ...@@ -352,25 +370,29 @@ CNary.prototype.Write_ToBinary2 = function( Writer )
} }
CNary.prototype.Read_FromBinary2 = function( Reader ) CNary.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
var Element1 = g_oTableId.Get_ById( Reader.GetString2() ); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
Element1.Parent = this; var Flags = Reader.GetLong();
this.elements[0][1] = Element1; if ( Flags & 1 )
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
if ( Flags & 2 )
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.chr = Reader.GetLong(); props.chr = Reader.GetLong();
if ( Flags & 2 ) if ( Flags & 2 )
this.limLoc = Reader.GetLong(); props.limLoc = Reader.GetLong();
if ( Flags & 4 ) if ( Flags & 4 )
this.subHide = Reader.GetBool(); props.subHide = Reader.GetBool();
if ( Flags & 8 ) if ( Flags & 8 )
this.supHide = Reader.GetBool(); props.supHide = Reader.GetBool();
this.fillMathComposition (props, arrElems);
} }
CNary.prototype.Get_Id = function() CNary.prototype.Get_Id = function()
{ {
...@@ -1348,9 +1370,7 @@ CLogicalOr.prototype.calculateSizeGlyph = function() ...@@ -1348,9 +1370,7 @@ CLogicalOr.prototype.calculateSizeGlyph = function()
function CIntegral() function CIntegral()
{ {
this.Id = g_oIdCounter.Get_NewId();
CNaryOperator.call(this); CNaryOperator.call(this);
g_oTableId.Add( this, this.Id );
} }
extend(CIntegral, CNaryOperator); extend(CIntegral, CNaryOperator);
CIntegral.prototype.getCoord = function() CIntegral.prototype.getCoord = function()
...@@ -1577,34 +1597,10 @@ CIntegral.prototype.calculateSizeGlyph = function() ...@@ -1577,34 +1597,10 @@ CIntegral.prototype.calculateSizeGlyph = function()
return {width : width, height : height}; return {width : width, height : height};
} }
CIntegral.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_integral );
}
CIntegral.prototype.Load_Changes = function(Reader)
{
}
CIntegral.prototype.Refresh_RecalcData = function(Data)
{
}
CIntegral.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_integral );
}
CIntegral.prototype.Read_FromBinary2 = function( Reader )
{
}
CIntegral.prototype.Get_Id = function()
{
return this.Id;
}
function CDoubleIntegral() function CDoubleIntegral()
{ {
this.Id = g_oIdCounter.Get_NewId();
CIntegral.call(this); CIntegral.call(this);
g_oTableId.Add( this, this.Id );
} }
extend(CDoubleIntegral, CIntegral); extend(CDoubleIntegral, CIntegral);
CDoubleIntegral.prototype.drawPath = function(pGraphics, XX, YY) CDoubleIntegral.prototype.drawPath = function(pGraphics, XX, YY)
...@@ -1642,34 +1638,10 @@ CDoubleIntegral.prototype.calculateSizeGlyph = function() ...@@ -1642,34 +1638,10 @@ CDoubleIntegral.prototype.calculateSizeGlyph = function()
return {width : width, height : height}; return {width : width, height : height};
} }
CDoubleIntegral.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_double_integral );
}
CDoubleIntegral.prototype.Load_Changes = function(Reader)
{
}
CDoubleIntegral.prototype.Refresh_RecalcData = function(Data)
{
}
CDoubleIntegral.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_double_integral );
}
CDoubleIntegral.prototype.Read_FromBinary2 = function( Reader )
{
}
CDoubleIntegral.prototype.Get_Id = function()
{
return this.Id;
}
function CTripleIntegral() function CTripleIntegral()
{ {
this.Id = g_oIdCounter.Get_NewId();
CIntegral.call(this); CIntegral.call(this);
g_oTableId.Add( this, this.Id );
} }
extend(CTripleIntegral, CIntegral); extend(CTripleIntegral, CIntegral);
CTripleIntegral.prototype.drawPath = function(pGraphics, XX, YY) CTripleIntegral.prototype.drawPath = function(pGraphics, XX, YY)
...@@ -1717,28 +1689,6 @@ CTripleIntegral.prototype.calculateSizeGlyph = function() ...@@ -1717,28 +1689,6 @@ CTripleIntegral.prototype.calculateSizeGlyph = function()
return {width : width, height : height}; return {width : width, height : height};
} }
CTripleIntegral.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_triple_integral );
}
CTripleIntegral.prototype.Load_Changes = function(Reader)
{
}
CTripleIntegral.prototype.Refresh_RecalcData = function(Data)
{
}
CTripleIntegral.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_triple_integral );
}
CTripleIntegral.prototype.Read_FromBinary2 = function( Reader )
{
}
CTripleIntegral.prototype.Get_Id = function()
{
return this.Id;
}
function old_CContourIntegral() function old_CContourIntegral()
{ {
...@@ -3147,9 +3097,7 @@ _old_CContourIntegral.prototype.drawPath = function(XX, YY) ...@@ -3147,9 +3097,7 @@ _old_CContourIntegral.prototype.drawPath = function(XX, YY)
function CContourIntegral() function CContourIntegral()
{ {
this.Id = g_oIdCounter.Get_NewId();
CNaryOperator.call(this); CNaryOperator.call(this);
g_oTableId.Add( this, this.Id );
} }
extend(CContourIntegral, CNaryOperator); extend(CContourIntegral, CNaryOperator);
CContourIntegral.prototype.draw = function(x, y, pGraphics) CContourIntegral.prototype.draw = function(x, y, pGraphics)
...@@ -3231,28 +3179,6 @@ CContourIntegral.prototype.calculateSizeGlyph = function() ...@@ -3231,28 +3179,6 @@ CContourIntegral.prototype.calculateSizeGlyph = function()
return {width : width, height : height}; return {width : width, height : height};
} }
CContourIntegral.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_contour_integral );
}
CContourIntegral.prototype.Load_Changes = function(Reader)
{
}
CContourIntegral.prototype.Refresh_RecalcData = function(Data)
{
}
CContourIntegral.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_contour_integral );
}
CContourIntegral.prototype.Read_FromBinary2 = function( Reader )
{
}
CContourIntegral.prototype.Get_Id = function()
{
return this.Id;
}
function old_CSurfaceIntegral() function old_CSurfaceIntegral()
{ {
...@@ -3677,9 +3603,7 @@ old_CSurfaceIntegral.prototype.calculateSizeGlyph = function() ...@@ -3677,9 +3603,7 @@ old_CSurfaceIntegral.prototype.calculateSizeGlyph = function()
function CSurfaceIntegral() function CSurfaceIntegral()
{ {
this.Id = g_oIdCounter.Get_NewId();
CNaryOperator.call(this); CNaryOperator.call(this);
g_oTableId.Add( this, this.Id );
} }
extend(CSurfaceIntegral, CNaryOperator); extend(CSurfaceIntegral, CNaryOperator);
CSurfaceIntegral.prototype.draw = function(x, y, pGraphics) CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
...@@ -3760,27 +3684,6 @@ CSurfaceIntegral.prototype.calculateSizeGlyph = function() ...@@ -3760,27 +3684,6 @@ CSurfaceIntegral.prototype.calculateSizeGlyph = function()
return {width : width, height : height}; return {width : width, height : height};
} }
CSurfaceIntegral.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_surface_integral );
}
CSurfaceIntegral.prototype.Load_Changes = function(Reader)
{
}
CSurfaceIntegral.prototype.Refresh_RecalcData = function(Data)
{
}
CSurfaceIntegral.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_surface_integral );
}
CSurfaceIntegral.prototype.Read_FromBinary2 = function( Reader )
{
}
CSurfaceIntegral.prototype.Get_Id = function()
{
return this.Id;
}
function old_CVolumeIntegral() function old_CVolumeIntegral()
{ {
...@@ -4276,9 +4179,7 @@ old_CVolumeIntegral.prototype.calculateSizeGlyph = function() ...@@ -4276,9 +4179,7 @@ old_CVolumeIntegral.prototype.calculateSizeGlyph = function()
function CVolumeIntegral() function CVolumeIntegral()
{ {
this.Id = g_oIdCounter.Get_NewId();
CNaryOperator.call(this); CNaryOperator.call(this);
g_oTableId.Add( this, this.Id );
} }
extend(CVolumeIntegral, CNaryOperator); extend(CVolumeIntegral, CNaryOperator);
CVolumeIntegral.prototype.draw = function(x, y, pGraphics) CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
...@@ -4358,25 +4259,3 @@ CVolumeIntegral.prototype.calculateSizeGlyph = function() ...@@ -4358,25 +4259,3 @@ CVolumeIntegral.prototype.calculateSizeGlyph = function()
return {width : width, height : height}; return {width : width, height : height};
} }
\ No newline at end of file
CVolumeIntegral.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_volume_integral );
}
CVolumeIntegral.prototype.Load_Changes = function(Reader)
{
}
CVolumeIntegral.prototype.Refresh_RecalcData = function(Data)
{
}
CVolumeIntegral.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_volume_integral );
}
CVolumeIntegral.prototype.Read_FromBinary2 = function( Reader )
{
}
CVolumeIntegral.prototype.Get_Id = function()
{
return this.Id;
}
...@@ -3931,36 +3931,39 @@ CDelimiter.prototype.Refresh_RecalcData = function(Data) ...@@ -3931,36 +3931,39 @@ CDelimiter.prototype.Refresh_RecalcData = function(Data)
CDelimiter.prototype.Write_ToBinary2 = function( Writer ) CDelimiter.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_delimiter ); Writer.WriteLong( historyitem_type_delimiter );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteLong(this.column);
for (var i=0; i<this.column; i++)
Writer.WriteString2( this.getBase(i).Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.begChr ) if ( undefined != this.Pr.begChr )
{ {
Writer.WriteLong(this.begChr); Writer.WriteLong(this.Pr.begChr);
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.endChr ) if ( undefined != this.Pr.endChr )
{ {
Writer.WriteLong(this.endChr); Writer.WriteLong(this.Pr.endChr);
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.grow ) if ( undefined != this.Pr.grow )
{ {
Writer.WriteLong(this.grow); Writer.WriteLong(this.Pr.grow);
Flags |= 4; Flags |= 4;
} }
if ( undefined != this.sepChr ) if ( undefined != this.Pr.sepChr )
{ {
Writer.WriteLong(this.sepChr); Writer.WriteLong(this.Pr.sepChr);
Flags |= 8; Flags |= 8;
} }
if ( undefined != this.shp ) if ( undefined != this.Pr.shp )
{ {
Writer.WriteLong(this.shp); Writer.WriteLong(this.Pr.shp);
Flags |= 16; Flags |= 16;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -3970,23 +3973,28 @@ CDelimiter.prototype.Write_ToBinary2 = function( Writer ) ...@@ -3970,23 +3973,28 @@ CDelimiter.prototype.Write_ToBinary2 = function( Writer )
} }
CDelimiter.prototype.Read_FromBinary2 = function( Reader ) CDelimiter.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element; props.column = Reader.GetLong();
for (var i=0; i<props.column; i++)
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
this.CtrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.begChr = Reader.GetLong(); props.begChr = Reader.GetLong();
if ( Flags & 2 ) if ( Flags & 2 )
this.endChr = Reader.GetLong(); props.endChr = Reader.GetLong();
if ( Flags & 4 ) if ( Flags & 4 )
this.grow = Reader.GetBool(); props.grow = Reader.GetBool();
if ( Flags & 8 ) if ( Flags & 8 )
this.sepChr = Reader.GetLong(); props.sepChr = Reader.GetLong();
if ( Flags & 16 ) if ( Flags & 16 )
this.shp = Reader.GetLong(); props.shp = Reader.GetLong();
this.fillMathComposition (props, arrElems);
} }
CDelimiter.prototype.Get_Id = function() CDelimiter.prototype.Get_Id = function()
{ {
...@@ -4451,26 +4459,26 @@ CGroupCharacter.prototype.Refresh_RecalcData = function(Data) ...@@ -4451,26 +4459,26 @@ CGroupCharacter.prototype.Refresh_RecalcData = function(Data)
CGroupCharacter.prototype.Write_ToBinary2 = function( Writer ) CGroupCharacter.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_groupChr ); Writer.WriteLong( historyitem_type_groupChr );
Writer.WriteString2( this.elements[0][0].Id ); Writer.WriteString2( this.getBase().Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); var StartPos = Writer.GetCurPosition();
Writer.Skip(4); Writer.Skip(4);
var Flags = 0; var Flags = 0;
if ( undefined != this.chr ) if ( undefined != this.Pr.chr )
{ {
Writer.WriteLong(this.chr); Writer.WriteLong(this.Pr.chr);
Flags |= 1; Flags |= 1;
} }
if ( undefined != this.pos ) if ( undefined != this.Pr.pos )
{ {
Writer.WriteLong(this.pos); Writer.WriteLong(this.Pr.pos);
Flags |= 2; Flags |= 2;
} }
if ( undefined != this.vertJc ) if ( undefined != this.Pr.vertJc )
{ {
Writer.WriteLong(this.vertJc); Writer.WriteLong(this.Pr.vertJc);
Flags |= 4; Flags |= 4;
} }
var EndPos = Writer.GetCurPosition(); var EndPos = Writer.GetCurPosition();
...@@ -4480,20 +4488,22 @@ CGroupCharacter.prototype.Write_ToBinary2 = function( Writer ) ...@@ -4480,20 +4488,22 @@ CGroupCharacter.prototype.Write_ToBinary2 = function( Writer )
} }
CGroupCharacter.prototype.Read_FromBinary2 = function( Reader ) CGroupCharacter.prototype.Read_FromBinary2 = function( Reader )
{ {
var Element = g_oTableId.Get_ById( Reader.GetString2() ); var props = {ctrPrp: new CTextPr()};
Element.Parent = this; var arrElems = [];
this.elements[0][0] = Element;
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.chr = Reader.GetLong(); props.chr = Reader.GetLong();
if ( Flags & 2 ) if ( Flags & 2 )
this.loc = Reader.GetLong(); props.pos = Reader.GetLong();
//this.pos = Reader.GetLong();
if ( Flags & 4 ) if ( Flags & 4 )
this.vertJc = Reader.GetLong(); props.vertJc = Reader.GetLong();
this.fillMathComposition (props, arrElems);
} }
CGroupCharacter.prototype.Get_Id = function() CGroupCharacter.prototype.Get_Id = function()
{ {
......
...@@ -1270,10 +1270,9 @@ CRadical.prototype.Refresh_RecalcData = function(Data) ...@@ -1270,10 +1270,9 @@ CRadical.prototype.Refresh_RecalcData = function(Data)
CRadical.prototype.Write_ToBinary2 = function( Writer ) CRadical.prototype.Write_ToBinary2 = function( Writer )
{ {
Writer.WriteLong( historyitem_type_rad ); Writer.WriteLong( historyitem_type_rad );
var len = this.elements[0].length
Writer.WriteLong( len ); Writer.WriteString2( this.getBase().Id );
for(var i=0; i<len; i++) Writer.WriteString2( this.getDegree().Id );
Writer.WriteString2( this.elements[0][i].Id );
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
...@@ -1292,19 +1291,19 @@ CRadical.prototype.Write_ToBinary2 = function( Writer ) ...@@ -1292,19 +1291,19 @@ CRadical.prototype.Write_ToBinary2 = function( Writer )
} }
CRadical.prototype.Read_FromBinary2 = function( Reader ) CRadical.prototype.Read_FromBinary2 = function( Reader )
{ {
var len = Reader.GetLong(); var props = {ctrPrp: new CTextPr()};
for (var i=0; i<len; i++) var arrElems = [];
{
var Element = g_oTableId.Get_ById( Reader.GetString2() );
Element.Parent = this;
this.elements[0][i] = Element;
}
this.CtrPrp.Read_FromBinary(Reader); arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.degHide = Reader.GetBool(); props.degHide = Reader.GetBool();
this.fillMathComposition (props, arrElems);
} }
CRadical.prototype.Get_Id = function() CRadical.prototype.Get_Id = function()
{ {
......
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