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

Undo/Redo и совместное редактирование для заливки

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59316 954022d7-b5bf-4e40-9824-e11837661b57
parent 9e4145e0
...@@ -396,6 +396,7 @@ ParaMath.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll) ...@@ -396,6 +396,7 @@ ParaMath.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
this.NeedResize = true; this.NeedResize = true;
if(ApplyToAll == true) // для ситуации, когда ApplyToAll = true, в Root формулы при этом позиции селекта не проставлены if(ApplyToAll == true) // для ситуации, когда ApplyToAll = true, в Root формулы при этом позиции селекта не проставлены
{ {
this.Root.Apply_TextPr(TextPr, IncFontSize, true); this.Root.Apply_TextPr(TextPr, IncFontSize, true);
...@@ -1814,6 +1815,7 @@ var historyitem_Math_AddItem = 1; // Добавляем эл ...@@ -1814,6 +1815,7 @@ var historyitem_Math_AddItem = 1; // Добавляем эл
var historyitem_Math_RemoveItem = 2; // Удаляем элемент var historyitem_Math_RemoveItem = 2; // Удаляем элемент
var historyitem_Math_CtrPrpFSize = 3; // CtrPrp var historyitem_Math_CtrPrpFSize = 3; // CtrPrp
var hisotryitem_Math_ParaJc = 4; // ParaMath.Jc var hisotryitem_Math_ParaJc = 4; // ParaMath.Jc
var historyitem_Math_CtrPrpShd = 5;
function ReadChanges_FromBinary(Reader, Class) function ReadChanges_FromBinary(Reader, Class)
{ {
...@@ -1824,6 +1826,7 @@ function ReadChanges_FromBinary(Reader, Class) ...@@ -1824,6 +1826,7 @@ function ReadChanges_FromBinary(Reader, Class)
{ {
case historyitem_Math_CtrPrpFSize: Changes = new CChangesMathFontSize(); break; case historyitem_Math_CtrPrpFSize: Changes = new CChangesMathFontSize(); break;
case hisotryitem_Math_ParaJc : Changes = new CChangesMathParaJc(); break; case hisotryitem_Math_ParaJc : Changes = new CChangesMathParaJc(); break;
case historyitem_Math_CtrPrpShd: Changes = new CChangesMathShd(); break;
} }
if (null !== Changes) if (null !== Changes)
...@@ -1866,6 +1869,52 @@ CChangesMathFontSize.prototype.Load_Changes = function(Reader, Class) ...@@ -1866,6 +1869,52 @@ CChangesMathFontSize.prototype.Load_Changes = function(Reader, Class)
this.Redo(Class); this.Redo(Class);
}; };
function CChangesMathShd(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathShd.prototype.Type = historyitem_Math_CtrPrpShd;
CChangesMathShd.prototype.Undo = function(Class)
{
Class.raw_SetShd(this.Old);
};
CChangesMathShd.prototype.Redo = function(Class)
{
Class.raw_SetShd(this.New);
};
CChangesMathShd.prototype.Save_Changes = function(Writer)
{
// Long : New
if ( undefined !== this.New )
{
Writer.WriteBool(false);
this.New.Write_ToBinary(Writer);
}
else
Writer.WriteBool(true);
//Writer.WriteLong(this.New);
};
CChangesMathShd.prototype.Load_Changes = function(Reader, Class)
{
/*this.New = Reader.GetLong();
this.Redo(Class);*/
if ( Reader.GetBool() == false)
{
this.New = new CDocumentShd();
this.New.Read_FromBinary( Reader );
}
else
{
this.New = undefined;
}
this.Redo(Class);
};
function CChangesMathParaJc(NewValue, OldValue) function CChangesMathParaJc(NewValue, OldValue)
{ {
this.New = NewValue; this.New = NewValue;
......
...@@ -425,6 +425,7 @@ CMathBase.prototype = ...@@ -425,6 +425,7 @@ CMathBase.prototype =
// for Ctr Prp // for Ctr Prp
//this.CompiledCtrPrp = ParaMath.GetFirstRPrp(); //this.CompiledCtrPrp = ParaMath.GetFirstRPrp();
this.CompiledCtrPrp = new CTextPr();
var defaultTxtPrp = ParaMath.Get_Default_TPrp(); var defaultTxtPrp = ParaMath.Get_Default_TPrp();
this.CompiledCtrPrp.FontFamily = this.CompiledCtrPrp.FontFamily =
...@@ -699,8 +700,19 @@ CMathBase.prototype = ...@@ -699,8 +700,19 @@ CMathBase.prototype =
if ( (undefined === this.CtrPrp.Shd && undefined === Shd) || (undefined !== this.CtrPrp.Shd && undefined !== Shd && true === this.CtrPrp.Shd.Compare( Shd ) ) ) if ( (undefined === this.CtrPrp.Shd && undefined === Shd) || (undefined !== this.CtrPrp.Shd && undefined !== Shd && true === this.CtrPrp.Shd.Compare( Shd ) ) )
return; return;
//var OldShd = this.CtrPrp.Shd; History.Add(this, new CChangesMathShd(Shd, this.CtrPrp.Shd));
this.raw_SetShd(Shd);
},
raw_SetFontSize : function(Value)
{
this.CtrPrp.FontSize = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetShd: function(Shd)
{
if ( undefined !== Shd ) if ( undefined !== Shd )
{ {
this.CtrPrp.Shd = new CDocumentShd(); this.CtrPrp.Shd = new CDocumentShd();
...@@ -711,15 +723,7 @@ CMathBase.prototype = ...@@ -711,15 +723,7 @@ CMathBase.prototype =
this.RecalcInfo.bCtrPrp = true; this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath) if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetFontSize : function(Value)
{
this.CtrPrp.FontSize = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize(); this.ParaMath.SetNeedResize();
}, },
SelectToParent: function(bCorrect) SelectToParent: function(bCorrect)
......
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