Commit b0995d63 authored by Ilya Kirillov's avatar Ilya Kirillov

For all changes added a function which returns a reverse change.

parent 8e1a0373
...@@ -2874,6 +2874,10 @@ ...@@ -2874,6 +2874,10 @@
{ {
return false; return false;
}; };
CChangesBase.prototype.CreateReverseChange = function()
{
return null;
};
window['AscDFH'].CChangesBase = CChangesBase; window['AscDFH'].CChangesBase = CChangesBase;
/** /**
* Базовый класс для изменений, которые меняют содержимое родительского класса.* * Базовый класс для изменений, которые меняют содержимое родительского класса.*
...@@ -3033,6 +3037,21 @@ ...@@ -3033,6 +3037,21 @@
return true; return true;
}; };
CChangesBaseContentChange.prototype.private_CreateReverseChange = function(fConstructor)
{
var oChange = new fConstructor();
oChange.Pos = this.Pos;
oChange.Items = this.Items;
oChange.Add = !this.Add;
oChange.UseArray = this.UseArray;
oChange.PosArray = [];
for (var nIndex = 0, nCount = this.PosArray.length; nIndex < nCount; ++nIndex)
oChange.PosArray[nIndex] = this.PosArray[nIndex];
return oChange;
};
window['AscDFH'].CChangesBaseContentChange = CChangesBaseContentChange; window['AscDFH'].CChangesBaseContentChange = CChangesBaseContentChange;
/** /**
* Базовый класс для изменения свойств. * Базовый класс для изменения свойств.
...@@ -3060,6 +3079,10 @@ ...@@ -3060,6 +3079,10 @@
{ {
// Эту функцию нужно переопределить в дочернем классе // Эту функцию нужно переопределить в дочернем классе
}; };
CChangesBaseProperty.prototype.CreateReverseChange = function()
{
return new this.constructor(this.Class, this.New, this.Old, this.Color);
};
window['AscDFH'].CChangesBaseProperty = CChangesBaseProperty; window['AscDFH'].CChangesBaseProperty = CChangesBaseProperty;
/** /**
* Базовый класс для изменения булевых свойств. * Базовый класс для изменения булевых свойств.
......
...@@ -102,6 +102,10 @@ ...@@ -102,6 +102,10 @@
return Element; return Element;
}; };
CChangesTableIdAdd.prototype.CreateReverseChange = function()
{
return null;
};
window["AscCommon"].CChangesTableIdAdd = CChangesTableIdAdd; window["AscCommon"].CChangesTableIdAdd = CChangesTableIdAdd;
/** /**
* @constructor * @constructor
...@@ -153,6 +157,10 @@ ...@@ -153,6 +157,10 @@
CChangesTableIdReset.prototype.RefreshRecalcData = function() CChangesTableIdReset.prototype.RefreshRecalcData = function()
{ {
}; };
CChangesTableIdReset.prototype.CreateReverseChange = function()
{
return new CChangesTableIdReset(this.Class, this.NewId, this.OldId);
};
window["AscCommon"].CChangesTableIdReset = CChangesTableIdReset; window["AscCommon"].CChangesTableIdReset = CChangesTableIdReset;
/** /**
* @constructor * @constructor
...@@ -277,6 +285,10 @@ ...@@ -277,6 +285,10 @@
CChangesTableIdDescription.prototype.RefreshRecalcData = function() CChangesTableIdDescription.prototype.RefreshRecalcData = function()
{ {
}; };
CChangesTableIdDescription.prototype.CreateReverseChange = function()
{
return null;
};
window["AscCommon"].CChangesTableIdDescription = CChangesTableIdDescription; window["AscCommon"].CChangesTableIdDescription = CChangesTableIdDescription;
/** /**
* @constructor * @constructor
...@@ -352,6 +364,10 @@ ...@@ -352,6 +364,10 @@
CChangesCommonAddWaterMark.prototype.RefreshRecalcData = function() CChangesCommonAddWaterMark.prototype.RefreshRecalcData = function()
{ {
}; };
CChangesCommonAddWaterMark.prototype.CreateReverseChange = function()
{
return null;
};
window["AscCommon"].CChangesCommonAddWaterMark = CChangesCommonAddWaterMark; window["AscCommon"].CChangesCommonAddWaterMark = CChangesCommonAddWaterMark;
})(window); })(window);
......
...@@ -164,6 +164,10 @@ CChangesCommentsAdd.prototype.ReadFromBinary = function(Reader) ...@@ -164,6 +164,10 @@ CChangesCommentsAdd.prototype.ReadFromBinary = function(Reader)
this.Id = Reader.GetString2(); this.Id = Reader.GetString2();
this.Comment = AscCommon.g_oTableId.Get_ById(this.Id); this.Comment = AscCommon.g_oTableId.Get_ById(this.Id);
}; };
CChangesCommentsAdd.prototype.CreateReverseChange = function()
{
return new CChangesCommentsRemove(this.Class, this.Id, this.Comment);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -198,6 +202,10 @@ CChangesCommentsRemove.prototype.ReadFromBinary = function(Reader) ...@@ -198,6 +202,10 @@ CChangesCommentsRemove.prototype.ReadFromBinary = function(Reader)
this.Id = Reader.GetString2(); this.Id = Reader.GetString2();
this.Comment = AscCommon.g_oTableId.Get_ById(this.Id); this.Comment = AscCommon.g_oTableId.Get_ById(this.Id);
}; };
CChangesCommentsRemove.prototype.CreateReverseChange = function()
{
return new CChangesCommentsAdd(this.Class, this.Id, this.Comment);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
......
...@@ -174,6 +174,10 @@ CChangesDocumentAddItem.prototype.IsRelated = function(oChanges) ...@@ -174,6 +174,10 @@ CChangesDocumentAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesDocumentAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesDocumentRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -290,6 +294,10 @@ CChangesDocumentRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -290,6 +294,10 @@ CChangesDocumentRemoveItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesDocumentRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesDocumentAddItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -325,6 +333,10 @@ CChangesDocumentDefaultTab.prototype.ReadFromBinary = function(Reader) ...@@ -325,6 +333,10 @@ CChangesDocumentDefaultTab.prototype.ReadFromBinary = function(Reader)
this.New = Reader.GetDouble(); this.New = Reader.GetDouble();
this.Old = Reader.GetDouble(); this.Old = Reader.GetDouble();
}; };
CChangesDocumentDefaultTab.prototype.CreateReverseChange = function()
{
return new CChangesDocumentDefaultTab(this.Class, this.New, this.Old);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -360,6 +372,10 @@ CChangesDocumentEvenAndOddHeaders.prototype.ReadFromBinary = function(Reader) ...@@ -360,6 +372,10 @@ CChangesDocumentEvenAndOddHeaders.prototype.ReadFromBinary = function(Reader)
this.New = Reader.GetBool(); this.New = Reader.GetBool();
this.Old = Reader.GetBool(); this.Old = Reader.GetBool();
}; };
CChangesDocumentEvenAndOddHeaders.prototype.CreateReverseChange = function()
{
return new CChangesDocumentEvenAndOddHeaders(this.Class, this.New, this.Old);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -399,6 +415,10 @@ CChangesDocumentDefaultLanguage.prototype.ReadFromBinary = function(Reader) ...@@ -399,6 +415,10 @@ CChangesDocumentDefaultLanguage.prototype.ReadFromBinary = function(Reader)
this.New = Reader.GetBool(); this.New = Reader.GetBool();
this.Old = Reader.GetBool(); this.Old = Reader.GetBool();
}; };
CChangesDocumentDefaultLanguage.prototype.CreateReverseChange = function()
{
return new CChangesDocumentDefaultLanguage(this.Class, this.New, this.Old);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -437,4 +457,8 @@ CChangesDocumentMathSettings.prototype.ReadFromBinary = function(Reader) ...@@ -437,4 +457,8 @@ CChangesDocumentMathSettings.prototype.ReadFromBinary = function(Reader)
this.New.Read_FromBinary(Reader); this.New.Read_FromBinary(Reader);
this.Old = new CMathSettings(); this.Old = new CMathSettings();
this.Old.Read_FromBinary(Reader); this.Old.Read_FromBinary(Reader);
};
CChangesDocumentMathSettings.prototype.CreateReverseChange = function()
{
return new CChangesDocumentMathSettings(this.Class, this.New, this.Old);
}; };
\ No newline at end of file
...@@ -167,6 +167,10 @@ CChangesDocumentContentAddItem.prototype.IsRelated = function(oChanges) ...@@ -167,6 +167,10 @@ CChangesDocumentContentAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesDocumentContentAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesDocumentContentRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -284,4 +288,8 @@ CChangesDocumentContentRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -284,4 +288,8 @@ CChangesDocumentContentRemoveItem.prototype.IsRelated = function(oChanges)
return true; return true;
return false; return false;
};
CChangesDocumentContentRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesDocumentContentAddItem);
}; };
\ No newline at end of file
...@@ -101,6 +101,10 @@ CChangesParaFieldAddItem.prototype.IsRelated = function(oChanges) ...@@ -101,6 +101,10 @@ CChangesParaFieldAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesParaFieldAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesParaFieldRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -159,4 +163,8 @@ CChangesParaFieldRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -159,4 +163,8 @@ CChangesParaFieldRemoveItem.prototype.IsRelated = function(oChanges)
return true; return true;
return false; return false;
};
CChangesParaFieldRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesParaFieldAddItem);
}; };
\ No newline at end of file
...@@ -76,6 +76,10 @@ CChangesParaFieldAddItem.prototype.ReadFromBinary = function(Reader) ...@@ -76,6 +76,10 @@ CChangesParaFieldAddItem.prototype.ReadFromBinary = function(Reader)
// String : Id // String : Id
this.Id = Reader.GetString2(); this.Id = Reader.GetString2();
}; };
CChangesParaFieldAddItem.prototype.CreateReverseChange = function()
{
return null;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
......
...@@ -130,6 +130,10 @@ CChangesHyperlinkAddItem.prototype.IsRelated = function(oChanges) ...@@ -130,6 +130,10 @@ CChangesHyperlinkAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesHyperlinkAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesHyperlinkRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -187,4 +191,8 @@ CChangesHyperlinkRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -187,4 +191,8 @@ CChangesHyperlinkRemoveItem.prototype.IsRelated = function(oChanges)
return true; return true;
return false; return false;
};
CChangesHyperlinkRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesHyperlinkAddItem);
}; };
\ No newline at end of file
...@@ -152,6 +152,10 @@ CChangesMathContentAddItem.prototype.IsRelated = function(oChanges) ...@@ -152,6 +152,10 @@ CChangesMathContentAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesMathContentAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesMathContentRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -208,6 +212,10 @@ CChangesMathContentRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -208,6 +212,10 @@ CChangesMathContentRemoveItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesMathContentRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesMathContentAddItem);
};
/** /**
* Изменение настроек ArgSize в классе CMathContent * Изменение настроек ArgSize в классе CMathContent
* @constructor * @constructor
...@@ -294,6 +302,10 @@ CChangesMathBaseAddItems.prototype.IsRelated = function(oChanges) ...@@ -294,6 +302,10 @@ CChangesMathBaseAddItems.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesMathBaseAddItems.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesMathBaseRemoveItems);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -341,6 +353,10 @@ CChangesMathBaseRemoveItems.prototype.IsRelated = function(oChanges) ...@@ -341,6 +353,10 @@ CChangesMathBaseRemoveItems.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesMathBaseRemoveItems.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesMathBaseAddItems);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseLongProperty} * @extends {AscDFH.CChangesBaseLongProperty}
...@@ -721,9 +737,9 @@ CChangesMathBaseHighLight.prototype.ReadFromBinary = function(Reader) ...@@ -721,9 +737,9 @@ CChangesMathBaseHighLight.prototype.ReadFromBinary = function(Reader)
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
*/ */
function CChangesMathBaseReviewType(Class, OldType, OldInfo, NewType, NewInfo) function CChangesMathBaseReviewType(Class, Old, New)
{ {
CChangesMathBaseReviewType.superclass.constructor.call(this, Class, {Type : OldType, Info : OldInfo}, {Type : NewType, Info : NewInfo}); CChangesMathBaseReviewType.superclass.constructor.call(this, Class, Old, New);
} }
AscCommon.extendClass(CChangesMathBaseReviewType, AscDFH.CChangesBaseProperty); AscCommon.extendClass(CChangesMathBaseReviewType, AscDFH.CChangesBaseProperty);
CChangesMathBaseReviewType.prototype.Type = AscDFH.historyitem_MathBase_ReviewType; CChangesMathBaseReviewType.prototype.Type = AscDFH.historyitem_MathBase_ReviewType;
...@@ -1238,6 +1254,11 @@ CChangesMathMatrixAddRow.prototype.ReadFromBinary = function(Reader) ...@@ -1238,6 +1254,11 @@ CChangesMathMatrixAddRow.prototype.ReadFromBinary = function(Reader)
this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2()); this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
} }
}; };
CChangesMathMatrixAddRow.prototype.CreateReverseChange = function()
{
// TODO: Это изменение надо целиком переделать
return new CChangesMathMatrixRemoveRow(this.Class, this.Pos, this.Items);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1324,6 +1345,11 @@ CChangesMathMatrixRemoveRow.prototype.ReadFromBinary = function(Reader) ...@@ -1324,6 +1345,11 @@ CChangesMathMatrixRemoveRow.prototype.ReadFromBinary = function(Reader)
this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2()); this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
} }
}; };
CChangesMathMatrixRemoveRow.prototype.CreateReverseChange = function()
{
// TODO: Это изменение надо целиком переделать
return new CChangesMathMatrixAddRow(this.Class, this.Pos, this.Items);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1350,6 +1376,11 @@ CChangesMathMatrixAddColumn.prototype.Redo = function() ...@@ -1350,6 +1376,11 @@ CChangesMathMatrixAddColumn.prototype.Redo = function()
}; };
CChangesMathMatrixAddColumn.prototype.WriteToBinary = CChangesMathMatrixAddRow.prototype.WriteToBinary; CChangesMathMatrixAddColumn.prototype.WriteToBinary = CChangesMathMatrixAddRow.prototype.WriteToBinary;
CChangesMathMatrixAddColumn.prototype.ReadFromBinary = CChangesMathMatrixAddRow.prototype.ReadFromBinary; CChangesMathMatrixAddColumn.prototype.ReadFromBinary = CChangesMathMatrixAddRow.prototype.ReadFromBinary;
CChangesMathMatrixAddColumn.prototype.CreateReverseChange = function()
{
// TODO: Это изменение надо целиком переделать
return new CChangesMathMatrixRemoveColumn(this.Class, this.Pos, this.Items);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1376,6 +1407,11 @@ CChangesMathMatrixRemoveColumn.prototype.Redo = function() ...@@ -1376,6 +1407,11 @@ CChangesMathMatrixRemoveColumn.prototype.Redo = function()
}; };
CChangesMathMatrixRemoveColumn.prototype.WriteToBinary = CChangesMathMatrixRemoveRow.prototype.WriteToBinary; CChangesMathMatrixRemoveColumn.prototype.WriteToBinary = CChangesMathMatrixRemoveRow.prototype.WriteToBinary;
CChangesMathMatrixRemoveColumn.prototype.ReadFromBinary = CChangesMathMatrixRemoveRow.prototype.ReadFromBinary; CChangesMathMatrixRemoveColumn.prototype.ReadFromBinary = CChangesMathMatrixRemoveRow.prototype.ReadFromBinary;
CChangesMathMatrixRemoveColumn.prototype.CreateReverseChange = function()
{
// TODO: Это изменение надо целиком переделать
return new CChangesMathMatrixAddColumn(this.Class, this.Pos, this.Items);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseLongProperty} * @extends {AscDFH.CChangesBaseLongProperty}
...@@ -1466,6 +1502,10 @@ CChangesMathMatrixColumnJc.prototype.ReadFromBinary = function(Reader) ...@@ -1466,6 +1502,10 @@ CChangesMathMatrixColumnJc.prototype.ReadFromBinary = function(Reader)
this.ColumnIndex = Reader.GetLong(); this.ColumnIndex = Reader.GetLong();
}; };
CChangesMathMatrixColumnJc.prototype.CreateReverseChange = function()
{
return new CChangesMathMatrixColumnJc(this.Class, this.New, this.Old, this.ColumnIndex);
};
/** /**
* @constructor * @constructor
...@@ -1558,6 +1598,10 @@ CChangesMathMatrixInterval.prototype.ReadFromBinary = function(Reader) ...@@ -1558,6 +1598,10 @@ CChangesMathMatrixInterval.prototype.ReadFromBinary = function(Reader)
if (!(nFlags & 8)) if (!(nFlags & 8))
this.Old.Gap = Reader.GetLong(); this.Old.Gap = Reader.GetLong();
}; };
CChangesMathMatrixInterval.prototype.CreateReverseChange = function()
{
return new CChangesMathMatrixInterval(this.Class, this.ItemType, this.New.Rule, this.New.Gap, this.Old.Rule, this.Old.Gap);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseBoolProperty} * @extends {AscDFH.CChangesBaseBoolProperty}
......
...@@ -94,6 +94,10 @@ CChangesAbstractNumLvlChange.prototype.Load = function(Color) ...@@ -94,6 +94,10 @@ CChangesAbstractNumLvlChange.prototype.Load = function(Color)
// Сразу нельзя запускать пересчет, т.к. возможно еще не все ссылки проставлены // Сразу нельзя запускать пересчет, т.к. возможно еще не все ссылки проставлены
AscCommon.CollaborativeEditing.Add_EndActions(this.Class, {iLvl : this.Index}); AscCommon.CollaborativeEditing.Add_EndActions(this.Class, {iLvl : this.Index});
}; };
CChangesAbstractNumLvlChange.prototype.CreateReverseChange = function()
{
return new CChangesAbstractNumLvlChange(this.Class, this.New, this.Old, this.Index);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
...@@ -143,6 +147,10 @@ CChangesAbstractNumTextPrChange.prototype.Load = function(Color) ...@@ -143,6 +147,10 @@ CChangesAbstractNumTextPrChange.prototype.Load = function(Color)
// Сразу нельзя запускать пересчет, т.к. возможно еще не все ссылки проставлены // Сразу нельзя запускать пересчет, т.к. возможно еще не все ссылки проставлены
AscCommon.CollaborativeEditing.Add_EndActions(this.Class, {iLvl : this.Index}); AscCommon.CollaborativeEditing.Add_EndActions(this.Class, {iLvl : this.Index});
}; };
CChangesAbstractNumTextPrChange.prototype.CreateReverseChange = function()
{
return new CChangesAbstractNumTextPrChange(this.Class, this.New, this.Old, this.Index);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
...@@ -191,4 +199,8 @@ CChangesAbstractNumParaPrChange.prototype.Load = function(Color) ...@@ -191,4 +199,8 @@ CChangesAbstractNumParaPrChange.prototype.Load = function(Color)
// Сразу нельзя запускать пересчет, т.к. возможно еще не все ссылки проставлены // Сразу нельзя запускать пересчет, т.к. возможно еще не все ссылки проставлены
AscCommon.CollaborativeEditing.Add_EndActions(this.Class, {iLvl : this.Index}); AscCommon.CollaborativeEditing.Add_EndActions(this.Class, {iLvl : this.Index});
};
CChangesAbstractNumParaPrChange.prototype.CreateReverseChange = function()
{
return new CChangesAbstractNumParaPrChange(this.Class, this.New, this.Old, this.Index);
}; };
\ No newline at end of file
...@@ -170,6 +170,10 @@ CChangesParagraphAddItem.prototype.IsRelated = function(oChanges) ...@@ -170,6 +170,10 @@ CChangesParagraphAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesParagraphAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesParagraphRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -230,6 +234,10 @@ CChangesParagraphRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -230,6 +234,10 @@ CChangesParagraphRemoveItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesParagraphRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesParagraphAddItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseObjectProperty} * @extends {AscDFH.CChangesBaseObjectProperty}
...@@ -1023,6 +1031,10 @@ CChangesParagraphSectPr.prototype.ReadFromBinary = function(Reader) ...@@ -1023,6 +1031,10 @@ CChangesParagraphSectPr.prototype.ReadFromBinary = function(Reader)
else else
this.Old = undefined; this.Old = undefined;
}; };
CChangesParagraphSectPr.prototype.CreateReverseChange = function()
{
return new CChangesParagraphSectPr(this.Class, this.New, this.Old);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1143,6 +1155,10 @@ CChangesParagraphPrChange.prototype.ReadFromBinary = function(Reader) ...@@ -1143,6 +1155,10 @@ CChangesParagraphPrChange.prototype.ReadFromBinary = function(Reader)
this.Old.ReviewInfo.Read_FromBinary(Reader); this.Old.ReviewInfo.Read_FromBinary(Reader);
} }
}; };
CChangesParagraphPrChange.prototype.CreateReverseChange = function()
{
return new CChangesParagraphPrChange(this.Class, this.New, this.Old);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseObjectProperty} * @extends {AscDFH.CChangesBaseObjectProperty}
......
...@@ -159,6 +159,10 @@ CChangesRunAddItem.prototype.IsRelated = function(oChanges) ...@@ -159,6 +159,10 @@ CChangesRunAddItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesRunAddItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesRunRemoveItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -229,6 +233,10 @@ CChangesRunRemoveItem.prototype.IsRelated = function(oChanges) ...@@ -229,6 +233,10 @@ CChangesRunRemoveItem.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesRunRemoveItem.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesRunAddItem);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseBoolProperty} * @extends {AscDFH.CChangesBaseBoolProperty}
...@@ -1663,6 +1671,10 @@ CChangesRunOnStartSplit.prototype.Load = function() ...@@ -1663,6 +1671,10 @@ CChangesRunOnStartSplit.prototype.Load = function()
if (AscCommon.CollaborativeEditing) if (AscCommon.CollaborativeEditing)
AscCommon.CollaborativeEditing.OnStart_SplitRun(this.Class, this.Pos); AscCommon.CollaborativeEditing.OnStart_SplitRun(this.Class, this.Pos);
}; };
CChangesRunOnStartSplit.prototype.CreateReverseChange = function()
{
return null;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1694,26 +1706,23 @@ CChangesRunOnEndSplit.prototype.Load = function() ...@@ -1694,26 +1706,23 @@ CChangesRunOnEndSplit.prototype.Load = function()
if (AscCommon.CollaborativeEditing) if (AscCommon.CollaborativeEditing)
AscCommon.CollaborativeEditing.OnEnd_SplitRun(this.NewRun); AscCommon.CollaborativeEditing.OnEnd_SplitRun(this.NewRun);
}; };
CChangesRunOnEndSplit.prototype.CreateReverseChange = function()
{
return null;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBaseProperty}
*/ */
function CChangesRunMathAlnAt(Class, Old, New) function CChangesRunMathAlnAt(Class, Old, New)
{ {
CChangesRunMathAlnAt.superclass.constructor.call(this, Class); CChangesRunMathAlnAt.superclass.constructor.call(this, Class, Old, New);
this.Old = Old;
this.New = New;
} }
AscCommon.extendClass(CChangesRunMathAlnAt, AscDFH.CChangesBase); AscCommon.extendClass(CChangesRunMathAlnAt, AscDFH.CChangesBaseProperty);
CChangesRunMathAlnAt.prototype.Type = AscDFH.historyitem_ParaRun_MathAlnAt; CChangesRunMathAlnAt.prototype.Type = AscDFH.historyitem_ParaRun_MathAlnAt;
CChangesRunMathAlnAt.prototype.Undo = function() CChangesRunMathAlnAt.prototype.private_SetValue = function(Value)
{ {
this.Class.MathPrp.Apply_AlnAt(this.Old); this.Class.MathPrp.Apply_AlnAt(Value);
};
CChangesRunMathAlnAt.prototype.Redo = function()
{
this.Class.MathPrp.Apply_AlnAt(this.Old);
}; };
CChangesRunMathAlnAt.prototype.WriteToBinary = function(Writer) CChangesRunMathAlnAt.prototype.WriteToBinary = function(Writer)
{ {
...@@ -1827,5 +1836,9 @@ CChangesRunMathForcedBreak.prototype.ReadFromBinary = function(Reader) ...@@ -1827,5 +1836,9 @@ CChangesRunMathForcedBreak.prototype.ReadFromBinary = function(Reader)
else else
this.alnAt = Reader.GetLong(); this.alnAt = Reader.GetLong();
}; };
CChangesRunMathForcedBreak.prototype.CreateReverseChange = function()
{
return new CChangesRunMathForcedBreak(this.Class, !this.bInsert, this.alnAt);
};
...@@ -642,6 +642,10 @@ CChangesSectionColumnsCol.prototype.ReadFromBinary = function(Reader) ...@@ -642,6 +642,10 @@ CChangesSectionColumnsCol.prototype.ReadFromBinary = function(Reader)
this.Old.Read_FromBinary(Reader); this.Old.Read_FromBinary(Reader);
} }
}; };
CChangesSectionColumnsCol.prototype.CreateReverseChange = function()
{
return new CChangesSectionColumnsCol(this.Class, this.New, this.Old, this.Index);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
......
...@@ -811,6 +811,10 @@ CChangesStylesAdd.prototype.Load = function() ...@@ -811,6 +811,10 @@ CChangesStylesAdd.prototype.Load = function()
this.Redo(); this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {UpdateStyleId : this.Id}); AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {UpdateStyleId : this.Id});
}; };
CChangesStylesAdd.prototype.CreateReverseChange = function()
{
return new CChangesStylesRemove(this.Class, this.Id, this.Style);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -850,6 +854,10 @@ CChangesStylesRemove.prototype.Load = function() ...@@ -850,6 +854,10 @@ CChangesStylesRemove.prototype.Load = function()
this.Redo(); this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {UpdateStyleId : this.Id}); AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {UpdateStyleId : this.Id});
}; };
CChangesStylesRemove.prototype.CreateReverseChange = function()
{
return new CChangesStylesAdd(this.Class, this.Id, this.Style);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseObjectValue} * @extends {AscDFH.CChangesBaseObjectValue}
......
...@@ -522,6 +522,10 @@ CChangesTableAddRow.prototype.IsRelated = function(oChanges) ...@@ -522,6 +522,10 @@ CChangesTableAddRow.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesTableAddRow.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesTableRemoveRow);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -592,6 +596,10 @@ CChangesTableRemoveRow.prototype.IsRelated = function(oChanges) ...@@ -592,6 +596,10 @@ CChangesTableRemoveRow.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesTableRemoveRow.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesTableAddRow);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
......
...@@ -409,6 +409,10 @@ CChangesTableRowAddCell.prototype.IsRelated = function(oChanges) ...@@ -409,6 +409,10 @@ CChangesTableRowAddCell.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesTableRowAddCell.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesTableRowRemoveCell);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -470,6 +474,10 @@ CChangesTableRowRemoveCell.prototype.IsRelated = function(oChanges) ...@@ -470,6 +474,10 @@ CChangesTableRowRemoveCell.prototype.IsRelated = function(oChanges)
return false; return false;
}; };
CChangesTableRowRemoveCell.prototype.CreateReverseChange = function()
{
return this.private_CreateReverseChange(CChangesTableRowAddCell);
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseBoolProperty} * @extends {AscDFH.CChangesBaseBoolProperty}
......
...@@ -2560,7 +2560,7 @@ CMathBase.prototype.Set_ReviewType = function(Type, isSetToContent) ...@@ -2560,7 +2560,7 @@ CMathBase.prototype.Set_ReviewType = function(Type, isSetToContent)
var NewInfo = new CReviewInfo(); var NewInfo = new CReviewInfo();
NewInfo.Update(); NewInfo.Update();
History.Add(new CChangesMathBaseReviewType(this, this.ReviewType, this.ReviewInfo, Type, NewInfo)); History.Add(new CChangesMathBaseReviewType(this, {Type : this.ReviewType, Info : this.ReviewInfo}, {Type : Type, Info : NewInfo}));
this.raw_SetReviewType(Type, NewInfo); this.raw_SetReviewType(Type, NewInfo);
} }
}; };
...@@ -2571,7 +2571,7 @@ CMathBase.prototype.Set_ReviewTypeWithInfo = function(ReviewType, ReviewInfo) ...@@ -2571,7 +2571,7 @@ CMathBase.prototype.Set_ReviewTypeWithInfo = function(ReviewType, ReviewInfo)
CMathBase.superclass.Set_ReviewTypeWithInfo.apply(this, arguments); CMathBase.superclass.Set_ReviewTypeWithInfo.apply(this, arguments);
History.Add(new CChangesMathBaseReviewType(this, this.ReviewType, this.ReviewInfo, ReviewType, ReviewInfo)); History.Add(new CChangesMathBaseReviewType(this, {Type : this.ReviewType, Info : this.ReviewInfo}, {Type : ReviewType, Info : ReviewInfo}));
this.raw_SetReviewType(ReviewType, ReviewInfo); this.raw_SetReviewType(ReviewType, ReviewInfo);
}; };
CMathBase.prototype.Check_RevisionsChanges = function(Checker, ContentPos, Depth) CMathBase.prototype.Check_RevisionsChanges = function(Checker, ContentPos, Depth)
......
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