Commit 42dda9af authored by Ilya Kirillov's avatar Ilya Kirillov

Changes for classes Footnotes/Sections were added to relation map. Also was...

Changes for classes Footnotes/Sections were added to relation map. Also was implemented merge functions for this changes.
parent adac6b23
...@@ -46,6 +46,19 @@ AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumStart] = C ...@@ -46,6 +46,19 @@ AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumStart] = C
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumRestart] = CChangesFootnotesSetFootnotePrNumRestart; AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumRestart] = CChangesFootnotesSetFootnotePrNumRestart;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumFormat] = CChangesFootnotesSetFootnotePrNumFormat; AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumFormat] = CChangesFootnotesSetFootnotePrNumFormat;
//----------------------------------------------------------------------------------------------------------------------
// Карта зависимости изменений
//----------------------------------------------------------------------------------------------------------------------
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_AddFootnote] = [AscDFH.historyitem_Footnotes_AddFootnote];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetSeparator] = [AscDFH.historyitem_Footnotes_SetSeparator];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetContinuationSeparator] = [AscDFH.historyitem_Footnotes_SetContinuationSeparator];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetContinuationNotice] = [AscDFH.historyitem_Footnotes_SetContinuationNotice];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetFootnotePrPos] = [AscDFH.historyitem_Footnotes_SetFootnotePrPos];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetFootnotePrNumStart] = [AscDFH.historyitem_Footnotes_SetFootnotePrNumStart];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetFootnotePrNumRestart] = [AscDFH.historyitem_Footnotes_SetFootnotePrNumRestart];
AscDFH.changesRelationMap[AscDFH.historyitem_Footnotes_SetFootnotePrNumFormat] = [AscDFH.historyitem_Footnotes_SetFootnotePrNumFormat];
//----------------------------------------------------------------------------------------------------------------------
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBase} * @extends {AscDFH.CChangesBase}
...@@ -80,6 +93,16 @@ CChangesParaFieldAddItem.prototype.CreateReverseChange = function() ...@@ -80,6 +93,16 @@ CChangesParaFieldAddItem.prototype.CreateReverseChange = function()
{ {
return null; return null;
}; };
CChangesParaFieldAddItem.prototype.Merge = function(oChange)
{
if (this.Class !== oChange.Class)
return true;
if (this.Type === oChange.Type && this.Id === oChange.Id)
return false;
return true;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
......
...@@ -70,6 +70,43 @@ AscDFH.changesFactory[AscDFH.historyitem_Section_Footnote_NumStart] = CChanges ...@@ -70,6 +70,43 @@ AscDFH.changesFactory[AscDFH.historyitem_Section_Footnote_NumStart] = CChanges
AscDFH.changesFactory[AscDFH.historyitem_Section_Footnote_NumRestart] = CChangesSectionFootnoteNumRestart; AscDFH.changesFactory[AscDFH.historyitem_Section_Footnote_NumRestart] = CChangesSectionFootnoteNumRestart;
AscDFH.changesFactory[AscDFH.historyitem_Section_Footnote_NumFormat] = CChangesSectionFootnoteNumFormat; AscDFH.changesFactory[AscDFH.historyitem_Section_Footnote_NumFormat] = CChangesSectionFootnoteNumFormat;
//----------------------------------------------------------------------------------------------------------------------
// Карта зависимости изменений
//----------------------------------------------------------------------------------------------------------------------
AscDFH.changesRelationMap[AscDFH.historyitem_Section_PageSize_Orient] = [AscDFH.historyitem_Section_PageSize_Orient];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_PageSize_Size] = [AscDFH.historyitem_Section_PageSize_Size];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_PageMargins] = [AscDFH.historyitem_Section_PageMargins];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Type] = [AscDFH.historyitem_Section_Type];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_Left] = [AscDFH.historyitem_Section_Borders_Left];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_Top] = [AscDFH.historyitem_Section_Borders_Top];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_Right] = [AscDFH.historyitem_Section_Borders_Right];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_Bottom] = [AscDFH.historyitem_Section_Borders_Bottom];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_Display] = [AscDFH.historyitem_Section_Borders_Display];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_OffsetFrom] = [AscDFH.historyitem_Section_Borders_OffsetFrom];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Borders_ZOrder] = [AscDFH.historyitem_Section_Borders_ZOrder];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Header_First] = [AscDFH.historyitem_Section_Header_First];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Header_Even] = [AscDFH.historyitem_Section_Header_Even];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Header_Default] = [AscDFH.historyitem_Section_Header_Default];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footer_First] = [AscDFH.historyitem_Section_Footer_First];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footer_Even] = [AscDFH.historyitem_Section_Footer_Even];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footer_Default] = [AscDFH.historyitem_Section_Footer_Default];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_TitlePage] = [AscDFH.historyitem_Section_TitlePage];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_PageMargins_Header] = [AscDFH.historyitem_Section_PageMargins_Header];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_PageMargins_Footer] = [AscDFH.historyitem_Section_PageMargins_Footer];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_PageNumType_Start] = [AscDFH.historyitem_Section_PageNumType_Start];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Columns_EqualWidth] = [AscDFH.historyitem_Section_Columns_EqualWidth];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Columns_Space] = [AscDFH.historyitem_Section_Columns_Space];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Columns_Num] = [AscDFH.historyitem_Section_Columns_Num];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Columns_Sep] = [AscDFH.historyitem_Section_Columns_Sep];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Columns_Col] = [AscDFH.historyitem_Section_Columns_Col, AscDFH.historyitem_Section_Columns_SetCols];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Columns_SetCols] = [AscDFH.historyitem_Section_Columns_Col, AscDFH.historyitem_Section_Columns_SetCols];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footnote_Pos] = [AscDFH.historyitem_Section_Footnote_Pos];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footnote_NumStart] = [AscDFH.historyitem_Section_Footnote_NumStart];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footnote_NumRestart] = [AscDFH.historyitem_Section_Footnote_NumRestart];
AscDFH.changesRelationMap[AscDFH.historyitem_Section_Footnote_NumFormat] = [AscDFH.historyitem_Section_Footnote_NumFormat];
//----------------------------------------------------------------------------------------------------------------------
/** /**
* Базовый класс для изменения колонтитулов * Базовый класс для изменения колонтитулов
...@@ -646,6 +683,25 @@ CChangesSectionColumnsCol.prototype.CreateReverseChange = function() ...@@ -646,6 +683,25 @@ CChangesSectionColumnsCol.prototype.CreateReverseChange = function()
{ {
return new CChangesSectionColumnsCol(this.Class, this.New, this.Old, this.Index); return new CChangesSectionColumnsCol(this.Class, this.New, this.Old, this.Index);
}; };
CChangesSectionColumnsCol.prototype.Merge = function(oChange)
{
if (this.Class !== oChange.Class)
return true;
if (this.Type === oChange.Type)
{
if (this.Index !== oChange.Index)
return true;
else
return false;
}
else if (AscDFH.historyitem_Section_Columns_SetCols === oChange.Type)
{
return false
}
return true;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseProperty} * @extends {AscDFH.CChangesBaseProperty}
...@@ -705,6 +761,24 @@ CChangesSectionColumnsSetCols.prototype.ReadFromBinary = function(Reader) ...@@ -705,6 +761,24 @@ CChangesSectionColumnsSetCols.prototype.ReadFromBinary = function(Reader)
this.Old[nIndex].Read_FromBinary(Reader); this.Old[nIndex].Read_FromBinary(Reader);
} }
}; };
CChangesSectionColumnsSetCols.prototype.Merge = function(oChange)
{
if (this.Class !== oChange.Class)
return true;
if (this.Type === oChange.Type)
return false;
if (AscDFH.historyitem_Section_Columns_Col === oChange.Type)
{
if (!this.New)
this.New = [];
this.New[oChange.Index] = oChange.New;
}
return true;
};
/** /**
* @constructor * @constructor
* @extends {AscDFH.CChangesBaseLongProperty} * @extends {AscDFH.CChangesBaseLongProperty}
......
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