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

Исправлен баг в чтении класса CDegree в совместном редкатировании. Исправлен...

Исправлен баг в чтении класса CDegree в совместном редкатировании. Исправлен баг с копированием не текстовых элементов в формулах. Переделаны функции копирования для классов CEqArray, CNary, CDelimiter, CRadical. Переделаны функции корректировки контента для классов CDelimiter, CRadical, CNary. Исправлены баги при передаче типа управляемого символа для классов CDelimiter и CNary.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58801 954022d7-b5bf-4e40-9824-e11837661b57
parent 5b2406dc
...@@ -267,15 +267,14 @@ CDegree.prototype.Write_ToBinary2 = function( Writer ) ...@@ -267,15 +267,14 @@ CDegree.prototype.Write_ToBinary2 = function( Writer )
}; };
CDegree.prototype.Read_FromBinary2 = function( Reader ) CDegree.prototype.Read_FromBinary2 = function( Reader )
{ {
this.Id = Reader.GetLong(); this.Id = Reader.GetString2();
this.baseContent = g_oTableId.Get_ById(Reader.GetLong()); this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
this.iterContent = g_oTableId.Get_ById(Reader.GetLong()); this.iterContent = g_oTableId.Get_ById(Reader.GetString2());
var props = {ctrPrp: new CTextPr()}; this.CtrPrp.Read_FromBinary(Reader);
props.ctrPrp.Read_FromBinary(Reader); this.Pr.type = Reader.GetLong();
props.type = Reader.GetLong();
this.init(props); this.fillContent();
}; };
CDegree.prototype.Get_Id = function() CDegree.prototype.Get_Id = function()
{ {
......
...@@ -899,6 +899,10 @@ CMathAmp.prototype = ...@@ -899,6 +899,10 @@ CMathAmp.prototype =
IsAlignPoint: function() IsAlignPoint: function()
{ {
return this.Type == para_Math_Ampersand; return this.Type == para_Math_Ampersand;
},
Copy : function()
{
return new CMathAmp();
}, },
Write_ToBinary : function(Writer) Write_ToBinary : function(Writer)
{ {
......
...@@ -21,6 +21,16 @@ CMathMatrixColumnPr.prototype.Set_FromObject = function(Obj) ...@@ -21,6 +21,16 @@ CMathMatrixColumnPr.prototype.Set_FromObject = function(Obj)
this.mcJc = MCJC_CENTER; this.mcJc = MCJC_CENTER;
}; };
CMathMatrixColumnPr.prototype.Copy = function()
{
var NewPr = new CMathMatrixColumnPr();
NewPr.count = this.count;
NewPr.mcJc = this.mcJc;
return NewPr;
};
CMathMatrixColumnPr.prototype.Write_ToBinary = function(Writer) CMathMatrixColumnPr.prototype.Write_ToBinary = function(Writer)
{ {
// Long : count // Long : count
...@@ -103,6 +113,27 @@ CMathMatrixPr.prototype.Set_FromObject = function(Obj) ...@@ -103,6 +113,27 @@ CMathMatrixPr.prototype.Set_FromObject = function(Obj)
return nColumnsCount; return nColumnsCount;
}; };
CMathMatrixPr.prototype.Copy = function()
{
var NewPr = new CMathMatrixPr();
NewPr.row = this.row ;
NewPr.cGp = this.cGp ;
NewPr.cGpRule = this.cGpRule;
NewPr.cSp = this.cSp ;
NewPr.rSp = this.rSp ;
NewPr.rSpRule = this.rSpRule;
NewPr.baseJc = this.baseJc ;
NewPr.plcHide = this.plcHide;
var nCount = this.mcs.length;
for (var nMcsIndex = 0; nMcsIndex < nCount; nMcsIndex++)
{
NewPr.mcs[nMcsIndex] = this.mcs[nMcsIndex].Copy();
}
return NewPr;
};
CMathMatrixPr.prototype.Get_ColumnsCount = function() CMathMatrixPr.prototype.Get_ColumnsCount = function()
{ {
var nColumnsCount = 0; var nColumnsCount = 0;
...@@ -626,6 +657,26 @@ CMathMatrix.prototype.getPropsForWrite = function() ...@@ -626,6 +657,26 @@ CMathMatrix.prototype.getPropsForWrite = function()
return props; return props;
}; };
CMathMatrix.prototype.Copy = function()
{
var oProps = this.Pr.Copy();
oProps.ctrPrp = this.CtrPrp.Copy();
var NewMatrix = new CMathMatrix(oProps);
var nRowsCount = this.getRowsCount();
var nColsCount = this.getColsCount();
for(var nRowIndex = 0; nRowIndex < nRowsCount; nRowIndex++)
{
for (var nColIndex = 0; nColIndex < nColsCount; nColIndex++)
{
this.elements[nRowIndex][nColIndex].CopyTo(NewMatrix.elements[nRowIndex][nColIndex], false);
}
}
return NewMatrix;
};
CMathMatrix.prototype.Refresh_RecalcData = function(Data) CMathMatrix.prototype.Refresh_RecalcData = function(Data)
{ {
}; };
...@@ -726,6 +777,19 @@ CMathEqArrPr.prototype.Set_FromObject = function(Obj) ...@@ -726,6 +777,19 @@ CMathEqArrPr.prototype.Set_FromObject = function(Obj)
this.baseJc = Obj.baseJc; this.baseJc = Obj.baseJc;
}; };
CMathEqArrPr.prototype.Copy = function()
{
var NewPr = new CMathEqArrPr();
NewPr.maxDist = this.maxDist;
NewPr.objDist = this.objDist;
NewPr.rSp = this.rSp ;
NewPr.rSpRule = this.rSpRule;
NewPr.baseJc = this.baseJc ;
return NewPr;
};
CMathEqArrPr.prototype.Write_ToBinary = function(Writer) CMathEqArrPr.prototype.Write_ToBinary = function(Writer)
{ {
// Long : maxDist // Long : maxDist
...@@ -971,13 +1035,21 @@ CEqArray.prototype.getPropsForWrite = function() ...@@ -971,13 +1035,21 @@ CEqArray.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
} }
CEqArray.prototype.Save_Changes = function(Data, Writer) CEqArray.prototype.Copy = function()
{ {
Writer.WriteLong( historyitem_type_eqArr ); var oProps = this.Pr.Copy();
} var NewEqArray = new CEqArray(oProps);
CEqArray.prototype.Load_Changes = function(Reader)
{ var nRowsCount = this.elements.length;
} NewEqArray.setDimension(nRowsCount, 1);
NewEqArray.setContent();
for (var nRowIndex = 0; nRowIndex < nRowsCount; nRowIndex++)
{
this.elements[nRowIndex][0].CopyTo(NewEqArray.elements[nRowIndex][0], false);
}
return NewEqArray;
};
CEqArray.prototype.Refresh_RecalcData = function(Data) CEqArray.prototype.Refresh_RecalcData = function(Data)
{ {
} }
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
function CMathNaryPr() function CMathNaryPr()
{ {
this.chr = null; this.chr = undefined;
this.chrType = NARY_INTEGRAL; this.chrType = NARY_INTEGRAL;
this.grow = false; this.grow = false;
this.limLoc = null; this.limLoc = undefined;
this.subHide = false; this.subHide = false;
this.supHide = false; this.supHide = false;
} }
...@@ -32,44 +32,96 @@ CMathNaryPr.prototype.Set_FromObject = function(Obj) ...@@ -32,44 +32,96 @@ CMathNaryPr.prototype.Set_FromObject = function(Obj)
this.supHide = true; this.supHide = true;
}; };
CMathNaryPr.prototype.Copy = function()
{
var NewPr = new CMathNaryPr();
NewPr.chr = this.chr ;
NewPr.chrType = this.chrType;
NewPr.grow = this.grow ;
NewPr.limLoc = this.limLoc ;
NewPr.subHide = this.subHide;
NewPr.supHide = this.supHide;
return NewPr;
};
CMathNaryPr.prototype.Write_ToBinary = function(Writer) CMathNaryPr.prototype.Write_ToBinary = function(Writer)
{ {
// Long : flags
// Long : chr // Long : chr
// Long : chrType // Long : chrType
// Bool : grow
// Long : limLoc // Long : limLoc
// Bool : grow
// Bool : subHide // Bool : subHide
// Bool : supHide // Bool : supHide
Writer.WriteLong(this.chr === null ? -1 : this.chr); var StartPos = Writer.GetCurPosition();
Writer.WriteLong(this.chrType); Writer.Skip(4);
var Flags = 0;
if (undefined !== this.chr)
{
Writer.WriteLong(this.chr);
Flags |= 1;
}
if (undefined !== this.chrType)
{
Writer.WriteLong(this.chrType);
Flags |= 2;
}
if (undefined !== this.limLoc)
{
Writer.WriteLong(this.limLoc);
Flags |= 4;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek(StartPos);
Writer.WriteLong(Flags);
Writer.Seek(EndPos);
Writer.WriteBool(this.grow); Writer.WriteBool(this.grow);
Writer.WriteLong(this.limLoc === null ? -1 : this.limLoc);
Writer.WriteBool(this.subHide); Writer.WriteBool(this.subHide);
Writer.WriteBool(this.supHide); Writer.WriteBool(this.supHide);
}; };
CMathNaryPr.prototype.Read_FromBinary = function(Reader) CMathNaryPr.prototype.Read_FromBinary = function(Reader)
{ {
// Long : flags
// Long : chr // Long : chr
// Long : chrType // Long : chrType
// Bool : grow
// Long : limLoc // Long : limLoc
// Bool : grow
// Bool : subHide // Bool : subHide
// Bool : supHide // Bool : supHide
this.chr = Reader.GetLong(); var Flags = Reader.GetLong();
this.chrType = Reader.GetLong();
if (Flags & 1)
this.chr = Reader.GetLong();
else
this.chr = undefined;
if (Flags & 2)
this.chrType = Reader.GetLong();
else
this.chrType = undefined;
if (Flags & 4)
this.limLoc = Reader.GetLong();
else
this.limLoc = undefined;
this.grow = Reader.GetBool(); this.grow = Reader.GetBool();
this.limLoc = Reader.GetLong();
this.subHide = Reader.GetBool(); this.subHide = Reader.GetBool();
this.supHide = Reader.GetBool(); this.supHide = Reader.GetBool();
if (-1 === this.chr)
this.chr = null;
if (-1 === this.limLoc)
this.limLoc = null;
}; };
function CNary(props) function CNary(props)
...@@ -379,6 +431,25 @@ CNary.prototype.getPropsForWrite = function() ...@@ -379,6 +431,25 @@ CNary.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
} }
CNary.prototype.Correct_Content = function(bInnerCorrection)
{
this.LowerIterator.Correct_Content(bInnerCorrection);
this.UpperIterator.Correct_Content(bInnerCorrection);
this.Arg.Correct_Content(bInnerCorrection);
};
CNary.prototype.Copy = function()
{
var oProps = this.Pr.Copy();
oProps.ctrPrp = this.CtrPrp.Copy();
var NewNAry = new CNary(oProps);
this.LowerIterator.CopyTo(NewNAry.LowerIterator, false);
this.UpperIterator.CopyTo(NewNAry.UpperIterator, false);
this.Arg.CopyTo(NewNAry.Arg, false);
return NewNAry;
};
CNary.prototype.Refresh_RecalcData = function(Data) CNary.prototype.Refresh_RecalcData = function(Data)
{ {
} }
......
...@@ -3211,12 +3211,12 @@ COperator.prototype.IsArrow = function() ...@@ -3211,12 +3211,12 @@ COperator.prototype.IsArrow = function()
function CMathDelimiterPr() function CMathDelimiterPr()
{ {
this.begChr = null; this.begChr = undefined;
this.begChrType = null; this.begChrType = undefined;
this.endChr = null; this.endChr = undefined;
this.endChrType = null; this.endChrType = undefined;
this.sepChr = null; this.sepChr = undefined;
this.sepChrType = null; this.sepChrType = undefined;
this.shp = DELIMITER_SHAPE_CENTERED; this.shp = DELIMITER_SHAPE_CENTERED;
this.grow = true; this.grow = true;
...@@ -3244,24 +3244,83 @@ CMathDelimiterPr.prototype.Set_FromObject = function(Obj) ...@@ -3244,24 +3244,83 @@ CMathDelimiterPr.prototype.Set_FromObject = function(Obj)
this.column = 1; this.column = 1;
}; };
CMathDelimiterPr.prototype.Copy = function()
{
var NewPr = new CMathDelimiterPr();
NewPr.begChr = this.begChr ;
NewPr.begChrType = this.begChrType;
NewPr.endChr = this.endChr ;
NewPr.endChrType = this.endChrType;
NewPr.sepChr = this.sepChr ;
NewPr.sepChrType = this.sepChrType;
NewPr.shp = this.shp ;
NewPr.grow = this.grow ;
NewPr.column = this.column ;
return NewPr;
};
CMathDelimiterPr.prototype.Write_ToBinary = function(Writer) CMathDelimiterPr.prototype.Write_ToBinary = function(Writer)
{ {
// Long : Flag
// Long : begChr // Long : begChr
// Long : begChrType // Long : begChrType
// Long : endChr // Long : endChr
// Long : endChrType // Long : endChrType
// Long : sepChr // Long : sepChr
// Long : sepChrType // Long : sepChrType
// Long : shp // Long : shp
// Bool : grow // Bool : grow
// Long : column // Long : column
Writer.WriteLong(null === this.begChr ? -1 : this.begChr); var StartPos = Writer.GetCurPosition();
Writer.WriteLong(null === this.begChrType ? -1 : this.begChrType); Writer.Skip(4);
Writer.WriteLong(null === this.endChr ? -1 : this.endChr); var Flags = 0;
Writer.WriteLong(null === this.endChrType ? -1 : this.endChrType);
Writer.WriteLong(null === this.sepChr ? -1 : this.sepChr); if (undefined !== this.begChr)
Writer.WriteLong(null === this.sepChrType ? -1 : this.sepChrType); {
Writer.WriteLong(this.begChr);
Flags |= 1;
}
if (undefined !== this.begChrType)
{
Writer.WriteLong(this.begChrType);
Flags |= 2;
}
if (undefined !== this.endChr)
{
Writer.WriteLong(this.endChr);
Flags |= 4;
}
if (undefined !== this.endChrType)
{
Writer.WriteLong(this.endChrType);
Flags |= 8;
}
if (undefined !== this.sepChr)
{
Writer.WriteLong(this.sepChr);
Flags |= 16;
}
if (undefined !== this.sepChrType)
{
Writer.WriteLong(this.sepChrType);
Flags |= 32;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek(StartPos);
Writer.WriteLong(Flags);
Writer.Seek(EndPos);
Writer.WriteLong(this.shp); Writer.WriteLong(this.shp);
Writer.WriteBool(this.grow); Writer.WriteBool(this.grow);
Writer.WriteLong(this.column); Writer.WriteLong(this.column);
...@@ -3269,43 +3328,54 @@ CMathDelimiterPr.prototype.Write_ToBinary = function(Writer) ...@@ -3269,43 +3328,54 @@ CMathDelimiterPr.prototype.Write_ToBinary = function(Writer)
CMathDelimiterPr.prototype.Read_FromBinary = function(Reader) CMathDelimiterPr.prototype.Read_FromBinary = function(Reader)
{ {
// Long : Flags
// Long : begChr // Long : begChr
// Long : begChrType // Long : begChrType
// Long : endChr // Long : endChr
// Long : endChrType // Long : endChrType
// Long : sepChr // Long : sepChr
// Long : sepChrType // Long : sepChrType
// Long : shp // Long : shp
// Bool : grow // Bool : grow
// Long : column // Long : column
this.begChr = Reader.GetLong(); var Flags = Reader.GetLong();
this.begChrType = Reader.GetLong();
this.endChr = Reader.GetLong(); if (Flags & 1)
this.endChrType = Reader.GetLong(); this.begChr = Reader.GetLong();
this.sepChr = Reader.GetLong(); else
this.sepChrType = Reader.GetLong(); this.begChr = undefined;
this.shp = Reader.GetLong();
this.grow = Reader.GetBool();
this.column = Reader.GetLong();
if (-1 === this.begChr) if (Flags & 2)
this.begChr = null; this.begChrType = Reader.GetLong();
else
this.begChrType = undefined;
if (-1 === this.begChrType) if (Flags & 4)
this.begChrType = null; this.endChr = Reader.GetLong();
else
this.endChr = undefined;
if (-1 === this.endChr) if (Flags & 8)
this.endChr = null; this.endChrType = Reader.GetLong();
else
this.endChrType = undefined;
if (-1 === this.endChrType) if (Flags & 16)
this.endChrType = null; this.sepChr = Reader.GetLong();
else
this.sepChr = undefined;
if (-1 === this.sepChr) if (Flags & 32)
this.sepChr = null; this.sepChrType = Reader.GetLong();
else
this.sepChrType = undefined;
if (-1 === this.sepChrType) this.shp = Reader.GetLong();
this.sepChrType = null; this.grow = Reader.GetBool();
this.column = Reader.GetLong();
}; };
function CDelimiter(props) function CDelimiter(props)
...@@ -3335,9 +3405,7 @@ CDelimiter.prototype.init = function(props) ...@@ -3335,9 +3405,7 @@ CDelimiter.prototype.init = function(props)
CDelimiter.prototype.setProperties = function(props) CDelimiter.prototype.setProperties = function(props)
{ {
this.Pr.Set_FromObject(props); this.Pr.Set_FromObject(props);
this.setCtrPrp(props.ctrPrp);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
} }
CDelimiter.prototype.getColumnsCount = function() CDelimiter.prototype.getColumnsCount = function()
{ {
...@@ -3691,6 +3759,23 @@ CDelimiter.prototype.getPropsForWrite = function() ...@@ -3691,6 +3759,23 @@ CDelimiter.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
} }
CDelimiter.prototype.Copy = function()
{
var oProps = this.Pr.Copy();
oProps.ctrPrp = this.CtrPrp.Copy();
var NewDelimiter = new CDelimiter(oProps);
var nColsCount = this.getColumnsCount();
NewDelimiter.setDimension(1, nColsCount);
NewDelimiter.setContent();
for (var nColIndex = 0; nColIndex < nColsCount; nColIndex++)
this.elements[0][nColIndex].CopyTo(NewDelimiter.elements[0][nColIndex], false);
return NewDelimiter;
};
CDelimiter.prototype.Refresh_RecalcData = function(Data) CDelimiter.prototype.Refresh_RecalcData = function(Data)
{ {
} }
......
This diff is collapsed.
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