Commit d961dcbc authored by Ilya Kirillov's avatar Ilya Kirillov

A new scheme with merging the changes of properties. A new scheme is the...

A new scheme with merging the changes of properties. A new scheme  is the result of development of an undo in collaborative editing of a document. The changes of properties for classes Paragraph, Document, TableId now can be merged.
parent b0995d63
...@@ -78,9 +78,10 @@ CCollaborativeChanges.prototype.Apply_Data = function() ...@@ -78,9 +78,10 @@ CCollaborativeChanges.prototype.Apply_Data = function()
{ {
var oChange = new fChangesClass(Class); var oChange = new fChangesClass(Class);
oChange.ReadFromBinary(Reader); oChange.ReadFromBinary(Reader);
if (true === CollaborativeEditing.private_AddOverallChange(oChange))
oChange.Load(this.m_oColor); oChange.Load(this.m_oColor);
CollaborativeEditing.private_AddOverallChange(oChange);
return true; return true;
} }
else else
...@@ -420,6 +421,9 @@ CCollaborativeEditingBase.prototype.Apply_OtherChanges = function() ...@@ -420,6 +421,9 @@ CCollaborativeEditingBase.prototype.Apply_OtherChanges = function()
// Чтобы заново созданные параграфы не отображались залоченными // Чтобы заново созданные параграфы не отображались залоченными
AscCommon.g_oIdCounter.Set_Load( true ); AscCommon.g_oIdCounter.Set_Load( true );
if (this.m_aChanges.length > 0)
this.private_CollectOwnChanges();
// Применяем изменения, пока они есть // Применяем изменения, пока они есть
var _count = this.m_aChanges.length; var _count = this.m_aChanges.length;
for (var i = 0; i < _count; i++) for (var i = 0; i < _count; i++)
...@@ -734,6 +738,9 @@ CCollaborativeEditingBase.prototype.InitMemory = function() { ...@@ -734,6 +738,9 @@ CCollaborativeEditingBase.prototype.InitMemory = function() {
{ {
this.m_aChanges = []; this.m_aChanges = [];
}; };
CCollaborativeEditingBase.prorotype.private_CollectOwnChanges = function()
{
};
CCollaborativeEditingBase.prototype.private_AddOverallChange = function(oChange) CCollaborativeEditingBase.prototype.private_AddOverallChange = function(oChange)
{ {
}; };
......
...@@ -2878,6 +2878,10 @@ ...@@ -2878,6 +2878,10 @@
{ {
return null; return null;
}; };
CChangesBase.prototype.Merge = function(oChange)
{
return true;
};
window['AscDFH'].CChangesBase = CChangesBase; window['AscDFH'].CChangesBase = CChangesBase;
/** /**
* Базовый класс для изменений, которые меняют содержимое родительского класса.* * Базовый класс для изменений, которые меняют содержимое родительского класса.*
...@@ -3041,6 +3045,7 @@ ...@@ -3041,6 +3045,7 @@
{ {
var oChange = new fConstructor(); var oChange = new fConstructor();
oChange.Class = this.Class;
oChange.Pos = this.Pos; oChange.Pos = this.Pos;
oChange.Items = this.Items; oChange.Items = this.Items;
oChange.Add = !this.Add; oChange.Add = !this.Add;
...@@ -3052,6 +3057,11 @@ ...@@ -3052,6 +3057,11 @@
return oChange; return oChange;
}; };
CChangesBaseContentChange.prototype.Merge = function(oChange)
{
// TODO: Сюда надо бы перенести работу с ContentChanges
return true;
};
window['AscDFH'].CChangesBaseContentChange = CChangesBaseContentChange; window['AscDFH'].CChangesBaseContentChange = CChangesBaseContentChange;
/** /**
* Базовый класс для изменения свойств. * Базовый класс для изменения свойств.
...@@ -3083,6 +3093,17 @@ ...@@ -3083,6 +3093,17 @@
{ {
return new this.constructor(this.Class, this.New, this.Old, this.Color); return new this.constructor(this.Class, this.New, this.Old, this.Color);
}; };
CChangesBaseProperty.prototype.Merge = function(oChange)
{
if (oChange.Class === this.Class && oChange.Type === this.Type)
{
this.New = oChange.New;
return false;
}
return true;
};
window['AscDFH'].CChangesBaseProperty = CChangesBaseProperty; window['AscDFH'].CChangesBaseProperty = CChangesBaseProperty;
/** /**
* Базовый класс для изменения булевых свойств. * Базовый класс для изменения булевых свойств.
......
...@@ -50,6 +50,8 @@ function CWordCollaborativeEditing() ...@@ -50,6 +50,8 @@ function CWordCollaborativeEditing()
this.m_aAllChanges = []; // Список всех изменений this.m_aAllChanges = []; // Список всех изменений
this.m_aOwnChangesIndexes = []; // Список номеров своих изменений в общем списке, которые мы можем откатить this.m_aOwnChangesIndexes = []; // Список номеров своих изменений в общем списке, которые мы можем откатить
this.m_oOwnChanges = [];
} }
AscCommon.extendClass(CWordCollaborativeEditing, AscCommon.CCollaborativeEditingBase); AscCommon.extendClass(CWordCollaborativeEditing, AscCommon.CCollaborativeEditingBase);
...@@ -598,9 +600,38 @@ CWordCollaborativeEditing.prototype.private_ClearChanges = function() ...@@ -598,9 +600,38 @@ CWordCollaborativeEditing.prototype.private_ClearChanges = function()
{ {
this.m_aChanges = []; this.m_aChanges = [];
}; };
CWordCollaborativeEditing.prototype.private_CollectOwnChanges = function()
{
var StartPoint = ( null === AscCommon.History.SavedIndex ? 0 : AscCommon.History.SavedIndex + 1 );
var LastPoint = -1;
if (this.m_nUseType <= 0)
LastPoint = AscCommon.History.Points.length - 1;
else
LastPoint = AscCommon.History.Index;
for (var PointIndex = StartPoint; PointIndex <= LastPoint; PointIndex++)
{
var Point = AscCommon.History.Points[PointIndex];
for (var Index = 0; Index < Point.Items.length; Index++)
{
var Item = Point.Items[Index];
if (Item.Data.IsChangesClass && Item.Data.IsChangesClass())
this.m_oOwnChanges.push(Item.Data);
}
}
};
CWordCollaborativeEditing.prototype.private_AddOverallChange = function(oChange) CWordCollaborativeEditing.prototype.private_AddOverallChange = function(oChange)
{ {
// Здесь мы должны смержить пришедшее изменение с одним из наших изменений
for (var nIndex = 0, nCount = this.m_oOwnChanges.length; nIndex < nCount; ++nIndex)
{
if (false === oChange.Merge(this.m_oOwnChanges[nIndex]))
return false;
}
this.m_aAllChanges.push(oChange); this.m_aAllChanges.push(oChange);
return true;
}; };
CWordCollaborativeEditing.prototype.private_OnSendOwnChanges = function(arrChanges, nDeleteIndex) CWordCollaborativeEditing.prototype.private_OnSendOwnChanges = function(arrChanges, nDeleteIndex)
{ {
...@@ -621,6 +652,9 @@ CWordCollaborativeEditing.prototype.private_OnSendOwnChanges = function(arrChang ...@@ -621,6 +652,9 @@ CWordCollaborativeEditing.prototype.private_OnSendOwnChanges = function(arrChang
}; };
CWordCollaborativeEditing.prototype.Undo = function() CWordCollaborativeEditing.prototype.Undo = function()
{ {
if (true === this.Get_GlobalLock())
return;
if (this.m_aOwnChangesIndexes.length <= 0) if (this.m_aOwnChangesIndexes.length <= 0)
return false; return false;
...@@ -667,6 +701,35 @@ CWordCollaborativeEditing.prototype.Undo = function() ...@@ -667,6 +701,35 @@ CWordCollaborativeEditing.prototype.Undo = function()
// Удаляем запись о последнем изменении // Удаляем запись о последнем изменении
this.m_aOwnChangesIndexes.length = this.m_aOwnChangesIndexes.length - 1; this.m_aOwnChangesIndexes.length = this.m_aOwnChangesIndexes.length - 1;
var arrReverseChanges = [];
for (var nIndex = 0, nCount = arrChanges.length; nIndex < nCount; ++nIndex)
{
var oReverseChange = arrChanges[nIndex].CreateReverseChange();
if (oReverseChange)
arrReverseChanges.splice(0, 0, oReverseChange);
}
var oLogicDocument = this.m_oLogicDocument;
oLogicDocument.DrawingDocument.EndTrackTable(null, true);
oLogicDocument.DrawingObjects.TurnOffCheckChartSelection();
for (var nIndex = arrReverseChanges.length - 1; nIndex >= 0; --nIndex)
{
arrReverseChanges[nIndex].Load();
}
oLogicDocument.DrawingObjects.TurnOnCheckChartSelection();
oLogicDocument.Recalculate(false, false, AscCommon.History.Get_RecalcData(null, arrReverseChanges));
oLogicDocument.Document_UpdateSelectionState();
oLogicDocument.Document_UpdateInterfaceState();
oLogicDocument.Document_UpdateRulersState();
}; };
CWordCollaborativeEditing.prototype.CanUndo = function() CWordCollaborativeEditing.prototype.CanUndo = function()
{ {
......
...@@ -857,12 +857,21 @@ CHistory.prototype = ...@@ -857,12 +857,21 @@ CHistory.prototype =
return false; return false;
}, },
Get_RecalcData : function(RecalcData) Get_RecalcData : function(RecalcData, arrChanges)
{ {
if (RecalcData) if (RecalcData)
{ {
this.RecalculateData = RecalcData; this.RecalculateData = RecalcData;
} }
else if (arrChanges)
{
this.Internal_RecalcData_Clear();
for (var nIndex = 0, nCount = arrChanges.length; nIndex < nCount; ++nIndex)
{
var oChange = arrChanges[nIndex];
oChange.RefreshRecalcData();
}
}
else else
{ {
if (this.Index >= 0) if (this.Index >= 0)
......
...@@ -88,6 +88,79 @@ function private_ParagraphChangesOnSetValue(oParagraph) ...@@ -88,6 +88,79 @@ function private_ParagraphChangesOnSetValue(oParagraph)
oParagraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All); oParagraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All);
} }
//----------------------------------------------------------------------------------------------------------------------
// Карта зависимости изменений
//----------------------------------------------------------------------------------------------------------------------
// AscDFH.paragraphChangesRelationMap = {};
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_AddItem] = [AscDFH.historyitem_Paragraph_AddItem, AscDFH.historyitem_Paragraph_RemoveItem];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_RemoveItem] = [AscDFH.historyitem_Paragraph_AddItem, AscDFH.historyitem_Paragraph_RemoveItem];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Numbering] = [AscDFH.historyitem_Paragraph_Numbering, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Align] = [AscDFH.historyitem_Paragraph_Align, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Ind_First] = [AscDFH.historyitem_Paragraph_Ind_First, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Ind_Right] = [AscDFH.historyitem_Paragraph_Ind_Right, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Ind_Left] = [AscDFH.historyitem_Paragraph_Ind_Left, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_ContextualSpacing] = [AscDFH.historyitem_Paragraph_ContextualSpacing, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_KeepLines] = [AscDFH.historyitem_Paragraph_KeepLines, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_KeepNext] = [AscDFH.historyitem_Paragraph_KeepNext, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_PageBreakBefore] = [AscDFH.historyitem_Paragraph_PageBreakBefore, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Spacing_Line] = [AscDFH.historyitem_Paragraph_Spacing_Line, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Spacing_LineRule] = [AscDFH.historyitem_Paragraph_Spacing_LineRule, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Spacing_Before] = [AscDFH.historyitem_Paragraph_Spacing_Before, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Spacing_After] = [AscDFH.historyitem_Paragraph_Spacing_After, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing] = [AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing] = [AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Shd_Value] = [AscDFH.historyitem_Paragraph_Shd_Value, AscDFH.historyitem_Paragraph_Shd, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Shd_Color] = [AscDFH.historyitem_Paragraph_Shd_Color, AscDFH.historyitem_Paragraph_Shd, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Shd_Unifill] = [AscDFH.historyitem_Paragraph_Shd_Unifill, AscDFH.historyitem_Paragraph_Shd, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Shd] = [AscDFH.historyitem_Paragraph_Shd_Value, AscDFH.historyitem_Paragraph_Shd_Color, AscDFH.historyitem_Paragraph_Shd_Unifill, AscDFH.historyitem_Paragraph_Shd, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_WidowControl] = [AscDFH.historyitem_Paragraph_WidowControl, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Tabs] = [AscDFH.historyitem_Paragraph_Tabs, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_PStyle] = [AscDFH.historyitem_Paragraph_PStyle, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Borders_Between] = [AscDFH.historyitem_Paragraph_Borders_Between, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Borders_Bottom] = [AscDFH.historyitem_Paragraph_Borders_Bottom, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Borders_Left] = [AscDFH.historyitem_Paragraph_Borders_Left, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Borders_Right] = [AscDFH.historyitem_Paragraph_Borders_Right, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Borders_Top] = [AscDFH.historyitem_Paragraph_Borders_Top, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_Pr] = [AscDFH.historyitem_Paragraph_Pr,
// AscDFH.historyitem_Paragraph_Numbering, AscDFH.historyitem_Paragraph_Align, AscDFH.historyitem_Paragraph_Ind_First, AscDFH.historyitem_Paragraph_Ind_Right,
// AscDFH.historyitem_Paragraph_Ind_Left, AscDFH.historyitem_Paragraph_ContextualSpacing, AscDFH.historyitem_Paragraph_KeepLines, AscDFH.historyitem_Paragraph_KeepNext,
// AscDFH.historyitem_Paragraph_PageBreakBefore, AscDFH.historyitem_Paragraph_Spacing_Line, AscDFH.historyitem_Paragraph_Spacing_LineRule, AscDFH.historyitem_Paragraph_Spacing_Before,
// AscDFH.historyitem_Paragraph_Spacing_After, AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing, AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing, AscDFH.historyitem_Paragraph_Shd_Value,
// AscDFH.historyitem_Paragraph_Shd_Color, AscDFH.historyitem_Paragraph_Shd_Unifill, AscDFH.historyitem_Paragraph_Shd, AscDFH.historyitem_Paragraph_WidowControl, AscDFH.historyitem_Paragraph_Tabs,
// AscDFH.historyitem_Paragraph_PStyle, AscDFH.historyitem_Paragraph_Borders_Between, AscDFH.historyitem_Paragraph_Borders_Bottom, AscDFH.historyitem_Paragraph_Borders_Left,
// AscDFH.historyitem_Paragraph_Borders_Right, AscDFH.historyitem_Paragraph_Borders_Top, AscDFH.historyitem_Paragraph_PresentationPr_Bullet, AscDFH.historyitem_Paragraph_PresentationPr_Level,
// AscDFH.historyitem_Paragraph_FramePr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_PresentationPr_Bullet] = [AscDFH.historyitem_Paragraph_PresentationPr_Bullet, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_PresentationPr_Level] = [AscDFH.historyitem_Paragraph_PresentationPr_Level, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_FramePr] = [AscDFH.historyitem_Paragraph_FramePr, AscDFH.historyitem_Paragraph_Pr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_SectionPr] = [AscDFH.historyitem_Paragraph_SectionPr];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_PrChange] = [AscDFH.historyitem_Paragraph_PrChange];
// AscDFH.paragraphChangesRelationMap[AscDFH.historyitem_Paragraph_PrReviewInfo] = [AscDFH.historyitem_Paragraph_PrReviewInfo];
// Общая функция Merge для изменений, которые зависят только от себя и AscDFH.historyitem_Paragraph_Pr
function private_ParagraphChangesOnMergePr(oChange)
{
if (oChange.Class !== this.Class)
return true;
if (oChange.Type === this.Type || oChange.Type === AscDFH.historyitem_Paragraph_Pr)
return false;
return true;
}
// Общая функция Merge для изменений, которые зависят от себя, AscDFH.historyitem_Paragraph_Shd, AscDFH.historyitem_Paragraph_Pr
function private_ParagraphChangesOnMergeShdPr(oChange)
{
if (oChange.Class !== this.Class)
return true;
if (oChange.Type === this.Type || oChange.Type === AscDFH.historyitem_Paragraph_Pr || oChange.Type === AscDFH.historyitem_Paragraph_Shd)
return false;
return true;
}
//----------------------------------------------------------------------------------------------------------------------
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseContentChange} * @extends {AscDFH.CChangesBaseContentChange}
...@@ -263,6 +336,7 @@ CChangesParagraphNumbering.prototype.private_SetValue = function(Value) ...@@ -263,6 +336,7 @@ CChangesParagraphNumbering.prototype.private_SetValue = function(Value)
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphNumbering.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphNumbering.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphNumbering.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -283,6 +357,7 @@ CChangesParagraphAlign.prototype.private_SetValue = function(Value) ...@@ -283,6 +357,7 @@ CChangesParagraphAlign.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphAlign.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphAlign.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphAlign.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -307,6 +382,7 @@ CChangesParagraphIndFirst.prototype.private_SetValue = function(Value) ...@@ -307,6 +382,7 @@ CChangesParagraphIndFirst.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphIndFirst.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphIndFirst.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphIndFirst.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -331,6 +407,7 @@ CChangesParagraphIndLeft.prototype.private_SetValue = function(Value) ...@@ -331,6 +407,7 @@ CChangesParagraphIndLeft.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphIndLeft.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphIndLeft.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphIndLeft.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -355,6 +432,7 @@ CChangesParagraphIndRight.prototype.private_SetValue = function(Value) ...@@ -355,6 +432,7 @@ CChangesParagraphIndRight.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphIndRight.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphIndRight.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphIndRight.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -375,6 +453,7 @@ CChangesParagraphContextualSpacing.prototype.private_SetValue = function(Value) ...@@ -375,6 +453,7 @@ CChangesParagraphContextualSpacing.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphContextualSpacing.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphContextualSpacing.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphContextualSpacing.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -395,6 +474,7 @@ CChangesParagraphKeepLines.prototype.private_SetValue = function(Value) ...@@ -395,6 +474,7 @@ CChangesParagraphKeepLines.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphKeepLines.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphKeepLines.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphKeepLines.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -415,6 +495,7 @@ CChangesParagraphKeepNext.prototype.private_SetValue = function(Value) ...@@ -415,6 +495,7 @@ CChangesParagraphKeepNext.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphKeepNext.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphKeepNext.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphKeepNext.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -435,6 +516,7 @@ CChangesParagraphPageBreakBefore.prototype.private_SetValue = function(Value) ...@@ -435,6 +516,7 @@ CChangesParagraphPageBreakBefore.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphPageBreakBefore.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphPageBreakBefore.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphPageBreakBefore.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -459,6 +541,7 @@ CChangesParagraphSpacingLine.prototype.private_SetValue = function(Value) ...@@ -459,6 +541,7 @@ CChangesParagraphSpacingLine.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphSpacingLine.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphSpacingLine.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphSpacingLine.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -483,6 +566,7 @@ CChangesParagraphSpacingLineRule.prototype.private_SetValue = function(Value) ...@@ -483,6 +566,7 @@ CChangesParagraphSpacingLineRule.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphSpacingLineRule.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphSpacingLineRule.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphSpacingLineRule.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -507,6 +591,7 @@ CChangesParagraphSpacingBefore.prototype.private_SetValue = function(Value) ...@@ -507,6 +591,7 @@ CChangesParagraphSpacingBefore.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphSpacingBefore.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphSpacingBefore.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphSpacingBefore.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -531,6 +616,7 @@ CChangesParagraphSpacingAfter.prototype.private_SetValue = function(Value) ...@@ -531,6 +616,7 @@ CChangesParagraphSpacingAfter.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphSpacingAfter.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphSpacingAfter.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphSpacingAfter.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -555,6 +641,7 @@ CChangesParagraphSpacingAfterAutoSpacing.prototype.private_SetValue = function(V ...@@ -555,6 +641,7 @@ CChangesParagraphSpacingAfterAutoSpacing.prototype.private_SetValue = function(V
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphSpacingAfterAutoSpacing.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphSpacingAfterAutoSpacing.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphSpacingAfterAutoSpacing.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -579,6 +666,7 @@ CChangesParagraphSpacingBeforeAutoSpacing.prototype.private_SetValue = function( ...@@ -579,6 +666,7 @@ CChangesParagraphSpacingBeforeAutoSpacing.prototype.private_SetValue = function(
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphSpacingBeforeAutoSpacing.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphSpacingBeforeAutoSpacing.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphSpacingBeforeAutoSpacing.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -603,6 +691,7 @@ CChangesParagraphShdValue.prototype.private_SetValue = function(Value) ...@@ -603,6 +691,7 @@ CChangesParagraphShdValue.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphShdValue.prototype.Merge = private_ParagraphChangesOnMergeShdPr;
CChangesParagraphShdValue.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphShdValue.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -631,6 +720,7 @@ CChangesParagraphShdColor.prototype.private_SetValue = function(Value) ...@@ -631,6 +720,7 @@ CChangesParagraphShdColor.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphShdColor.prototype.Merge = private_ParagraphChangesOnMergeShdPr;
CChangesParagraphShdColor.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphShdColor.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -659,6 +749,7 @@ CChangesParagraphShdUnifill.prototype.private_SetValue = function(Value) ...@@ -659,6 +749,7 @@ CChangesParagraphShdUnifill.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphShdUnifill.prototype.Merge = private_ParagraphChangesOnMergeShdPr;
CChangesParagraphShdUnifill.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphShdUnifill.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -683,6 +774,38 @@ CChangesParagraphShd.prototype.private_SetValue = function(Value) ...@@ -683,6 +774,38 @@ CChangesParagraphShd.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphShd.prototype.Merge = function(oChange)
{
if (this.Class !== oChange.Class)
return true;
if (this.Type === oChange.Type || oChange.Type === AscDFH.historyitem_Paragraph_Pr)
return false;
if (AscDFH.historyitem_Paragraph_Shd_Value === oChange.Type)
{
if (!this.New)
this.New = new CDocumentShd();
this.New.Value = oChange.New;
}
else if (AscDFH.historyitem_Paragraph_Shd_Color === oChange.Type)
{
if (!this.New)
this.New = new CDocumentShd();
this.New.Color = oChange.New;
}
else if (AscDFH.historyitem_Paragraph_Shd_Unifill === oChange.Type)
{
if (!this.New)
this.New = new CDocumentShd();
this.New.Unifill = oChange.New;
}
return true;
};
CChangesParagraphShd.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphShd.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -703,6 +826,7 @@ CChangesParagraphWidowControl.prototype.private_SetValue = function(Value) ...@@ -703,6 +826,7 @@ CChangesParagraphWidowControl.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphWidowControl.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphWidowControl.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphWidowControl.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -727,6 +851,7 @@ CChangesParagraphTabs.prototype.private_SetValue = function(Value) ...@@ -727,6 +851,7 @@ CChangesParagraphTabs.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphTabs.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphTabs.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphTabs.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -747,6 +872,7 @@ CChangesParagraphPStyle.prototype.private_SetValue = function(Value) ...@@ -747,6 +872,7 @@ CChangesParagraphPStyle.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphPStyle.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphPStyle.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphPStyle.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -771,6 +897,7 @@ CChangesParagraphBordersBetween.prototype.private_SetValue = function(Value) ...@@ -771,6 +897,7 @@ CChangesParagraphBordersBetween.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphBordersBetween.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphBordersBetween.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphBordersBetween.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -795,6 +922,7 @@ CChangesParagraphBordersBottom.prototype.private_SetValue = function(Value) ...@@ -795,6 +922,7 @@ CChangesParagraphBordersBottom.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphBordersBottom.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphBordersBottom.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphBordersBottom.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -819,6 +947,7 @@ CChangesParagraphBordersLeft.prototype.private_SetValue = function(Value) ...@@ -819,6 +947,7 @@ CChangesParagraphBordersLeft.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphBordersLeft.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphBordersLeft.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphBordersLeft.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -843,6 +972,7 @@ CChangesParagraphBordersRight.prototype.private_SetValue = function(Value) ...@@ -843,6 +972,7 @@ CChangesParagraphBordersRight.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphBordersRight.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphBordersRight.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphBordersRight.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -867,6 +997,7 @@ CChangesParagraphBordersTop.prototype.private_SetValue = function(Value) ...@@ -867,6 +997,7 @@ CChangesParagraphBordersTop.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphBordersTop.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphBordersTop.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphBordersTop.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -895,6 +1026,209 @@ CChangesParagraphPr.prototype.private_IsCreateEmptyObject = function() ...@@ -895,6 +1026,209 @@ CChangesParagraphPr.prototype.private_IsCreateEmptyObject = function()
{ {
return true; return true;
}; };
CChangesParagraphPr.prototype.Merge = function(oChange)
{
if (this.Class !== oChange.Class)
return;
if (AscDFH.historyitem_Paragraph_Pr === oChange.Type)
return false;
if (!this.New)
this.New = new CParaPr();
switch (oChange.Type)
{
case AscDFH.historyitem_Paragraph_Numbering:
{
this.New.NumPr = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Align:
{
this.New.Jc = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Ind_First:
{
if (!this.New.Ind)
this.New.Ind = new CParaInd();
this.New.Ind.FirstLine = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Ind_Right:
{
if (!this.New.Ind)
this.New.Ind = new CParaInd();
this.New.Ind.Right = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Ind_Left:
{
if (!this.New.Ind)
this.New.Ind = new CParaInd();
this.New.Ind.Left = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_ContextualSpacing:
{
this.New.ContextualSpacing = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_KeepLines:
{
this.New.KeepLines = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_KeepNext:
{
this.New.KeepNext = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_PageBreakBefore:
{
this.New.PageBreakBefore = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Spacing_Line:
{
if (!this.New.Spacing)
this.New.Spacing = new CParaSpacing();
this.New.Spacing.Line = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Spacing_LineRule:
{
if (!this.New.Spacing)
this.New.Spacing = new CParaSpacing();
this.New.Spacing.LineRule = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Spacing_Before:
{
if (!this.New.Spacing)
this.New.Spacing = new CParaSpacing();
this.New.Spacing.Before = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Spacing_After:
{
if (!this.New.Spacing)
this.New.Spacing = new CParaSpacing();
this.New.Spacing.After = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:
{
if (!this.New.Spacing)
this.New.Spacing = new CParaSpacing();
this.New.Spacing.AfterAutoSpacing = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:
{
if (!this.New.Spacing)
this.New.Spacing = new CParaSpacing();
this.New.Spacing.BeforeAutoSpacing = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Shd_Value:
{
if (!this.New.Shd)
this.New.Shd = new CDocumentShd();
this.New.Shd.Value = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Shd_Color:
{
if (!this.New.Shd)
this.New.Shd = new CDocumentShd();
this.New.Shd.Color = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Shd_Unifill:
{
if (!this.New.Shd)
this.New.Shd = new CDocumentShd();
this.New.Shd.Unifill = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Shd:
{
this.New.Shd = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_WidowControl:
{
this.New.WidowControl = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Tabs:
{
this.New.Tabs = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_PStyle:
{
this.New.PStyle = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Borders_Between:
{
this.New.Brd.Between = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Borders_Bottom:
{
this.New.Brd.Bottom = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Borders_Left:
{
this.New.Brd.Left = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Borders_Right:
{
this.New.Brd.Right = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_Borders_Top:
{
this.New.Brd.Top = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:
{
this.New.Bullet = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_PresentationPr_Level:
{
this.New.Lvl = oChange.New;
break;
}
case AscDFH.historyitem_Paragraph_FramePr:
{
this.New.FramePr = oChange.New;
break;
}
}
return true;
};
CChangesParagraphPr.prototype.Load = private_ParagraphChangesOnLoadPr; CChangesParagraphPr.prototype.Load = private_ParagraphChangesOnLoadPr;
/** /**
* @constructor * @constructor
...@@ -910,6 +1244,7 @@ CChangesParagraphPresentationPrBullet.prototype.private_CreateObject = function( ...@@ -910,6 +1244,7 @@ CChangesParagraphPresentationPrBullet.prototype.private_CreateObject = function(
{ {
return new AscFormat.CBullet(); return new AscFormat.CBullet();
}; };
CChangesParagraphPresentationPrBullet.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphPresentationPrBullet.prototype.private_SetValue = function(Value) CChangesParagraphPresentationPrBullet.prototype.private_SetValue = function(Value)
{ {
var oParagraph = this.Class; var oParagraph = this.Class;
...@@ -929,6 +1264,7 @@ function CChangesParagraphPresentationPrLevel(Class, Old, New, Color) ...@@ -929,6 +1264,7 @@ function CChangesParagraphPresentationPrLevel(Class, Old, New, Color)
} }
AscCommon.extendClass(CChangesParagraphPresentationPrLevel, AscDFH.CChangesBaseLongProperty); AscCommon.extendClass(CChangesParagraphPresentationPrLevel, AscDFH.CChangesBaseLongProperty);
CChangesParagraphPresentationPrLevel.prototype.Type = AscDFH.historyitem_Paragraph_PresentationPr_Level; CChangesParagraphPresentationPrLevel.prototype.Type = AscDFH.historyitem_Paragraph_PresentationPr_Level;
CChangesParagraphPresentationPrLevel.prototype.Merge = private_ParagraphChangesOnMergePr;
CChangesParagraphPresentationPrLevel.prototype.private_SetValue = function(Value) CChangesParagraphPresentationPrLevel.prototype.private_SetValue = function(Value)
{ {
var oParagraph = this.Class; var oParagraph = this.Class;
...@@ -960,6 +1296,7 @@ CChangesParagraphFramePr.prototype.private_SetValue = function(Value) ...@@ -960,6 +1296,7 @@ CChangesParagraphFramePr.prototype.private_SetValue = function(Value)
oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false); oParagraph.private_UpdateTrackRevisionOnChangeParaPr(false);
private_ParagraphChangesOnSetValue(this.Class); private_ParagraphChangesOnSetValue(this.Class);
}; };
CChangesParagraphFramePr.prototype.Merge = private_ParagraphChangesOnMergePr;
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1035,6 +1372,13 @@ CChangesParagraphSectPr.prototype.CreateReverseChange = function() ...@@ -1035,6 +1372,13 @@ CChangesParagraphSectPr.prototype.CreateReverseChange = function()
{ {
return new CChangesParagraphSectPr(this.Class, this.New, this.Old); return new CChangesParagraphSectPr(this.Class, this.New, this.Old);
}; };
CChangesParagraphSectPr.prototype.Merge = function(oChange)
{
if (oChange.Class === this.Class && oChange.Type === this.Type)
return false;
return true;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -1159,6 +1503,13 @@ CChangesParagraphPrChange.prototype.CreateReverseChange = function() ...@@ -1159,6 +1503,13 @@ CChangesParagraphPrChange.prototype.CreateReverseChange = function()
{ {
return new CChangesParagraphPrChange(this.Class, this.New, this.Old); return new CChangesParagraphPrChange(this.Class, this.New, this.Old);
}; };
CChangesParagraphPrChange.prototype.Merge = function(oChange)
{
if (oChange.Class === this.Class && oChange.Type === this.Type)
return false;
return true;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseObjectProperty} * @extends {AscDFH.CChangesBaseObjectProperty}
......
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