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

Устранены падения в совместном редкатировании при изменении настроек текста...

Устранены падения в совместном редкатировании при изменении настроек текста внутри формул. Сделано, чтобы формулы пересчитывались после Undo/Redo/совместное редактирование при измнении текстовых настроек.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58726 954022d7-b5bf-4e40-9824-e11837661b57
parent 26dd8b3a
......@@ -1694,3 +1694,61 @@ ParaMath.prototype.Make_AutoCorrect = function()
{
return false;
};
//----------------------------------------------------------------------------------------------------------------------
// Классы с изменениями
//----------------------------------------------------------------------------------------------------------------------
var historyitem_Math_AddItem = 1; // Добавляем элемент
var historyitem_Math_RemoveItem = 2; // Удаляем элемент
var historyitem_Math_CtrPrpFSize = 3; // CtrPrp
function ReadChanges_FromBinary(Reader, Class)
{
var Type = Reader.GetLong();
var Changes = null;
switch(Type)
{
case historyitem_Math_CtrPrpFSize: Changes = new CChangesMathFontSize(); break;
}
if (null !== Changes)
Changes.Load_Changes(Reader, Class);
}
function WriteChanges_ToBinary(Changes, Writer)
{
Writer.WriteLong(Changes.Type);
Changes.Save_Changes(Writer);
}
//----------------------------------------------------------------------------------------------------------------------
// Классы с изменениями
//----------------------------------------------------------------------------------------------------------------------
function CChangesMathFontSize(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathFontSize.prototype.Type = historyitem_Math_CtrPrpFSize;
CChangesMathFontSize.prototype.Undo = function(Class)
{
Class.raw_SetFontSize(this.Old);
};
CChangesMathFontSize.prototype.Redo = function(Class)
{
Class.raw_SetFontSize(this.New);
};
CChangesMathFontSize.prototype.Save_Changes = function(Writer)
{
// Long : New
Writer.WriteLong(this.New);
};
CChangesMathFontSize.prototype.Load_Changes = function(Reader, Class)
{
this.New = Reader.GetLong();
this.Redo(Class);
};
\ No newline at end of file
......@@ -641,13 +641,6 @@ CAccent.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true;
}
CAccent.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_acc );
}
CAccent.prototype.Load_Changes = function(Reader)
{
}
CAccent.prototype.Refresh_RecalcData = function(Data)
{
}
......
......@@ -1145,9 +1145,17 @@ CMathBase.prototype =
},
Set_FontSizeCtrPrp: function(Value)
{
History.Add( this, { Type : historyitem_Math_CtrPrpFSize, New : Value, Old : this.CtrPrp.FontSize } );
this.CtrPrp.FontSize = Value;
History.Add(this, new CChangesMathFontSize(Value, this.CtrPrp.FontSize));
this.raw_SetFontSize(Value);
},
raw_SetFontSize : function(Value)
{
this.CtrPrp.FontSize = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
Set_Select_ToMComp: function(Direction)
{
......@@ -1209,33 +1217,11 @@ CMathBase.prototype =
},
Undo: function(Data)
{
var type = Data.Type;
switch(type)
{
case historyitem_Math_CtrPrpFSize:
{
this.CtrPrp.FontSize = Data.Old;
this.RecalcInfo.bCtrPrp = true;
break;
}
}
Data.Undo(this);
},
Redo: function(Data)
{
var type = Data.Type;
switch(type)
{
case historyitem_Math_CtrPrpFSize:
{
this.CtrPrp.FontSize = Data.New;
this.RecalcInfo.bCtrPrp = true;
break;
}
}
Data.Redo(this);
},
Refresh_RecalcData: function()
{
......@@ -1244,11 +1230,11 @@ CMathBase.prototype =
},
Save_Changes: function(Data, Writer)
{
WriteChanges_ToBinary(Data, Writer);
},
Load_Changes : function(Reader)
{
ReadChanges_FromBinary(Reader, this);
}
//////////////////////////
......
......@@ -322,13 +322,6 @@ CBorderBox.prototype.getPropsForWrite = function()
return this.Pr;
}
CBorderBox.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_borderBox );
}
CBorderBox.prototype.Load_Changes = function(Reader)
{
}
CBorderBox.prototype.Refresh_RecalcData = function(Data)
{
}
......
......@@ -238,13 +238,6 @@ CDegree.prototype.getPropsForWrite = function()
{
return this.Pr;
};
CDegree.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_deg );
};
CDegree.prototype.Load_Changes = function(Reader)
{
};
CDegree.prototype.Refresh_RecalcData = function(Data)
{
};
......@@ -559,13 +552,6 @@ CDegreeSubSup.prototype.getPropsForWrite = function()
{
return this.Pr;
};
CDegreeSubSup.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_deg_subsup );
};
CDegreeSubSup.prototype.Load_Changes = function(Reader)
{
};
CDegreeSubSup.prototype.Refresh_RecalcData = function(Data)
{
};
......
......@@ -395,13 +395,6 @@ CFraction.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CFraction.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_frac );
}
CFraction.prototype.Load_Changes = function(Reader)
{
}
CFraction.prototype.Refresh_RecalcData = function(Data)
{
}
......
......@@ -163,13 +163,6 @@ CLimit.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CLimit.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_lim );
}
CLimit.prototype.Load_Changes = function(Reader)
{
}
CLimit.prototype.Refresh_RecalcData = function(Data)
{
}
......
......@@ -30,11 +30,6 @@
// 3. Проверить что будет, если какие-то настройки убрать/добавить из ctrPrp, влияют ли они на отрисовку управляющих элементов (например, Italic, Bold)
// 4. Протестировать n-арные операторы, когда добавляется текст вместо оператора (mouseDown не работает, выравнено как alignTop)
var historyitem_Math_AddItem = 1; // Добавляем элемент
var historyitem_Math_RemoveItem = 2; // Удаляем элемент
var historyitem_Math_CtrPrpFSize = 3; // CtrPrp
function CRPI()
{
//this.UpdateMathPr = true;
......
......@@ -620,13 +620,6 @@ CMathMatrix.prototype.getPropsForWrite = function()
return props;
};
CMathMatrix.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_matrix );
};
CMathMatrix.prototype.Load_Changes = function(Reader)
{
};
CMathMatrix.prototype.Refresh_RecalcData = function(Data)
{
};
......
......@@ -379,13 +379,6 @@ CNary.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CNary.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_nary );
}
CNary.prototype.Load_Changes = function(Reader)
{
}
CNary.prototype.Refresh_RecalcData = function(Data)
{
}
......
......@@ -3691,13 +3691,6 @@ CDelimiter.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CDelimiter.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_delimiter );
}
CDelimiter.prototype.Load_Changes = function(Reader)
{
}
CDelimiter.prototype.Refresh_RecalcData = function(Data)
{
}
......
......@@ -1168,13 +1168,6 @@ CRadical.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CRadical.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_rad );
}
CRadical.prototype.Load_Changes = function(Reader)
{
}
CRadical.prototype.Refresh_RecalcData = function(Data)
{
}
......
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