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

Применение strikeout, underline и doublestrikeout из меню (с применением к CtrPrp для мат объектов)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59673 954022d7-b5bf-4e40-9824-e11837661b57
parent d574b109
......@@ -1950,6 +1950,9 @@ var historyitem_Math_AddItems_ToMathBase = 6;
var historyitem_Math_EqArrayPr = 7; // Изменение настроек у CEqArray
var historyitem_Math_CtrPrpColor = 8;
var historyitem_Math_CtrPrpUnifill = 9;
var historyitem_Math_CtrPrpUnderline = 10;
var historyitem_Math_CtrPrpStrikeout = 11;
var historyitem_Math_CtrPrpDoubleStrikeout = 12;
function ReadChanges_FromBinary(Reader, Class)
......@@ -1959,20 +1962,22 @@ function ReadChanges_FromBinary(Reader, Class)
switch(Type)
{
case historyitem_Math_CtrPrpFSize : Changes = new CChangesMathFontSize(); 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;
case historyitem_Math_CtrPrpColor : Changes = new CChangesMathColor(); break;
case historyitem_Math_CtrPrpUnifill : Changes = new CChangesMathUnifill(); break;
case historyitem_Math_CtrPrpFSize : Changes = new CChangesMathFontSize(); 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;
case historyitem_Math_CtrPrpColor : Changes = new CChangesMathColor(); break;
case historyitem_Math_CtrPrpUnifill : Changes = new CChangesMathUnifill(); break;
case historyitem_Math_CtrPrpUnderline : Changes = new CChangesMathUnderline(); break;
case historyitem_Math_CtrPrpStrikeout : Changes = new CChangesMathStrikeout(); break;
case historyitem_Math_CtrPrpDoubleStrikeout : Changes = new CChangesMath_DoubleStrikeout(); break;
}
if (null !== Changes)
Changes.Load_Changes(Reader, Class);
}
function WriteChanges_ToBinary(Changes, Writer)
{
function WriteChanges_ToBinary(Changes, Writer){
Writer.WriteLong(Changes.Type);
Changes.Save_Changes(Writer);
}
......@@ -2155,6 +2160,127 @@ CChangesMathUnifill.prototype.Load_Changes = function(Reader, Class)
this.Redo(Class);
};
function CChangesMathUnderline(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathUnderline.prototype.Type = historyitem_Math_CtrPrpUnderline;
CChangesMathUnderline.prototype.Undo = function(Class)
{
Class.raw_SetUnderline(this.Old);
};
CChangesMathUnderline.prototype.Redo = function(Class)
{
Class.raw_SetUnderline(this.New);
};
CChangesMathUnderline.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// Bool : IsUnderline
if (undefined === this.New)
Writer.WriteBool(true);
else
{
Writer.WriteBool(false);
Writer.WriteBool(this.New);
}
};
CChangesMathUnderline.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// Bool : IsUnderline
if(true === Reader.GetBool())
this.New = undefined;
else
this.New = Reader.GetBool();
this.Redo(Class);
}
function CChangesMathStrikeout(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathStrikeout.prototype.Type = historyitem_Math_CtrPrpStrikeout;
CChangesMathStrikeout.prototype.Undo = function(Class)
{
Class.raw_SetStrikeout(this.Old);
};
CChangesMathStrikeout.prototype.Redo = function(Class)
{
Class.raw_SetStrikeout(this.New);
};
CChangesMathStrikeout.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// Bool : IsStrikeOut
if (undefined === this.New)
Writer.WriteBool(true);
else
{
Writer.WriteBool(false);
Writer.WriteBool(this.New);
}
};
CChangesMathStrikeout.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// Bool : IsStrikeOut
if(true === Reader.GetBool())
this.New = undefined;
else
this.New = Reader.GetBool();
this.Redo(Class);
};
function CChangesMath_DoubleStrikeout(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMath_DoubleStrikeout.prototype.Type = historyitem_Math_CtrPrpDoubleStrikeout;
CChangesMath_DoubleStrikeout.prototype.Undo = function(Class)
{
Class.raw_Set_DoubleStrikeout(this.Old);
};
CChangesMath_DoubleStrikeout.prototype.Redo = function(Class)
{
Class.raw_Set_DoubleStrikeout(this.New);
};
CChangesMath_DoubleStrikeout.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// Bool : IsDoubleStrikeOut
if (undefined === this.New)
Writer.WriteBool(true);
else
{
Writer.WriteBool(false);
Writer.WriteBool(this.New);
}
};
CChangesMath_DoubleStrikeout.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// Bool : IsDoubleStrikeOut
if(true === Reader.GetBool())
this.New = undefined;
else
this.New = Reader.GetBool();
this.Redo(Class);
};
function CChangesMathAddItems(Pos, Items)
{
this.Pos = Pos;
......
......@@ -676,6 +676,21 @@ CMathBase.prototype =
this.Set_Unifill(null === TextPr.Unifill ? undefined : TextPr.Unifill);
this.Set_Color(undefined);
}
if(undefined !== TextPr.Underline)
{
this.Set_Underline(TextPr.Underline);
}
if(undefined !== TextPr.Strikeout)
{
this.Set_Strikeout(TextPr.Strikeout);
}
if(undefined !== TextPr.DStrikeout)
{
this.Set_DoubleStrikeout(TextPr.DStrikeout);
}
}
for(var i=0; i < this.nRow; i++)
......@@ -702,8 +717,11 @@ CMathBase.prototype =
},
Set_FontSizeCtrPrp: function(Value)
{
History.Add(this, new CChangesMathFontSize(Value, this.CtrPrp.FontSize));
this.raw_SetFontSize(Value);
if ( Value !== this.CtrPrp.FontSize )
{
History.Add(this, new CChangesMathFontSize(Value, this.CtrPrp.FontSize));
this.raw_SetFontSize(Value);
}
},
Set_Color: function(Value)
{
......@@ -723,13 +741,60 @@ CMathBase.prototype =
},
Set_Shd: function(Shd)
{
if ( (undefined === this.CtrPrp.Shd && undefined === Shd) || (undefined !== this.CtrPrp.Shd && undefined !== Shd && true === this.CtrPrp.Shd.Compare( Shd ) ) )
return;
if ( !(undefined === this.CtrPrp.Shd && undefined === Shd) && !(undefined !== this.CtrPrp.Shd && undefined !== Shd && true === this.CtrPrp.Shd.Compare( Shd ) ) )
{
History.Add(this, new CChangesMathShd(Shd, this.CtrPrp.Shd));
this.raw_SetShd(Shd);
}
},
Set_Underline: function(Value)
{
if ( Value !== this.CtrPrp.Underline )
{
History.Add(this, new CChangesMathUnderline(Value, this.CtrPrp.Underline));
this.raw_SetUnderline(Value);
}
},
Set_Strikeout: function(Value)
{
if ( Value !== this.CtrPrp.Strikeout )
{
History.Add(this, new CChangesMathStrikeout(Value, this.CtrPrp.Strikeout));
this.raw_SetStrikeout(Value);
}
},
Set_DoubleStrikeout: function(Value)
{
if(Value !== this.CtrPrp.DStrikeout)
{
History.Add(this, new CChangesMath_DoubleStrikeout(Value, this.CtrPrp.DStrikeout));
this.raw_Set_DoubleStrikeout(Value);
}
},
raw_SetUnderline : function(Value)
{
this.CtrPrp.Underline = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetStrikeout: function(Value)
{
this.CtrPrp.Strikeout = Value;
this.RecalcInfo.bCtrPrp = true;
History.Add(this, new CChangesMathShd(Shd, this.CtrPrp.Shd));
this.raw_SetShd(Shd);
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_Set_DoubleStrikeout: function(Value)
{
this.CtrPrp.DStrikeout = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetFontSize : function(Value)
{
this.CtrPrp.FontSize = Value;
......
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