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

Редактирование цвета текста через меню

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59614 954022d7-b5bf-4e40-9824-e11837661b57
parent c256faf9
......@@ -1898,6 +1898,9 @@ var historyitem_Math_ParaJc = 4; // ParaMath.Jc
var historyitem_Math_CtrPrpShd = 5;
var historyitem_Math_AddItems_ToMathBase = 6;
var historyitem_Math_EqArrayPr = 7; // Изменение настроек у CEqArray
var historyitem_Math_CtrPrpColor = 8;
var historyitem_Math_CtrPrpUnifill = 9;
function ReadChanges_FromBinary(Reader, Class)
{
......@@ -1910,6 +1913,8 @@ function ReadChanges_FromBinary(Reader, Class)
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;
}
if (null !== Changes)
......@@ -1982,7 +1987,7 @@ CChangesMathShd.prototype.Redo = function(Class)
};
CChangesMathShd.prototype.Save_Changes = function(Writer)
{
// Long : New
// Bool : IsUndefined
if ( undefined !== this.New )
{
......@@ -1992,12 +1997,10 @@ CChangesMathShd.prototype.Save_Changes = function(Writer)
else
Writer.WriteBool(true);
//Writer.WriteLong(this.New);
};
CChangesMathShd.prototype.Load_Changes = function(Reader, Class)
{
/*this.New = Reader.GetLong();
this.Redo(Class);*/
// Bool : IsUndefined
if ( Reader.GetBool() == false)
{
......@@ -2012,6 +2015,96 @@ CChangesMathShd.prototype.Load_Changes = function(Reader, Class)
this.Redo(Class);
};
function CChangesMathColor(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathColor.prototype.Type = historyitem_Math_CtrPrpColor;
CChangesMathColor.prototype.Undo = function(Class)
{
Class.raw_SetColor(this.Old);
};
CChangesMathColor.prototype.Redo = function(Class)
{
Class.raw_SetColor(this.New);
};
CChangesMathColor.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
if ( undefined !== this.New )
{
Writer.WriteBool(false);
this.New.Write_ToBinary(Writer);
}
else
{
Writer.WriteBool(true);
}
};
CChangesMathColor.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
if ( Reader.GetBool() == false)
{
this.New = new CDocumentColor(0, 0, 0, false);
this.New.Read_FromBinary(Reader);
}
else
{
this.New = undefined;
}
this.Redo(Class);
};
function CChangesMathUnifill(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMathUnifill.prototype.Type = historyitem_Math_CtrPrpUnifill;
CChangesMathUnifill.prototype.Undo = function(Class)
{
Class.raw_SetUnifill(this.Old);
};
CChangesMathUnifill.prototype.Redo = function(Class)
{
Class.raw_SetUnifill(this.New);
};
CChangesMathUnifill.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
if ( undefined !== this.New )
{
Writer.WriteBool(false);
this.New.Write_ToBinary(Writer);
}
else
{
Writer.WriteBool(true);
}
};
CChangesMathUnifill.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
if ( Reader.GetBool() == false)
{
this.New = new CUniFill();
this.New.Read_FromBinary(Reader);
}
else
{
this.New = undefined;
}
this.Redo(Class);
};
function CChangesMathAddItems(Pos, Items)
{
this.Pos = Pos;
......
......@@ -659,8 +659,21 @@ CMathBase.prototype =
{
if(TextPr.FontSize !== undefined)
this.Set_FontSizeCtrPrp(TextPr.FontSize);
else if(TextPr.Shd !== undefined)
if(TextPr.Shd !== undefined)
this.Set_Shd(TextPr.Shd);
if ( undefined !== TextPr.Color && undefined === TextPr.Unifill )
{
this.Set_Color( null === TextPr.Color ? undefined : TextPr.Color );
this.Set_Unifill( undefined );
}
if ( undefined !== TextPr.Unifill )
{
this.Set_Unifill(null === TextPr.Unifill ? undefined : TextPr.Unifill);
this.Set_Color(undefined);
}
}
for(var i=0; i < this.nRow; i++)
......@@ -690,6 +703,22 @@ CMathBase.prototype =
History.Add(this, new CChangesMathFontSize(Value, this.CtrPrp.FontSize));
this.raw_SetFontSize(Value);
},
Set_Color: function(Value)
{
if ( ( undefined === Value && undefined !== this.CtrPrp.Color ) || ( Value instanceof CDocumentColor && ( undefined === this.CtrPrp.Color || false === Value.Compare(this.CtrPrp.Color) ) ) )
{
History.Add( this, new CChangesMathColor(Value, this.CtrPrp.Color));
this.raw_SetColor(Value);
}
},
Set_Unifill: function(Value)
{
if ( ( undefined === Value && undefined !== this.CtrPrp.Unifill ) || ( Value instanceof CUniFill && ( undefined === this.CtrPrp.Unifill || false === CompareUnifillBool(this.CtrPrp.Unifill, Value) ) ) )
{
History.Add(this, new CChangesMathUnifill(Value, this.CtrPrp.Unifill));
this.raw_SetUnifill(Value);
}
},
Set_Shd: function(Shd)
{
if ( (undefined === this.CtrPrp.Shd && undefined === Shd) || (undefined !== this.CtrPrp.Shd && undefined !== Shd && true === this.CtrPrp.Shd.Compare( Shd ) ) )
......@@ -698,6 +727,7 @@ CMathBase.prototype =
History.Add(this, new CChangesMathShd(Shd, this.CtrPrp.Shd));
this.raw_SetShd(Shd);
},
raw_SetFontSize : function(Value)
{
this.CtrPrp.FontSize = Value;
......@@ -721,6 +751,24 @@ CMathBase.prototype =
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetColor: function(Value)
{
this.CtrPrp.Color = Value;
this.RecalcInfo.bCtrPrp = true;
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetUnifill: function(Value)
{
this.CtrPrp.Unifill = Value;
this.RecalcInfo.bCtrPrp = true;
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
SelectToParent: function(bCorrect)
{
this.bSelectionUse = true;
......@@ -1051,7 +1099,7 @@ CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr)
CurTextPr.Unifill.check(PDSE.Theme, PDSE.ColorMap);
RGBA = CurTextPr.Unifill.getRGBAColor();
if ( true === PDSE.VisitedHyperlink && ( undefined === this.Pr.Color && undefined === this.Pr.Unifill ) )
if ( true === PDSE.VisitedHyperlink && ( undefined === this.CtrPrp.Color && undefined === this.CtrPrp.Unifill ) )
{
G_O_VISITED_HLINK_COLOR.check(PDSE.Theme, PDSE.ColorMap);
RGBA = G_O_VISITED_HLINK_COLOR.getRGBAColor();
......@@ -1066,7 +1114,7 @@ CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr)
}
else
{
if ( true === PDSE.VisitedHyperlink && ( undefined === this.Pr.Color && undefined === this.Pr.Unifill ) )
if ( true === PDSE.VisitedHyperlink && ( undefined === this.CtrPrp.Color && undefined === this.CtrPrp.Unifill ) )
{
G_O_VISITED_HLINK_COLOR.check(PDSE.Theme, PDSE.ColorMap);
RGBA = G_O_VISITED_HLINK_COLOR.getRGBAColor();
......@@ -1085,6 +1133,10 @@ CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr)
}
}
if(BgColor == undefined)
BgColor = new CDocumentColor( 255, 255, 255, false );
return BgColor;
};
CMathBase.prototype.protected_AddToContent = function(Pos, Items, bUpdatePosition)
......
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