Commit 3df5aaa4 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Запись в историю св-ва ArgSize в CMathContent

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64165 954022d7-b5bf-4e40-9824-e11837661b57
parent 8cf40391
...@@ -2660,6 +2660,7 @@ var historyitem_Math_RFontsCS = 17; ...@@ -2660,6 +2660,7 @@ var historyitem_Math_RFontsCS = 17;
var historyitem_Math_RFontsEastAsia = 18; var historyitem_Math_RFontsEastAsia = 18;
var historyitem_Math_RFontsHint = 19; var historyitem_Math_RFontsHint = 19;
var historyitem_Math_CtrPrpHighLight = 20; var historyitem_Math_CtrPrpHighLight = 20;
var historyitem_Math_ArgSize = 21;
function ReadChanges_FromBinary(Reader, Class) function ReadChanges_FromBinary(Reader, Class)
......
...@@ -325,19 +325,20 @@ CMathArgSize.prototype = ...@@ -325,19 +325,20 @@ CMathArgSize.prototype =
{ {
this.value = ArgSize.value; this.value = ArgSize.value;
}, },
Get: function() GetValue: function()
{ {
return this.value; return this.value;
}, },
SetValue: function(val) SetValue: function(val)
{ {
if(val < - 2) if(val === null || val === undefined)
val = undefined;
else if(val < - 2)
this.value = -2; this.value = -2;
else if(val > 2) else if(val > 2)
this.value = 2; this.value = 2;
else else
this.value = val; this.value = val;
}, },
Copy: function() Copy: function()
{ {
...@@ -355,6 +356,29 @@ CMathArgSize.prototype = ...@@ -355,6 +356,29 @@ CMathArgSize.prototype =
ArgSize.value = 0; ArgSize.value = 0;
this.SetValue(this.value + ArgSize.value); this.SetValue(this.value + ArgSize.value);
},
Write_ToBinary: function(Writer)
{
if(this.value == undefined)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteLong(this.value);
}
},
Read_FromBinary: function(Reader)
{
if(Reader.GetBool() == false)
{
this.value = Reader.GetLong();
}
else
{
this.value = undefined;
}
} }
}; };
...@@ -1665,6 +1689,11 @@ CMathContent.prototype.Internal_Content_Add = function(Pos, Item, bUpdatePositio ...@@ -1665,6 +1689,11 @@ CMathContent.prototype.Internal_Content_Add = function(Pos, Item, bUpdatePositio
this.private_UpdatePosOnAdd(Pos, bUpdatePosition); this.private_UpdatePosOnAdd(Pos, bUpdatePosition);
}; };
CMathContent.prototype.Apply_ArgSize = function(ArgSize)
{
History.Add( this, { Type : historyitem_Math_ArgSize, New: ArgSize, Old: this.ArgSize.GetValue()});
this.ArgSize.SetValue(ArgSize);
};
CMathContent.prototype.private_UpdatePosOnAdd = function(Pos, bUpdatePosition) CMathContent.prototype.private_UpdatePosOnAdd = function(Pos, bUpdatePosition)
{ {
if(bUpdatePosition !== false) if(bUpdatePosition !== false)
...@@ -1844,7 +1873,7 @@ CMathContent.prototype.CopyTo = function(OtherContent, Selected) ...@@ -1844,7 +1873,7 @@ CMathContent.prototype.CopyTo = function(OtherContent, Selected)
} }
OtherContent.plHid = this.plhHide; OtherContent.plHid = this.plhHide;
OtherContent.SetArgSize(this.ArgSize.Get()); OtherContent.Apply_ArgSize(this.ArgSize.GetValue());
for(var nPos = nStartPos; nPos <= nEndPos; nPos++) for(var nPos = nStartPos; nPos <= nEndPos; nPos++)
{ {
...@@ -1927,6 +1956,11 @@ CMathContent.prototype.Undo = function(Data) ...@@ -1927,6 +1956,11 @@ CMathContent.prototype.Undo = function(Data)
break; break;
} }
case historyitem_Math_ArgSize:
{
this.ArgSize.SetValue(Data.Old);
break;
}
} }
}; };
CMathContent.prototype.Redo = function(Data) CMathContent.prototype.Redo = function(Data)
...@@ -1952,6 +1986,11 @@ CMathContent.prototype.Redo = function(Data) ...@@ -1952,6 +1986,11 @@ CMathContent.prototype.Redo = function(Data)
break; break;
} }
case historyitem_Math_ArgSize:
{
this.ArgSize.SetValue(Data.New);
break;
}
} }
}; };
CMathContent.prototype.Save_Changes = function(Data, Writer) CMathContent.prototype.Save_Changes = function(Data, Writer)
...@@ -1998,6 +2037,20 @@ CMathContent.prototype.Save_Changes = function(Data, Writer) ...@@ -1998,6 +2037,20 @@ CMathContent.prototype.Save_Changes = function(Data, Writer)
Writer.WriteLong(Data.Pos); Writer.WriteLong(Data.Pos);
} }
break;
}
case historyitem_Math_ArgSize:
{
if(undefined !== Data.New)
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
{
Writer.WriteBool( true );
}
break; break;
} }
} }
...@@ -2051,6 +2104,19 @@ CMathContent.prototype.Load_Changes = function(Reader) ...@@ -2051,6 +2104,19 @@ CMathContent.prototype.Load_Changes = function(Reader)
this.Content.splice(ChangesPos, 1); this.Content.splice(ChangesPos, 1);
} }
break;
}
case historyitem_Math_ArgSize:
{
if(false === Reader.GetBool())
{
this.ArgSize.SetValue(Reader.GetLong())
}
else
{
this.ArgSize.SetValue(undefined);
}
break; break;
} }
} }
......
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