Commit 05ba014c authored by Ilya.Kirillov's avatar Ilya.Kirillov

Исправлен баг с обновлением информации об исправлении. Сделана отрисовка...

Исправлен баг с обновлением информации об исправлении. Сделана отрисовка удаленных элементов формул в режиме рецензирования. Сделан начальный вариант удаления в режиме рецензирования.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66506 954022d7-b5bf-4e40-9824-e11837661b57
parent b53d1b78
...@@ -843,6 +843,10 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X ...@@ -843,6 +843,10 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X
ParaMath.prototype.Remove = function(Direction, bOnAddText) ParaMath.prototype.Remove = function(Direction, bOnAddText)
{ {
var TrackRevisions = null;
if (this.Paragraph && this.Paragraph.LogicDocument)
TrackRevisions = this.Paragraph.LogicDocument.Is_TrackRevisions();
var oSelectedContent = this.GetSelectContent(); var oSelectedContent = this.GetSelectContent();
var nStartPos = oSelectedContent.Start; var nStartPos = oSelectedContent.Start;
...@@ -852,6 +856,7 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText) ...@@ -852,6 +856,7 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText)
if (nStartPos === nEndPos) if (nStartPos === nEndPos)
{ {
var oElement = oContent.getElem(nStartPos); var oElement = oContent.getElem(nStartPos);
var ElementReviewType = oElement.Get_ReviewType();
// Если данный элемент - ран, удаляем внутри рана, если нет, тогда удаляем целиком элемент // Если данный элемент - ран, удаляем внутри рана, если нет, тогда удаляем целиком элемент
if (para_Math_Run === oElement.Type) if (para_Math_Run === oElement.Type)
...@@ -933,17 +938,31 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText) ...@@ -933,17 +938,31 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText)
} }
else else
{ {
oContent.Remove_FromContent(nStartPos, 1); this.Selection_Remove();
oContent.CurPos = nStartPos; oContent.CurPos = nStartPos;
if (true === TrackRevisions)
{
if (reviewtype_Common === ElementReviewType)
{
oElement.Set_ReviewType(reviewtype_Remove);
}
else if (reviewtype_Add === ElementReviewType)
{
oContent.Remove_FromContent(nStartPos, 1);
if (para_Math_Run === oContent.Content[nStartPos].Type) if (para_Math_Run === oContent.Content[nStartPos].Type)
oContent.Content[nStartPos].Cursor_MoveToStartPos(); oContent.Content[nStartPos].Cursor_MoveToStartPos();
}
}
else
{
oContent.Remove_FromContent(nStartPos, 1);
if (para_Math_Run === oContent.Content[nStartPos].Type)
oContent.Content[nStartPos].Cursor_MoveToStartPos();
}
oContent.Correct_Content(); oContent.Correct_Content();
oContent.Correct_ContentPos(-1); // -1, потому что нам надо встать перед элементом, а не после oContent.Correct_ContentPos(-1); // -1, потому что нам надо встать перед элементом, а не после
this.Selection_Remove();
} }
} }
else else
...@@ -959,6 +978,35 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText) ...@@ -959,6 +978,35 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText)
var oStartElement = oContent.getElem(nStartPos); var oStartElement = oContent.getElem(nStartPos);
var oEndElement = oContent.getElem(nEndPos); var oEndElement = oContent.getElem(nEndPos);
this.Selection_Remove();
oContent.CurPos = nStartPos;
if (true === TrackRevisions)
{
for (var CurPos = nEndPos; CurPos >= nStartPos; --CurPos)
{
var Element = oContent.getElem(CurPos);
var ElementReviewType = Element.Get_ReviewType();
if (para_Math_Run === Element.Type && (CurPos === nEndPos || CurPos === nStartPos))
{
// Удаление разруливается внутри рана
Element.Remove(Direction);
}
else
{
if (reviewtype_Common === ElementReviewType)
{
Element.Set_ReviewType(reviewtype_Remove);
}
else if (reviewtype_Add === ElementReviewType)
{
oContent.Remove_FromContent(CurPos, 1);
}
}
}
}
else
{
// Если последний элемент - ран, удаляем внутри, если нет, тогда удаляем целиком элемент // Если последний элемент - ран, удаляем внутри, если нет, тогда удаляем целиком элемент
if (para_Math_Run === oEndElement.Type) if (para_Math_Run === oEndElement.Type)
oEndElement.Remove(Direction); oEndElement.Remove(Direction);
...@@ -973,11 +1021,9 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText) ...@@ -973,11 +1021,9 @@ ParaMath.prototype.Remove = function(Direction, bOnAddText)
oStartElement.Remove(Direction); oStartElement.Remove(Direction);
else else
oContent.Remove_FromContent(nStartPos, 1); oContent.Remove_FromContent(nStartPos, 1);
}
oContent.CurPos = nStartPos;
oContent.Correct_Content(); oContent.Correct_Content();
oContent.Correct_ContentPos(Direction); oContent.Correct_ContentPos(Direction);
this.Selection_Remove();
} }
}; };
...@@ -3696,9 +3742,9 @@ CChangesMathEqArrayPr.prototype.Load_Changes = function(Reader, Class) ...@@ -3696,9 +3742,9 @@ CChangesMathEqArrayPr.prototype.Load_Changes = function(Reader, Class)
function CChangesMathBaseReviewType(NewType, NewInfo, OldType, OldInfo) function CChangesMathBaseReviewType(NewType, NewInfo, OldType, OldInfo)
{ {
this.NewType = NewType; this.NewType = NewType;
this.NewInfo = NewInfo ? undefined : NewInfo.Copy(); this.NewInfo = NewInfo ? NewInfo.Copy() : undefined;
this.OldType = OldType; this.OldType = OldType;
this.OldInfo = OldInfo ? undefined : OldInfo.Copy(); this.OldInfo = OldInfo ? OldInfo.Copy() : undefined;
} }
CChangesMathBaseReviewType.prototype.Type = historyitem_Math_ReviewType; CChangesMathBaseReviewType.prototype.Type = historyitem_Math_ReviewType;
CChangesMathBaseReviewType.prototype.Undo = function(Class) CChangesMathBaseReviewType.prototype.Undo = function(Class)
......
...@@ -4590,9 +4590,9 @@ ParaRun.prototype.Draw_Lines = function(PDSL) ...@@ -4590,9 +4590,9 @@ ParaRun.prototype.Draw_Lines = function(PDSL)
if (this.Paragraph) if (this.Paragraph)
{ {
if (bAddReview) if (bAddReview)
aUnderline.Add(UnderlineY, UnderlineY, X, X + ItemWidthVisible, LineW, 255, 0, 0); aUnderline.Add(UnderlineY, UnderlineY, X, X + ItemWidthVisible, LineW, REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b);
else if (bRemReview) else if (bRemReview)
aStrikeout.Add(StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, 255, 0, 0); aStrikeout.Add(StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b);
} }
X += ItemWidthVisible; X += ItemWidthVisible;
...@@ -4661,7 +4661,9 @@ ParaRun.prototype.Draw_Lines = function(PDSL) ...@@ -4661,7 +4661,9 @@ ParaRun.prototype.Draw_Lines = function(PDSL)
case para_Math_BreakOperator: case para_Math_BreakOperator:
case para_Math_Ampersand: case para_Math_Ampersand:
{ {
if ( true === CurTextPr.DStrikeout ) if (true === bRemReview)
aStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b, undefined, CurTextPr );
else if (true === CurTextPr.DStrikeout)
aDStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, CurColor.r, CurColor.g, CurColor.b, undefined, CurTextPr ); aDStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, CurColor.r, CurColor.g, CurColor.b, undefined, CurTextPr );
else if ( true === CurTextPr.Strikeout ) else if ( true === CurTextPr.Strikeout )
aStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, CurColor.r, CurColor.g, CurColor.b, undefined, CurTextPr ); aStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, CurColor.r, CurColor.g, CurColor.b, undefined, CurTextPr );
...@@ -4673,6 +4675,8 @@ ParaRun.prototype.Draw_Lines = function(PDSL) ...@@ -4673,6 +4675,8 @@ ParaRun.prototype.Draw_Lines = function(PDSL)
case para_Math_Placeholder: case para_Math_Placeholder:
{ {
var ctrPrp = this.Parent.GetCtrPrp(); var ctrPrp = this.Parent.GetCtrPrp();
if (true === bRemReview)
aStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b, undefined, CurTextPr );
if(true === ctrPrp.DStrikeout) if(true === ctrPrp.DStrikeout)
aDStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, CurColor.r, CurColor.g, CurColor.b, undefined, CurTextPr ); aDStrikeout.Add( StrikeoutY, StrikeoutY, X, X + ItemWidthVisible, LineW, CurColor.r, CurColor.g, CurColor.b, undefined, CurTextPr );
else if(true === ctrPrp.Strikeout) else if(true === ctrPrp.Strikeout)
......
...@@ -1720,6 +1720,10 @@ CMathBase.prototype.Draw_Lines = function(PDSL) ...@@ -1720,6 +1720,10 @@ CMathBase.prototype.Draw_Lines = function(PDSL)
var aStrikeout = PDSL.Strikeout; var aStrikeout = PDSL.Strikeout;
var aDStrikeout = PDSL.DStrikeout; var aDStrikeout = PDSL.DStrikeout;
var ReviewType = this.Get_ReviewType();
var bAddReview = reviewtype_Add === ReviewType ? true : false;
var bRemReview = reviewtype_Remove === ReviewType ? true : false;
var ArgSize = this.Get_CompiledArgSize(); var ArgSize = this.Get_CompiledArgSize();
var fontCoeff = MatGetKoeffArgSize(CtrPrp.FontSize, ArgSize.value); var fontCoeff = MatGetKoeffArgSize(CtrPrp.FontSize, ArgSize.value);
...@@ -1761,7 +1765,9 @@ CMathBase.prototype.Draw_Lines = function(PDSL) ...@@ -1761,7 +1765,9 @@ CMathBase.prototype.Draw_Lines = function(PDSL)
var Bound = this.Bounds.Get_LineBound(CurLine, CurRange); var Bound = this.Bounds.Get_LineBound(CurLine, CurRange);
if ( true === CtrPrp.DStrikeout ) if (true === bRemReview)
aStrikeout.Add(Y, Y, X, X + Bound.W, LineW, REVIEW_COLOR.r, REVIEW_COLOR.g, REVIEW_COLOR.b);
else if ( true === CtrPrp.DStrikeout )
aDStrikeout.Add( Y, Y, X, X + Bound.W, LineW, CurColor.r, CurColor.g, CurColor.b ); aDStrikeout.Add( Y, Y, X, X + Bound.W, LineW, CurColor.r, CurColor.g, CurColor.b );
else if ( true === CtrPrp.Strikeout ) else if ( true === CtrPrp.Strikeout )
aStrikeout.Add( Y, Y, X, X + Bound.W, LineW, CurColor.r, CurColor.g, CurColor.b ); aStrikeout.Add( Y, Y, X, X + Bound.W, LineW, CurColor.r, CurColor.g, CurColor.b );
...@@ -1783,6 +1789,7 @@ CMathBase.prototype.Draw_Lines = function(PDSL) ...@@ -1783,6 +1789,7 @@ CMathBase.prototype.Draw_Lines = function(PDSL)
this.Content[CurPos].Draw_Lines(PDSL); this.Content[CurPos].Draw_Lines(PDSL);
PDSL.X = Bound.X + Bound.W; PDSL.X = Bound.X + Bound.W;
}; };
CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr) CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr)
...@@ -2318,20 +2325,17 @@ CMathBase.prototype.Get_ReviewType = function() ...@@ -2318,20 +2325,17 @@ CMathBase.prototype.Get_ReviewType = function()
{ {
return this.ReviewType; return this.ReviewType;
}; };
CMathBase.prototype.Set_ReviewType = function(Value) CMathBase.prototype.Set_ReviewType = function(Type)
{ {
CMathBase.superclass.Set_ReviewType.apply(this, arguments); CMathBase.superclass.Set_ReviewType.apply(this, arguments);
if (Value !== this.ReviewType) if (Type !== this.ReviewType)
{ {
var OldReviewType = this.ReviewType; var NewInfo = new CReviewInfo();
var OldReviewInfo = this.ReviewInfo.Copy(); NewInfo.Update();
this.ReviewType = Value; History.Add(this, new CChangesMathBaseReviewType(Type, NewInfo, this.ReviewType, this.ReviewInfo));
this.ReviewInfo.Update(); this.raw_SetReviewType(Type, NewInfo);
History.Add(this, new CChangesMathBaseReviewType(Value, this.ReviewInfo, OldReviewType, OldReviewInfo));
this.private_UpdateTrackRevisions();
} }
}; };
CMathBase.prototype.Set_ReviewTypeWithInfo = function(ReviewType, ReviewInfo) CMathBase.prototype.Set_ReviewTypeWithInfo = function(ReviewType, ReviewInfo)
......
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