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 )
};
CDegree.prototype.Read_FromBinary2 = function( Reader )
{
this.Id = Reader.GetLong();
this.baseContent = g_oTableId.Get_ById(Reader.GetLong());
this.iterContent = g_oTableId.Get_ById(Reader.GetLong());
this.Id = Reader.GetString2();
this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
this.iterContent = g_oTableId.Get_ById(Reader.GetString2());
var props = {ctrPrp: new CTextPr()};
props.ctrPrp.Read_FromBinary(Reader);
props.type = Reader.GetLong();
this.CtrPrp.Read_FromBinary(Reader);
this.Pr.type = Reader.GetLong();
this.init(props);
this.fillContent();
};
CDegree.prototype.Get_Id = function()
{
......
......@@ -899,6 +899,10 @@ CMathAmp.prototype =
IsAlignPoint: function()
{
return this.Type == para_Math_Ampersand;
},
Copy : function()
{
return new CMathAmp();
},
Write_ToBinary : function(Writer)
{
......
......@@ -21,6 +21,16 @@ CMathMatrixColumnPr.prototype.Set_FromObject = function(Obj)
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)
{
// Long : count
......@@ -103,6 +113,27 @@ CMathMatrixPr.prototype.Set_FromObject = function(Obj)
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()
{
var nColumnsCount = 0;
......@@ -626,6 +657,26 @@ CMathMatrix.prototype.getPropsForWrite = function()
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)
{
};
......@@ -726,6 +777,19 @@ CMathEqArrPr.prototype.Set_FromObject = function(Obj)
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)
{
// Long : maxDist
......@@ -971,13 +1035,21 @@ CEqArray.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CEqArray.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_eqArr );
}
CEqArray.prototype.Load_Changes = function(Reader)
CEqArray.prototype.Copy = function()
{
}
var oProps = this.Pr.Copy();
var NewEqArray = new CEqArray(oProps);
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)
{
}
......
......@@ -6,10 +6,10 @@
function CMathNaryPr()
{
this.chr = null;
this.chr = undefined;
this.chrType = NARY_INTEGRAL;
this.grow = false;
this.limLoc = null;
this.limLoc = undefined;
this.subHide = false;
this.supHide = false;
}
......@@ -32,44 +32,96 @@ CMathNaryPr.prototype.Set_FromObject = function(Obj)
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)
{
// Long : flags
// Long : chr
// Long : chrType
// Bool : grow
// Long : limLoc
// Bool : grow
// Bool : subHide
// Bool : supHide
Writer.WriteLong(this.chr === null ? -1 : this.chr);
var StartPos = Writer.GetCurPosition();
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.WriteLong(this.limLoc === null ? -1 : this.limLoc);
Writer.WriteBool(this.subHide);
Writer.WriteBool(this.supHide);
};
CMathNaryPr.prototype.Read_FromBinary = function(Reader)
{
// Long : flags
// Long : chr
// Long : chrType
// Bool : grow
// Long : limLoc
// Bool : grow
// Bool : subHide
// Bool : supHide
var Flags = Reader.GetLong();
if (Flags & 1)
this.chr = Reader.GetLong();
else
this.chr = undefined;
if (Flags & 2)
this.chrType = Reader.GetLong();
this.grow = Reader.GetBool();
else
this.chrType = undefined;
if (Flags & 4)
this.limLoc = Reader.GetLong();
else
this.limLoc = undefined;
this.grow = Reader.GetBool();
this.subHide = Reader.GetBool();
this.supHide = Reader.GetBool();
if (-1 === this.chr)
this.chr = null;
if (-1 === this.limLoc)
this.limLoc = null;
};
function CNary(props)
......@@ -379,6 +431,25 @@ CNary.prototype.getPropsForWrite = function()
{
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)
{
}
......
......@@ -3211,12 +3211,12 @@ COperator.prototype.IsArrow = function()
function CMathDelimiterPr()
{
this.begChr = null;
this.begChrType = null;
this.endChr = null;
this.endChrType = null;
this.sepChr = null;
this.sepChrType = null;
this.begChr = undefined;
this.begChrType = undefined;
this.endChr = undefined;
this.endChrType = undefined;
this.sepChr = undefined;
this.sepChrType = undefined;
this.shp = DELIMITER_SHAPE_CENTERED;
this.grow = true;
......@@ -3244,24 +3244,83 @@ CMathDelimiterPr.prototype.Set_FromObject = function(Obj)
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)
{
// Long : Flag
// Long : begChr
// Long : begChrType
// Long : endChr
// Long : endChrType
// Long : sepChr
// Long : sepChrType
// Long : shp
// Bool : grow
// Long : column
Writer.WriteLong(null === this.begChr ? -1 : this.begChr);
Writer.WriteLong(null === this.begChrType ? -1 : this.begChrType);
Writer.WriteLong(null === this.endChr ? -1 : this.endChr);
Writer.WriteLong(null === this.endChrType ? -1 : this.endChrType);
Writer.WriteLong(null === this.sepChr ? -1 : this.sepChr);
Writer.WriteLong(null === this.sepChrType ? -1 : this.sepChrType);
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
var Flags = 0;
if (undefined !== this.begChr)
{
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.WriteBool(this.grow);
Writer.WriteLong(this.column);
......@@ -3269,43 +3328,54 @@ CMathDelimiterPr.prototype.Write_ToBinary = function(Writer)
CMathDelimiterPr.prototype.Read_FromBinary = function(Reader)
{
// Long : Flags
// Long : begChr
// Long : begChrType
// Long : endChr
// Long : endChrType
// Long : sepChr
// Long : sepChrType
// Long : shp
// Bool : grow
// Long : column
var Flags = Reader.GetLong();
if (Flags & 1)
this.begChr = Reader.GetLong();
else
this.begChr = undefined;
if (Flags & 2)
this.begChrType = Reader.GetLong();
else
this.begChrType = undefined;
if (Flags & 4)
this.endChr = Reader.GetLong();
else
this.endChr = undefined;
if (Flags & 8)
this.endChrType = Reader.GetLong();
else
this.endChrType = undefined;
if (Flags & 16)
this.sepChr = Reader.GetLong();
else
this.sepChr = undefined;
if (Flags & 32)
this.sepChrType = Reader.GetLong();
else
this.sepChrType = undefined;
this.shp = Reader.GetLong();
this.grow = Reader.GetBool();
this.column = Reader.GetLong();
if (-1 === this.begChr)
this.begChr = null;
if (-1 === this.begChrType)
this.begChrType = null;
if (-1 === this.endChr)
this.endChr = null;
if (-1 === this.endChrType)
this.endChrType = null;
if (-1 === this.sepChr)
this.sepChr = null;
if (-1 === this.sepChrType)
this.sepChrType = null;
};
function CDelimiter(props)
......@@ -3335,8 +3405,6 @@ CDelimiter.prototype.init = function(props)
CDelimiter.prototype.setProperties = function(props)
{
this.Pr.Set_FromObject(props);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
}
CDelimiter.prototype.getColumnsCount = function()
......@@ -3691,6 +3759,23 @@ CDelimiter.prototype.getPropsForWrite = function()
{
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)
{
}
......
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