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

Устранено падение при обработке добавления новой строки в формулах.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59388 954022d7-b5bf-4e40-9824-e11837661b57
parent 157798a2
......@@ -1832,9 +1832,10 @@ ParaMath.prototype.Get_Bounds = function()
var historyitem_Math_AddItem = 1; // Добавляем элемент
var historyitem_Math_RemoveItem = 2; // Удаляем элемент
var historyitem_Math_CtrPrpFSize = 3; // CtrPrp
var hisotryitem_Math_ParaJc = 4; // ParaMath.Jc
var historyitem_Math_ParaJc = 4; // ParaMath.Jc
var historyitem_Math_CtrPrpShd = 5;
var historyitem_Math_AddItems_ToMathBase = 6;
var historyitem_Math_EqArrayPr = 7; // Изменение настроек у CEqArray
function ReadChanges_FromBinary(Reader, Class)
{
......@@ -1844,7 +1845,7 @@ function ReadChanges_FromBinary(Reader, Class)
switch(Type)
{
case historyitem_Math_CtrPrpFSize : Changes = new CChangesMathFontSize(); break;
case hisotryitem_Math_ParaJc : Changes = new CChangesMathParaJc(); break;
case historyitem_Math_ParaJc : Changes = new CChangesMathParaJc(); break;
case historyitem_Math_CtrPrpShd : Changes = new CChangesMathShd(); break;
case historyitem_Math_AddItems_ToMathBase : Changes = new CChangesMathAddItems(); break;
}
......@@ -2004,7 +2005,7 @@ function CChangesMathParaJc(NewValue, OldValue)
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathParaJc.prototype.Type = hisotryitem_Math_ParaJc;
CChangesMathParaJc.prototype.Type = historyitem_Math_ParaJc;
CChangesMathParaJc.prototype.Undo = function(Class)
{
Class.raw_SetAlign(this.Old);
......@@ -2034,3 +2035,43 @@ CChangesMathParaJc.prototype.Load_Changes = function(Reader, Class)
this.Redo(Class);
};
function CChangesMathEqArrayPr(NewPr, OldPr)
{
this.New = NewPr;
this.Old = OldPr;
}
CChangesMathEqArrayPr.prototype.Type = historyitem_Math_EqArrayPr;
CChangesMathEqArrayPr.prototype.Undo = function(Class)
{
Class.raw_SetPr(this.Old);
};
CChangesMathEqArrayPr.prototype.Redo = function(Class)
{
Class.raw_SetPr(this.New);
};
CChangesMathEqArrayPr.prototype.Save_Changes = function(Writer)
{
// Bool : undefined?
// Long : value
if (undefined === this.New)
Writer.WriteBool(true);
else
{
Writer.WriteBool(false);
this.New.Write_ToBinary(Writer);
}
};
CChangesMathEqArrayPr.prototype.Load_Changes = function(Reader, Class)
{
if (true === Reader.GetBool())
this.New = undefined;
else
{
this.New = new CMathEqArrPr();
this.New.Read_FromBinary(Reader);
}
this.Redo(Class);
};
\ No newline at end of file
......@@ -689,8 +689,22 @@ CEqArray.prototype.addRow = function()
this.protected_AddToContent(this.CurPos + 1, [NewContent], true);
this.CurPos++;
var NewPr = this.Pr.Copy();
NewPr.row = this.Content.length;
this.setPr(NewPr);
return NewContent;
}
CEqArray.prototype.setPr = function(NewPr)
{
History.Add(this, new CChangesMathEqArrayPr(NewPr, this.Pr));
this.raw_SetPr(NewPr);
};
CEqArray.prototype.raw_SetPr = function(NewPr)
{
this.Pr = NewPr;
this.private_SetNeedResize();
}
CEqArray.prototype.fillContent = function()
{
var nRowsCount = this.Content.length;
......
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