Commit a600cb36 authored by Ilya Kirillov's avatar Ilya Kirillov

Changes for classes ParaField and FootnotesController were replaces with a new classes.

parent 1c64568d
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
...@@ -128,6 +129,7 @@ ...@@ -128,6 +129,7 @@
"../word/Editor/FontClassification.js", "../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js", "../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js", "../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js", "../word/Editor/FootEndNote.js",
"../word/Drawing/Graphics.js", "../word/Drawing/Graphics.js",
"../common/Overlay.js", "../common/Overlay.js",
......
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
...@@ -175,6 +176,7 @@ ...@@ -175,6 +176,7 @@
"../word/Editor/FontClassification.js", "../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js", "../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js", "../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js", "../word/Editor/FootEndNote.js",
"../word/Editor/GraphicObjects/WrapManager.js", "../word/Editor/GraphicObjects/WrapManager.js",
"../word/Editor/Common.js", "../word/Editor/Common.js",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Math/mathTypes.js", "../word/Math/mathTypes.js",
...@@ -171,6 +172,7 @@ ...@@ -171,6 +172,7 @@
"../word/Editor/MathChanges.js", "../word/Editor/MathChanges.js",
"../word/Editor/Spelling.js", "../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js", "../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js", "../word/Editor/FootEndNote.js",
"../word/Editor/Search.js", "../word/Editor/Search.js",
"../word/Editor/FontClassification.js", "../word/Editor/FontClassification.js",
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js", "../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
...@@ -150,6 +151,7 @@ ...@@ -150,6 +151,7 @@
"../word/Editor/FontClassification.js", "../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js", "../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js", "../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js", "../word/Editor/FootEndNote.js",
"../word/Drawing/Graphics.js", "../word/Drawing/Graphics.js",
......
...@@ -105,16 +105,16 @@ ParaField.prototype.Get_Bounds = function() ...@@ -105,16 +105,16 @@ ParaField.prototype.Get_Bounds = function()
}; };
ParaField.prototype.Add_ToContent = function(Pos, Item, UpdatePosition) ParaField.prototype.Add_ToContent = function(Pos, Item, UpdatePosition)
{ {
History.Add( this, { Type : AscDFH.historyitem_Field_AddItem, Pos : Pos, EndPos : Pos, Items : [ Item ] } ); History.Add(new CChangesParaFieldAddItem(this, Pos, [Item]));
ParaField.superclass.Add_ToContent.apply(this, arguments); ParaField.superclass.Add_ToContent.apply(this, arguments);
}; };
ParaField.prototype.Remove_FromContent = function(Pos, Count, UpdatePosition) ParaField.prototype.Remove_FromContent = function(Pos, Count, UpdatePosition)
{ {
// Получим массив удаляемых элементов // Получим массив удаляемых элементов
var DeletedItems = this.Content.slice( Pos, Pos + Count ); var DeletedItems = this.Content.slice(Pos, Pos + Count);
History.Add( this, { Type : AscDFH.historyitem_Field_RemoveItem, Pos : Pos, EndPos : Pos + Count - 1, Items : DeletedItems } ); History.Add(new CChangesParaFieldRemoveItem(this, Pos, DeletedItems));
ParaField.superclass.Remove_FromContent.apply(this, arguments); ParaField.superclass.Remove_FromContent.apply(this, arguments);
}; };
ParaField.prototype.Add = function(Item) ParaField.prototype.Add = function(Item)
{ {
...@@ -376,206 +376,8 @@ ParaField.prototype.private_GetMappedRun = function(Value) ...@@ -376,206 +376,8 @@ ParaField.prototype.private_GetMappedRun = function(Value)
return oRun; return oRun;
}; };
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// Undo/Redo функции
//----------------------------------------------------------------------------------------------------------------------
ParaField.prototype.Undo = function(Data)
{
var Type = Data.Type;
switch(Type)
{
case AscDFH.historyitem_Field_AddItem :
{
this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 );
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisions();
break;
}
case AscDFH.historyitem_Field_RemoveItem :
{
var Pos = Data.Pos;
var Array_start = this.Content.slice( 0, Pos );
var Array_end = this.Content.slice( Pos );
this.Content = Array_start.concat( Data.Items, Array_end );
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisions();
break;
}
}
};
ParaField.prototype.Redo = function(Data)
{
var Type = Data.Type;
switch(Type)
{
case AscDFH.historyitem_Field_AddItem :
{
var Pos = Data.Pos;
var Array_start = this.Content.slice( 0, Pos );
var Array_end = this.Content.slice( Pos );
this.Content = Array_start.concat( Data.Items, Array_end );
this.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
case AscDFH.historyitem_Field_RemoveItem :
{
this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 );
this.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
}
};
//----------------------------------------------------------------------------------------------------------------------
// Функции совместного редактирования // Функции совместного редактирования
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
ParaField.prototype.Save_Changes = function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer.WriteLong(AscDFH.historyitem_type_Field);
var Type = Data.Type;
// Пишем тип
Writer.WriteLong( Type );
switch(Type)
{
case AscDFH.historyitem_Field_AddItem :
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id элемента
// }
var bArray = Data.UseArray;
var Count = Data.Items.length;
Writer.WriteLong( Count );
for ( var Index = 0; Index < Count; Index++ )
{
if ( true === bArray )
Writer.WriteLong( Data.PosArray[Index] );
else
Writer.WriteLong( Data.Pos + Index );
Writer.WriteString2( Data.Items[Index].Get_Id() );
}
break;
}
case AscDFH.historyitem_Field_RemoveItem :
{
// Long : Количество удаляемых элементов
// Array of Long : позиции удаляемых элементов
var bArray = Data.UseArray;
var Count = Data.Items.length;
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
var RealCount = Count;
for ( var Index = 0; Index < Count; Index++ )
{
if ( true === bArray )
{
if ( false === Data.PosArray[Index] )
RealCount--;
else
Writer.WriteLong( Data.PosArray[Index] );
}
else
Writer.WriteLong( Data.Pos );
}
var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos );
Writer.WriteLong( RealCount );
Writer.Seek( EndPos );
break;
}
}
};
ParaField.prototype.Load_Changes = function(Reader)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_Field != ClassType )
return;
var Type = Reader.GetLong();
switch ( Type )
{
case AscDFH.historyitem_Field_AddItem :
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id Элемента
// }
var Count = Reader.GetLong();
for ( var Index = 0; Index < Count; Index++ )
{
var Pos = this.m_oContentChanges.Check( AscCommon.contentchanges_Add, Reader.GetLong() );
var Element = AscCommon.g_oTableId.Get_ById( Reader.GetString2() );
if ( null != Element )
{
this.Content.splice( Pos, 0, Element );
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(this, Pos);
}
}
this.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
case AscDFH.historyitem_Field_RemoveItem:
{
// Long : Количество удаляемых элементов
// Array of Long : позиции удаляемых элементов
var Count = Reader.GetLong();
for ( var Index = 0; Index < Count; Index++ )
{
var ChangesPos = this.m_oContentChanges.Check( AscCommon.contentchanges_Remove, Reader.GetLong() );
// действие совпало, не делаем его
if ( false === ChangesPos )
continue;
this.Content.splice( ChangesPos, 1 );
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(this, ChangesPos, 1);
}
this.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
}
};
ParaField.prototype.Write_ToBinary2 = function(Writer) ParaField.prototype.Write_ToBinary2 = function(Writer)
{ {
Writer.WriteLong(AscDFH.historyitem_type_Field); Writer.WriteLong(AscDFH.historyitem_type_Field);
......
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
"use strict";
/**
* User: Ilja.Kirillov
* Date: 10.11.2016
* Time: 18:59
*/
AscDFH.changesFactory[AscDFH.historyitem_Field_AddItem] = CChangesParaFieldAddItem;
AscDFH.changesFactory[AscDFH.historyitem_Field_RemoveItem] = CChangesParaFieldRemoveItem;
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesParaFieldAddItem(Class, Pos, Items)
{
CChangesParaFieldAddItem.superclass.constructor.call(this, Class);
this.Pos = Pos;
this.Items = Items;
this.UseArray = false;
this.PosArray = [];
}
AscCommon.extendClass(CChangesParaFieldAddItem, AscDFH.CChangesBase);
CChangesParaFieldAddItem.prototype.Type = AscDFH.historyitem_Field_AddItem;
CChangesParaFieldAddItem.prototype.Undo = function()
{
var oField = this.Class;
oField.Content.splice(this.Pos, this.Items.length);
oField.protected_UpdateSpellChecking();
oField.private_UpdateTrackRevisions();
};
CChangesParaFieldAddItem.prototype.Redo = function()
{
var oField = this.Class;
var Array_start = oField.Content.slice(0, this.Pos);
var Array_end = oField.Content.slice(this.Pos);
oField.Content = Array_start.concat(this.Items, Array_end);
oField.private_UpdateTrackRevisions();
oField.protected_UpdateSpellChecking();
};
CChangesParaFieldAddItem.prototype.WriteToBinary = function(Writer)
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id элемента
// }
var bArray = this.UseArray;
var nCount = this.Items.length;
Writer.WriteLong(nCount);
for (var nIndex = 0; nIndex < nCount; ++nIndex)
{
if (true === bArray)
Writer.WriteLong(this.PosArray[nIndex]);
else
Writer.WriteLong(this.Pos + nIndex);
Writer.WriteString2(this.Items[nIndex].Get_Id());
}
};
CChangesParaFieldAddItem.prototype.ReadFromBinary = function(Reader)
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id Элемента
// }
this.UseArray = true;
this.Items = [];
this.PosArray = [];
var nCount = Reader.GetLong();
for (var nIndex = 0; nIndex < nCount; ++nIndex)
{
this.PosArray[nIndex] = Reader.GetLong();
this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
}
};
CChangesParaFieldAddItem.prototype.Load = function(Color)
{
var oField = this.Class;
for (var nIndex = 0, nCount = this.Items.length; nIndex < nCount; ++nIndex)
{
var Pos = oField.m_oContentChanges.Check(AscCommon.contentchanges_Add, this.PosArray[nIndex]);
var Element = this.Items[nIndex];
if (null != Element)
{
oField.Content.splice(Pos, 0, Element);
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(oField, Pos);
}
}
oField.private_UpdateTrackRevisions();
oField.protected_UpdateSpellChecking();
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesParaFieldRemoveItem(Class, Pos, Items)
{
CChangesParaFieldRemoveItem.superclass.constructor.call(this, Class);
this.Pos = Pos;
this.Items = Items;
this.UseArray = false;
this.PosArray = [];
}
AscCommon.extendClass(CChangesParaFieldRemoveItem, AscDFH.CChangesBase);
CChangesParaFieldRemoveItem.prototype.Type = AscDFH.historyitem_Field_RemoveItem;
CChangesParaFieldRemoveItem.prototype.Undo = function()
{
var oField = this.Class;
var Array_start = oField.Content.slice(0, this.Pos);
var Array_end = oField.Content.slice(this.Pos);
oField.Content = Array_start.concat(this.Items, Array_end);
oField.protected_UpdateSpellChecking();
oField.private_UpdateTrackRevisions();
};
CChangesParaFieldRemoveItem.prototype.Redo = function()
{
var oField = this.Class;
oField.Content.splice(this.Pos, this.Items.length);
oField.private_UpdateTrackRevisions();
oField.protected_UpdateSpellChecking();
};
CChangesParaFieldRemoveItem.prototype.WriteToBinary = function(Writer)
{
// Long : Количество удаляемых элементов
// Array of
// {
// Long : позиции удаляемых элементов
// String : id удаляемых элементов
// }
var bArray = this.UseArray;
var nCount = this.Items.length;
var nStartPos = Writer.GetCurPosition();
Writer.Skip(4);
var nRealCount = nCount;
for (var nIndex = 0; nIndex < nCount; ++nIndex)
{
if (true === bArray)
{
if (false === this.PosArray[nIndex])
{
nRealCount--;
}
else
{
Writer.WriteLong(this.PosArray[nIndex]);
Writer.WriteString2(this.Items[nIndex]);
}
}
else
{
Writer.WriteLong(this.Pos);
Writer.WriteString2(this.Items[nIndex]);
}
}
var nEndPos = Writer.GetCurPosition();
Writer.Seek(nStartPos);
Writer.WriteLong(nRealCount);
Writer.Seek(nEndPos);
};
CChangesParaFieldRemoveItem.prototype.ReadFromBinary = function(Reader)
{
// Long : Количество удаляемых элементов
// Array of
// {
// Long : позиции удаляемых элементов
// String : id удаляемых элементов
// }
this.UseArray = true;
this.Items = [];
this.PosArray = [];
var nCount = Reader.GetLong();
for (var nIndex = 0; nIndex < nCount; ++nIndex)
{
this.PosArray[nIndex] = Reader.GetLong();
this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
}
};
CChangesParaFieldRemoveItem.prototype.Load = function(Color)
{
var oField = this.Class;
for (var nIndex = 0, nCount = this.Items.length; nIndex < nCount; ++nIndex)
{
var ChangesPos = oField.m_oContentChanges.Check(AscCommon.contentchanges_Remove, this.PosArray[nIndex]);
if (false === ChangesPos)
continue;
oField.Content.splice(ChangesPos, 1);
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oField, ChangesPos, 1);
}
oField.private_UpdateTrackRevisions();
oField.protected_UpdateSpellChecking();
};
\ No newline at end of file
This diff is collapsed.
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
"use strict";
/**
* User: Ilja.Kirillov
* Date: 10.11.2016
* Time: 19:35
*/
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_AddFootnote] = CChangesFootnotesAddFootnote;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetSeparator] = CChangesFootnotesSetSeparator;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetContinuationSeparator] = CChangesFootnotesSetContinuationSeparator;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetContinuationNotice] = CChangesFootnotesSetContinuationNotice;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrPos] = CChangesFootnotesSetFootnotePrPos;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumStart] = CChangesFootnotesSetFootnotePrNumStart;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumRestart] = CChangesFootnotesSetFootnotePrNumRestart;
AscDFH.changesFactory[AscDFH.historyitem_Footnotes_SetFootnotePrNumFormat] = CChangesFootnotesSetFootnotePrNumFormat;
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesFootnotesAddFootnote(Class, Id)
{
CChangesFootnotesAddFootnote.superclass.constructor.call(this, Class);
this.Id = Id;
}
AscCommon.extendClass(CChangesParaFieldAddItem, AscDFH.CChangesBase);
CChangesParaFieldAddItem.prototype.Type = AscDFH.historyitem_Footnotes_AddFootnote;
CChangesParaFieldAddItem.prototype.Undo = function()
{
delete this.Class.Footnote[this.Id];
};
CChangesParaFieldAddItem.prototype.Redo = function()
{
this.Class.Footnote[this.Id] = AscCommon.g_oTableId.Get_ById(this.Id);
};
CChangesParaFieldAddItem.prototype.WriteToBinary = function(Writer)
{
// String : Id
Writer.WriteString2(this.Id);
};
CChangesParaFieldAddItem.prototype.ReadFromBinary = function(Reader)
{
// String : Id
this.Id = Reader.GetString2();
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesFootnotesSetSeparator(Class, Old, New, Color)
{
CChangesFootnotesSetSeparator.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetSeparator, AscDFH.CChangesBaseProperty);
CChangesFootnotesSetSeparator.prototype.Type = AscDFH.historyitem_Footnotes_SetSeparator;
CChangesFootnotesSetSeparator.prototype.private_SetValue = function(Value)
{
this.Class.SeparatorFootnote = Value;
};
CChangesFootnotesSetSeparator.prototype.WriteToBinary = function(Writer)
{
// Long : Flags
// 1bit : is new undefined?
// 2bit : is old undefined?
// String : New id (1 bit zero)
// String : Old id (2 bit zero)
var nFlags = 0;
if (!this.New)
nFlags |= 1;
if (!this.Old)
nFlags |= 2;
Writer.WriteLong(nFlags);
if (this.New)
Writer.WriteString2(this.New.Get_Id());
if (this.Old)
Writer.WriteString2(this.Old.Get_Id());
};
CChangesFootnotesSetSeparator.prototype.ReadFromBinary = function(Reader)
{
// Long : Flags
// 1bit : is new undefined?
// 2bit : is old undefined?
// String : New id (1 bit zero)
// String : Old id (2 bit zero)
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.New = null;
else
this.New = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
if (nFlags & 2)
this.New = null;
else
this.New = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesFootnotesSetContinuationSeparator(Class, Old, New, Color)
{
CChangesFootnotesSetContinuationSeparator.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetContinuationSeparator, AscDFH.CChangesBaseProperty);
CChangesFootnotesSetContinuationSeparator.prototype.Type = AscDFH.historyitem_Footnotes_SetContinuationSeparator;
CChangesFootnotesSetContinuationSeparator.prototype.private_SetValue = function(Value)
{
this.Class.ContinuationSeparatorFootnote = Value;
};
CChangesFootnotesSetContinuationSeparator.prototype.WriteToBinary = CChangesFootnotesSetSeparator.prototype.WriteToBinary;
CChangesFootnotesSetContinuationSeparator.prototype.ReadFromBinary = CChangesFootnotesSetSeparator.prototype.ReadFromBinary;
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesFootnotesSetContinuationNotice(Class, Old, New, Color)
{
CChangesFootnotesSetContinuationNotice.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetContinuationNotice, AscDFH.CChangesBaseProperty);
CChangesFootnotesSetContinuationNotice.prototype.Type = AscDFH.historyitem_Footnotes_SetContinuationNotice;
CChangesFootnotesSetContinuationNotice.prototype.private_SetValue = function(Value)
{
this.Class.ContinuationNoticeFootnote = Value;
};
CChangesFootnotesSetContinuationNotice.prototype.WriteToBinary = CChangesFootnotesSetSeparator.prototype.WriteToBinary;
CChangesFootnotesSetContinuationNotice.prototype.ReadFromBinary = CChangesFootnotesSetSeparator.prototype.ReadFromBinary;
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesFootnotesSetFootnotePrPos(Class, Old, New, Color)
{
CChangesFootnotesSetFootnotePrPos.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetFootnotePrPos, AscDFH.CChangesBaseLongProperty);
CChangesFootnotesSetFootnotePrPos.prototype.Type = AscDFH.historyitem_Footnotes_SetFootnotePrPos;
CChangesFootnotesSetFootnotePrPos.prototype.private_SetValue = function(Value)
{
this.Class.FootnotePr.Pos = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesFootnotesSetFootnotePrNumStart(Class, Old, New, Color)
{
CChangesFootnotesSetFootnotePrNumStart.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetFootnotePrNumStart, AscDFH.CChangesBaseLongProperty);
CChangesFootnotesSetFootnotePrNumStart.prototype.Type = AscDFH.historyitem_Footnotes_SetFootnotePrNumStart;
CChangesFootnotesSetFootnotePrNumStart.prototype.private_SetValue = function(Value)
{
this.Class.FootnotePr.NumStart = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesFootnotesSetFootnotePrNumRestart(Class, Old, New, Color)
{
CChangesFootnotesSetFootnotePrNumRestart.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetFootnotePrNumRestart, AscDFH.CChangesBaseLongProperty);
CChangesFootnotesSetFootnotePrNumRestart.prototype.Type = AscDFH.historyitem_Footnotes_SetFootnotePrNumRestart;
CChangesFootnotesSetFootnotePrNumRestart.prototype.private_SetValue = function(Value)
{
this.Class.FootnotePr.NumRestart = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesFootnotesSetFootnotePrNumFormat(Class, Old, New, Color)
{
CChangesFootnotesSetFootnotePrNumFormat.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesFootnotesSetFootnotePrNumFormat, AscDFH.CChangesBaseLongProperty);
CChangesFootnotesSetFootnotePrNumFormat.prototype.Type = AscDFH.historyitem_Footnotes_SetFootnotePrNumFormat;
CChangesFootnotesSetFootnotePrNumFormat.prototype.private_SetValue = function(Value)
{
this.Class.FootnotePr.NumFormat = Value;
};
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