Commit c2f3d139 authored by Ilya.Kirillov's avatar Ilya.Kirillov

В класс CMathBase добавлены поля для работы в режиме рецензирования.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66495 954022d7-b5bf-4e40-9824-e11837661b57
parent 1c971f55
......@@ -2858,6 +2858,7 @@ var historyitem_Math_RFontsEastAsia = 18;
var historyitem_Math_RFontsHint = 19;
var historyitem_Math_CtrPrpHighLight = 20;
var historyitem_Math_ArgSize = 21;
var historyitem_Math_ReviewType = 22;
function ReadChanges_FromBinary(Reader, Class)
......@@ -3692,6 +3693,60 @@ CChangesMathEqArrayPr.prototype.Load_Changes = function(Reader, Class)
};
function CChangesMathBaseReviewType(NewType, NewInfo, OldType, OldInfo)
{
this.NewType = NewType;
this.NewInfo = NewInfo ? undefined : NewInfo.Copy();
this.OldType = OldType;
this.OldInfo = OldInfo ? undefined : OldInfo.Copy();
}
CChangesMathBaseReviewType.prototype.Type = historyitem_Math_ReviewType;
CChangesMathBaseReviewType.prototype.Undo = function(Class)
{
Class.raw_SetReviewType(this.OldType, this.OldInfo);
};
CChangesMathBaseReviewType.prototype.Redo = function(Class)
{
Class.raw_SetReviewType(this.NewType, this.NewInfo);
};
CChangesMathBaseReviewType.prototype.Save_Changes = function(Writer)
{
// Long : ReviewType
// Bool : ReviewInfo undefined ?
// false : ReviewInfo
Writer.WriteLong(this.NewType);
if (undefined === this.NewInfo)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
this.NewInfo.Write_ToBinary(Writer);
}
};
CChangesMathBaseReviewType.prototype.Load_Changes = function(Reader, Class)
{
// Long : ReviewType
// CReviewInfo : ReviewInfo
this.NewType = Reader.GetLong();
if (true === Reader.GetBool())
{
this.NewInfo = undefined;
}
else
{
this.NewInfo = new CReviewInfo();
this.NewInfo.Read_FromBinary(Reader);
}
this.Redo(Class);
};
function MatGetKoeffArgSize(FontSize, ArgSize)
{
var FontKoef = 1;
......
......@@ -2428,6 +2428,15 @@ CParagraphContentWithParagraphLikeContent.prototype.Reject_RevisionChanges = fun
}
}
};
CParagraphContentWithParagraphLikeContent.prototype.private_UpdateTrackRevisions = function()
{
if (this.Paragraph && this.Paragraph.LogicDocument && this.Paragraph.LogicDocument.Get_TrackRevisionsManager)
{
var RevisionsManager = this.Paragraph.LogicDocument.Get_TrackRevisionsManager();
RevisionsManager.Check_Paragraph(this.Paragraph);
}
};
//----------------------------------------------------------------------------------------------------------------------
// Функции, которые должны быть реализованы в классах наследниках
//----------------------------------------------------------------------------------------------------------------------
......
......@@ -73,6 +73,13 @@ function CMathBase(bInside)
this.NearPosArray = [];
this.ReviewType = reviewtype_Common;
this.ReviewInfo = new CReviewInfo();
var Api = editor;
if (Api && !Api.isPresentationEditor && Api.WordControl && Api.WordControl.m_oLogicDocument && true === Api.WordControl.m_oLogicDocument.Is_TrackRevisions())
this.ReviewType = reviewtype_Add;
return this;
}
Asc.extendClass(CMathBase, CParagraphContentWithParagraphLikeContent);
......@@ -1306,6 +1313,9 @@ CMathBase.prototype.Write_ToBinary2 = function( Writer )
// Array of Strings : Content[Index].Id
// Variable : Pr
// Variable(CTextPr): CtrPrp
// Long : ReviewType
// Bool : undefined == ReviewInfo
// if false : ReviewInfo
Writer.WriteString2(this.Id);
......@@ -1318,6 +1328,17 @@ CMathBase.prototype.Write_ToBinary2 = function( Writer )
this.Pr.Write_ToBinary(Writer);
this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong(this.ReviewType);
if (undefined !== this.ReviewInfo)
{
Writer.WriteBool(false);
this.ReviewInfo.Write_ToBinary(Writer);
}
else
{
Writer.WriteBool(true);
}
};
CMathBase.prototype.Read_FromBinary2 = function( Reader )
{
......@@ -1326,6 +1347,10 @@ CMathBase.prototype.Read_FromBinary2 = function( Reader )
// Array of Strings : Content[Index].Id
// Variable : Pr
// Variable(CTextPr): CtrPrp
// Long : ReviewType
// Bool : undefined == ReviewInfo
// if false : ReviewInfo
this.Id = Reader.GetString2();
......@@ -1341,6 +1366,18 @@ CMathBase.prototype.Read_FromBinary2 = function( Reader )
this.Pr.Read_FromBinary(Reader);
this.CtrPrp.Read_FromBinary(Reader);
this.ReviewType = Reader.GetLong();
if (true === Reader.GetBool())
{
this.ReviewInfo = undefined;
}
else
{
this.ReviewInfo = new CReviewInfo();
this.ReviewInfo.Read_FromBinary(Reader);
}
this.fillContent();
};
CMathBase.prototype.Get_Id = function()
......@@ -1798,6 +1835,11 @@ CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr)
}
}
if (reviewtype_Common !== this.ReviewType)
{
pGraphics.p_color(REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b, 255);
pGraphics.b_color1(REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b, 255);
}
if(BgColor == undefined)
BgColor = new CDocumentColor( 255, 255, 255, false );
......@@ -2265,6 +2307,39 @@ CMathBase.prototype.Get_Range_VisibleWidth = function(RangeW, _CurLine, _CurRang
}
}
};
CMathBase.prototype.raw_SetReviewType = function(Type, Info)
{
this.ReviewType = Type;
this.ReviewInfo = Info;
this.private_UpdateTrackRevisions();
};
CMathBase.prototype.Get_ReviewType = function()
{
return this.ReviewType;
};
CMathBase.prototype.Set_ReviewType = function(Value)
{
CMathBase.superclass.Set_ReviewType.apply(this, arguments);
if (Value !== this.ReviewType)
{
var OldReviewType = this.ReviewType;
var OldReviewInfo = this.ReviewInfo.Copy();
this.ReviewType = Value;
this.ReviewInfo.Update();
History.Add(this, new CChangesMathBaseReviewType(Value, this.ReviewInfo, OldReviewType, OldReviewInfo));
this.private_UpdateTrackRevisions();
}
};
CMathBase.prototype.Set_ReviewTypeWithInfo = function(ReviewType, ReviewInfo)
{
CMathBase.superclass.Set_ReviewType.apply(this, arguments);
History.Add(this, new CChangesMathBaseReviewType(ReviewType, ReviewInfo, this.ReviewType, this.ReviewInfo));
this.raw_SetReviewType(ReviewType, ReviewInfo);
};
CMathBase.prototype.Math_Set_EmptyRange = CMathContent.prototype.Math_Set_EmptyRange;
CMathBase.prototype.Set_ParaMath = CMathContent.prototype.Set_ParaMath;
......
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