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

Исправлены баги в совместном редактировании классов CAccent, CBox, CBorderBox,...

Исправлены баги в совместном редактировании классов CAccent, CBox, CBorderBox, CBar, CDegree. Исправлен баг с необновлением после добавления текста в совместном редактировании.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58685 954022d7-b5bf-4e40-9824-e11837661b57
parent da0d5d88
...@@ -2772,7 +2772,7 @@ Paragraph.prototype = ...@@ -2772,7 +2772,7 @@ Paragraph.prototype =
var Elem = new ParaMath(); var Elem = new ParaMath();
//Elem.Set_Paragraph(this); //Elem.Set_Paragraph(this);
Elem.Root.Load_FromMenu(Item.Menu, this); Elem.Root.Load_FromMenu(Item.Menu, this);
Elem.Root.SetRunEmptyToContent(true); Elem.Root.Correct_Content(true);
// Добавляем гиперссылку в содержимое параграфа // Добавляем гиперссылку в содержимое параграфа
this.Internal_Content_Add( CurPos + 1, Elem ); this.Internal_Content_Add( CurPos + 1, Elem );
......
...@@ -6751,6 +6751,9 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -6751,6 +6751,9 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
if ( undefined !== this.Paragraph && null !== this.Paragraph ) if ( undefined !== this.Paragraph && null !== this.Paragraph )
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
...@@ -6775,9 +6778,12 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -6775,9 +6778,12 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
if ( undefined !== this.Paragraph && null !== this.Paragraph ) if (undefined !== this.Paragraph && null !== this.Paragraph)
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
......
...@@ -461,6 +461,7 @@ function CAccent(props) ...@@ -461,6 +461,7 @@ function CAccent(props)
///////////////// /////////////////
this.baseContent = new CMathContent();
this.operator = new COperator(OPER_ACCENT); this.operator = new COperator(OPER_ACCENT);
CAccent.superclass.constructor.call(this); CAccent.superclass.constructor.call(this);
...@@ -477,8 +478,7 @@ CAccent.prototype.init = function(props) ...@@ -477,8 +478,7 @@ CAccent.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.elements[0][0] = this.baseContent;
this.elements[0][0].SetDot(true); this.elements[0][0].SetDot(true);
} }
CAccent.prototype.setChr = function(chr) CAccent.prototype.setChr = function(chr)
...@@ -660,36 +660,35 @@ CAccent.prototype.Refresh_RecalcData = function(Data) ...@@ -660,36 +660,35 @@ 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.getBase().Id );
Writer.WriteString2(this.Id);
Writer.WriteString2(this.baseContent.Id);
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
var StartPos = Writer.GetCurPosition(); if (undefined !== this.Pr.chr)
Writer.Skip(4);
var Flags = 0;
if ( undefined != this.Pr.chr )
{ {
Writer.WriteLong(this.Pr.chr); Writer.WriteBool(true);
Flags |= 1; Writer.WriteLong(this.Pr.chr);
} }
var EndPos = Writer.GetCurPosition(); else
Writer.Seek( StartPos ); Writer.WriteBool(false);
Writer.WriteLong( Flags );
Writer.Seek( EndPos );
} }
CAccent.prototype.Read_FromBinary2 = function( Reader ) CAccent.prototype.Read_FromBinary2 = function( Reader )
{ {
var props = {ctrPrp: new CTextPr()}; this.Id = Reader.GetString2();
var arrElems = []; this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
var props = {ctrPrp: new CTextPr()};
props.ctrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); if (true === Reader.GetBool())
if ( Flags & 1 ) props.chr = Reader.GetLong();
props.chr = Reader.GetLong();
this.init(props);
this.fillMathComposition (props, arrElems); }
} CAccent.prototype.Get_Id = function()
\ No newline at end of file {
return this.Id;
};
\ No newline at end of file
...@@ -781,6 +781,13 @@ CMathBase.prototype = ...@@ -781,6 +781,13 @@ CMathBase.prototype =
if(!this.elements[i][j].IsJustDraw()) if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].SetRunEmptyToContent(bAll); this.elements[i][j].SetRunEmptyToContent(bAll);
}, },
Correct_Content: function(bInnerCorrection)
{
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].Correct_Content(bInnerCorrection);
},
Selection_Remove: function() Selection_Remove: function()
{ {
var start_X = this.SelectStart.X, var start_X = this.SelectStart.X,
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
function CBorderBox(props) function CBorderBox(props)
{ {
CBorderBox.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_BORDER_BOX; this.kind = MATH_BORDER_BOX;
...@@ -19,7 +21,7 @@ function CBorderBox(props) ...@@ -19,7 +21,7 @@ function CBorderBox(props)
strikeV: false strikeV: false
}; };
CMathBase.call(this); this.baseContent = new CMathContent();
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
...@@ -35,7 +37,7 @@ CBorderBox.prototype.init = function(props) ...@@ -35,7 +37,7 @@ CBorderBox.prototype.init = function(props)
CBorderBox.prototype.fillContent = function() CBorderBox.prototype.fillContent = function()
{ {
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.elements[0][0] = this.baseContent;
} }
CBorderBox.prototype.setProperties = function(props) CBorderBox.prototype.setProperties = function(props)
{ {
...@@ -302,14 +304,6 @@ CBorderBox.prototype.getBase = function() ...@@ -302,14 +304,6 @@ CBorderBox.prototype.getBase = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
} }
CBorderBox.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// Base
this.elements[0][0] = contents[0];
}
CBorderBox.prototype.getPropsForWrite = function() CBorderBox.prototype.getPropsForWrite = function()
{ {
/*var props = {}; /*var props = {};
...@@ -340,8 +334,9 @@ CBorderBox.prototype.Refresh_RecalcData = function(Data) ...@@ -340,8 +334,9 @@ 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.getBase().Id ); Writer.WriteString2(this.Id);
Writer.WriteString2(this.baseContent.Id);
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
...@@ -395,12 +390,11 @@ CBorderBox.prototype.Write_ToBinary2 = function( Writer ) ...@@ -395,12 +390,11 @@ CBorderBox.prototype.Write_ToBinary2 = function( Writer )
} }
CBorderBox.prototype.Read_FromBinary2 = function( Reader ) CBorderBox.prototype.Read_FromBinary2 = function( Reader )
{ {
var props = {ctrPrp: new CTextPr()}; this.Id = Reader.GetString2();
var arrElems = []; this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
arrElems.push(g_oTableId.Get_ById( Reader.GetString2())); var props = {ctrPrp: new CTextPr()};
props.ctrPrp.Read_FromBinary(Reader);
props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
...@@ -419,8 +413,8 @@ CBorderBox.prototype.Read_FromBinary2 = function( Reader ) ...@@ -419,8 +413,8 @@ CBorderBox.prototype.Read_FromBinary2 = function( Reader )
props.strikeTLBR = Reader.GetBool(); props.strikeTLBR = Reader.GetBool();
if ( Flags & 128 ) if ( Flags & 128 )
props.strikeV = Reader.GetBool(); props.strikeV = Reader.GetBool();
this.fillMathComposition (props, arrElems); this.init(props);
} }
CBorderBox.prototype.Get_Id = function() CBorderBox.prototype.Get_Id = function()
{ {
...@@ -428,9 +422,10 @@ CBorderBox.prototype.Get_Id = function() ...@@ -428,9 +422,10 @@ CBorderBox.prototype.Get_Id = function()
} }
function CBox(props) function CBox(props)
{ {
CBox.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_BOX; this.kind = MATH_BOX;
...@@ -443,7 +438,7 @@ function CBox(props) ...@@ -443,7 +438,7 @@ function CBox(props)
brk: false brk: false
}; };
CMathBase.call(this); this.baseContent = new CMathContent();
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
...@@ -459,7 +454,7 @@ CBox.prototype.init = function(props) ...@@ -459,7 +454,7 @@ CBox.prototype.init = function(props)
CBox.prototype.fillContent = function() CBox.prototype.fillContent = function()
{ {
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.elements[0][0] = this.baseContent;
} }
CBox.prototype.setProperties = function(props) CBox.prototype.setProperties = function(props)
{ {
...@@ -482,14 +477,6 @@ CBox.prototype.setProperties = function(props) ...@@ -482,14 +477,6 @@ CBox.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
} }
CBox.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// Base
this.elements[0][0] = contents[0];
}
CBox.prototype.getBase = function() CBox.prototype.getBase = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
...@@ -510,8 +497,9 @@ CBox.prototype.Refresh_RecalcData = function(Data) ...@@ -510,8 +497,9 @@ 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.getBase().Id ); Writer.WriteString2(this.Id);
Writer.WriteString2(this.baseContent.Id);
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
...@@ -550,11 +538,10 @@ CBox.prototype.Write_ToBinary2 = function( Writer ) ...@@ -550,11 +538,10 @@ CBox.prototype.Write_ToBinary2 = function( Writer )
} }
CBox.prototype.Read_FromBinary2 = function( Reader ) CBox.prototype.Read_FromBinary2 = function( Reader )
{ {
var props = {ctrPrp: new CTextPr()}; this.Id = Reader.GetString2();
var arrElems = []; this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
var props = {ctrPrp: new CTextPr()};
props.ctrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
...@@ -568,8 +555,8 @@ CBox.prototype.Read_FromBinary2 = function( Reader ) ...@@ -568,8 +555,8 @@ CBox.prototype.Read_FromBinary2 = function( Reader )
props.noBreak = Reader.GetBool(); props.noBreak = Reader.GetBool();
if ( Flags & 16 ) if ( Flags & 16 )
props.opEmu = Reader.GetBool(); props.opEmu = Reader.GetBool();
this.fillMathComposition (props, arrElems); this.init(props);
} }
CBox.prototype.Get_Id = function() CBox.prototype.Get_Id = function()
{ {
...@@ -578,6 +565,8 @@ CBox.prototype.Get_Id = function() ...@@ -578,6 +565,8 @@ CBox.prototype.Get_Id = function()
function CBar(props) function CBar(props)
{ {
CBar.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_BAR; this.kind = MATH_BAR;
...@@ -586,11 +575,11 @@ function CBar(props) ...@@ -586,11 +575,11 @@ function CBar(props)
pos: LOCATION_BOT pos: LOCATION_BOT
}; };
this.baseContent = new CMathContent();
//this.loc = LOCATION_BOT; //this.loc = LOCATION_BOT;
this.operator = new COperator(OPER_BAR); this.operator = new COperator(OPER_BAR);
CCharacter.call(this);
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
...@@ -605,7 +594,7 @@ CBar.prototype.init = function(props) ...@@ -605,7 +594,7 @@ CBar.prototype.init = function(props)
CBar.prototype.fillContent = function() CBar.prototype.fillContent = function()
{ {
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.elements[0][0] = this.baseContent;
} }
CBar.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) CBar.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{ {
...@@ -650,14 +639,6 @@ CBar.prototype.setProperties = function(props) ...@@ -650,14 +639,6 @@ CBar.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
} }
CBar.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// Base
this.elements[0][0] = contents[0];
}
CBar.prototype.getPropsForWrite = function() CBar.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
...@@ -674,8 +655,9 @@ CBar.prototype.Refresh_RecalcData = function(Data) ...@@ -674,8 +655,9 @@ 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.getBase().Id ); Writer.WriteString2(this.Id);
Writer.WriteString2(this.baseContent.Id);
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
...@@ -695,18 +677,17 @@ CBar.prototype.Write_ToBinary2 = function( Writer ) ...@@ -695,18 +677,17 @@ CBar.prototype.Write_ToBinary2 = function( Writer )
} }
CBar.prototype.Read_FromBinary2 = function( Reader ) CBar.prototype.Read_FromBinary2 = function( Reader )
{ {
var props = {ctrPrp: new CTextPr()}; this.Id = Reader.GetString2();
var arrElems = []; this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
var props = {ctrPrp: new CTextPr()};
props.ctrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
props.pos = Reader.GetLong(); props.pos = Reader.GetLong();
this.fillMathComposition (props, arrElems); this.init(props);
} }
CBar.prototype.Get_Id = function() CBar.prototype.Get_Id = function()
{ {
...@@ -715,8 +696,9 @@ CBar.prototype.Get_Id = function() ...@@ -715,8 +696,9 @@ CBar.prototype.Get_Id = function()
function CPhantom(props) function CPhantom(props)
{ {
CPhantom.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
CMathBase.call(this);
this.Pr = this.Pr =
{ {
...@@ -727,6 +709,8 @@ function CPhantom(props) ...@@ -727,6 +709,8 @@ function CPhantom(props)
zeroWid: false zeroWid: false
}; };
this.baseContent = new CMathContent();
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
...@@ -741,7 +725,7 @@ CPhantom.prototype.init = function(props) ...@@ -741,7 +725,7 @@ CPhantom.prototype.init = function(props)
CPhantom.prototype.fillContent = function() CPhantom.prototype.fillContent = function()
{ {
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.elements[0][0] = this.baseContent;
} }
CPhantom.prototype.getBase = function() CPhantom.prototype.getBase = function()
{ {
...@@ -769,14 +753,6 @@ CPhantom.prototype.setProperties = function(props) ...@@ -769,14 +753,6 @@ CPhantom.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
} }
CPhantom.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// Base
this.elements[0][0] = contents[0];
}
CPhantom.prototype.getPropsForWrite = function() CPhantom.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
...@@ -793,8 +769,9 @@ CPhantom.prototype.Refresh_RecalcData = function(Data) ...@@ -793,8 +769,9 @@ 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.getBase().Id ); Writer.WriteString2(this.Id);
Writer.WriteString2(this.baseContent.Id);
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
...@@ -833,11 +810,10 @@ CPhantom.prototype.Write_ToBinary2 = function( Writer ) ...@@ -833,11 +810,10 @@ CPhantom.prototype.Write_ToBinary2 = function( Writer )
} }
CPhantom.prototype.Read_FromBinary2 = function( Reader ) CPhantom.prototype.Read_FromBinary2 = function( Reader )
{ {
this.Id = Reader.GetString2();
this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
var props = {ctrPrp: new CTextPr()}; var props = {ctrPrp: new CTextPr()};
var arrElems = [];
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
...@@ -851,8 +827,8 @@ CPhantom.prototype.Read_FromBinary2 = function( Reader ) ...@@ -851,8 +827,8 @@ CPhantom.prototype.Read_FromBinary2 = function( Reader )
props.zeroDesc = Reader.GetBool(); props.zeroDesc = Reader.GetBool();
if ( Flags & 16 ) if ( Flags & 16 )
props.zeroWid = Reader.GetBool(); props.zeroWid = Reader.GetBool();
this.fillMathComposition (props, arrElems); this.init(props);
} }
CPhantom.prototype.Get_Id = function() CPhantom.prototype.Get_Id = function()
{ {
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
function CDegree(props, bInside) function CDegree(props, bInside)
{ {
CDegree.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_DEGREE; this.kind = MATH_DEGREE;
...@@ -13,7 +15,8 @@ function CDegree(props, bInside) ...@@ -13,7 +15,8 @@ function CDegree(props, bInside)
type: DEGREE_SUPERSCRIPT type: DEGREE_SUPERSCRIPT
}; };
CMathBase.call(this, bInside); this.baseContent = new CMathContent();
this.iterContent = new CMathContent();
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
...@@ -29,7 +32,8 @@ CDegree.prototype.init = function(props) ...@@ -29,7 +32,8 @@ CDegree.prototype.init = function(props)
CDegree.prototype.fillContent = function() CDegree.prototype.fillContent = function()
{ {
this.setDimension(1, 2); this.setDimension(1, 2);
this.setContent(); this.elements[0][0] = this.baseContent;
this.elements[0][1] = this.iterContent;
}; };
CDegree.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) CDegree.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{ {
...@@ -277,17 +281,6 @@ CDegree.prototype.setProperties = function(props) ...@@ -277,17 +281,6 @@ CDegree.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
}; };
CDegree.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// Base
this.elements[0][0] = contents[0];
// Iterator
this.elements[0][1] = contents[1];
};
CDegree.prototype.setBase = function(base) CDegree.prototype.setBase = function(base)
{ {
this.elements[0][0] = base; this.elements[0][0] = base;
...@@ -312,26 +305,25 @@ CDegree.prototype.Refresh_RecalcData = function(Data) ...@@ -312,26 +305,25 @@ 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.getBase().Id ); Writer.WriteString2(this.Id);
Writer.WriteString2( this.getLowerIterator().Id ); Writer.WriteString2(this.baseContent.Id);
Writer.WriteString2(this.iterContent.Id);
this.CtrPrp.Write_ToBinary(Writer); this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong( this.Pr.type ); Writer.WriteLong( this.Pr.type );
}; };
CDegree.prototype.Read_FromBinary2 = function( Reader ) CDegree.prototype.Read_FromBinary2 = function( Reader )
{ {
var props = {ctrPrp: new CTextPr()}; this.Id = Reader.GetLong();
var arrElems = []; this.baseContent = g_oTableId.Get_ById(Reader.GetLong());
this.iterContent = g_oTableId.Get_ById(Reader.GetLong());
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
var props = {ctrPrp: new CTextPr()};
props.ctrPrp.Read_FromBinary(Reader); props.ctrPrp.Read_FromBinary(Reader);
props.type = Reader.GetLong(); props.type = Reader.GetLong();
this.fillMathComposition (props, arrElems); this.init(props);
}; };
CDegree.prototype.Get_Id = function() CDegree.prototype.Get_Id = function()
{ {
......
...@@ -1793,8 +1793,17 @@ CMathContent.prototype = ...@@ -1793,8 +1793,17 @@ CMathContent.prototype =
} }
}, },
Correct_Content : function() Correct_Content : function(bInnerCorrection)
{ {
if (true === bInnerCorrection)
{
for (var nPos = 0, nCount = this.content.length; nPos < nCount; nPos++)
{
if (para_Math_Composition === this.content[nPos].Type)
this.content[nPos].Correct_Content(true);
}
}
this.SetRunEmptyToContent(false); this.SetRunEmptyToContent(false);
// Удаляем лишние пустые раны // Удаляем лишние пустые раны
...@@ -1820,7 +1829,12 @@ CMathContent.prototype = ...@@ -1820,7 +1829,12 @@ CMathContent.prototype =
if(para_Math_Run === oCurrElement.Type) if(para_Math_Run === oCurrElement.Type)
oCurrElement.Math_Correct_Content(); oCurrElement.Math_Correct_Content();
}
// Если в контенте ничего нет, тогда добавляем пустой ран
if (this.content.length < 1)
{
this.Add_ToContent(0, new ParaRun(null, true));
} }
if (this.content.length == 1) if (this.content.length == 1)
......
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