Commit 9d56cf52 authored by Ilya Kirillov's avatar Ilya Kirillov

Changes for classes Hyperlink/Style/Styles were replaced with a new classes.

parent dfa158b5
...@@ -81,7 +81,8 @@ ...@@ -81,7 +81,8 @@
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/History.js", "../word/Editor/History.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
...@@ -139,6 +140,7 @@ ...@@ -139,6 +140,7 @@
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
......
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
"../slide/Editor/Format/Layout.js", "../slide/Editor/Format/Layout.js",
"../slide/Editor/Format/Comments.js", "../slide/Editor/Format/Comments.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
"../word/Editor/NumberingChanges.js", "../word/Editor/NumberingChanges.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
...@@ -134,6 +135,7 @@ ...@@ -134,6 +135,7 @@
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
...@@ -112,6 +113,7 @@ ...@@ -112,6 +113,7 @@
"../word/Editor/Paragraph/ParaDrawing.js", "../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js", "../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
......
...@@ -3391,4 +3391,31 @@ ...@@ -3391,4 +3391,31 @@
return true; return true;
}; };
window['AscDFH'].CChangesBaseObjectValue = CChangesBaseObjectValue; window['AscDFH'].CChangesBaseObjectValue = CChangesBaseObjectValue;
/**
* Базовый класс для изменения числовых(long) значений.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesBaseStringValue(Class, Old, New, Color)
{
CChangesBaseStringValue.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesBaseStringValue, CChangesBaseProperty);
CChangesBaseStringValue.prototype.WriteToBinary = function(Writer)
{
// String : New
// String : Old
Writer.WriteString2(this.New);
Writer.WriteString2(this.Old);
};
CChangesBaseStringValue.prototype.ReadFromBinary = function(Reader)
{
// String : New
// String : Old
this.New = Reader.WriteString2();
this.Old = Reader.WriteString2();
};
window['AscDFH'].CChangesBaseStringValue = CChangesBaseStringValue;
})(window); })(window);
...@@ -91,7 +91,7 @@ ParaHyperlink.prototype.Add_ToContent = function(Pos, Item, UpdatePosition) ...@@ -91,7 +91,7 @@ ParaHyperlink.prototype.Add_ToContent = function(Pos, Item, UpdatePosition)
return; return;
} }
History.Add( this, { Type : AscDFH.historyitem_Hyperlink_AddItem, Pos : Pos, EndPos : Pos, Items : [ Item ] } ); History.Add(new CChangesHyperlinkAddItem(this, Pos, [Item]));
ParaHyperlink.superclass.Add_ToContent.apply(this, arguments); ParaHyperlink.superclass.Add_ToContent.apply(this, arguments);
}; };
...@@ -100,7 +100,7 @@ ParaHyperlink.prototype.Remove_FromContent = function(Pos, Count, UpdatePosition ...@@ -100,7 +100,7 @@ ParaHyperlink.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_Hyperlink_RemoveItem, Pos : Pos, EndPos : Pos + Count - 1, Items : DeletedItems } ); History.Add(new CChangesHyperlinkRemoveItem(this, Pos, DeletedItems));
ParaHyperlink.superclass.Remove_FromContent.apply(this, arguments); ParaHyperlink.superclass.Remove_FromContent.apply(this, arguments);
}; };
...@@ -296,7 +296,7 @@ ParaHyperlink.prototype.Get_Visited = function() ...@@ -296,7 +296,7 @@ ParaHyperlink.prototype.Get_Visited = function()
ParaHyperlink.prototype.Set_ToolTip = function(ToolTip) ParaHyperlink.prototype.Set_ToolTip = function(ToolTip)
{ {
History.Add( this, { Type : AscDFH.historyitem_Hyperlink_ToolTip, New : ToolTip, Old : this.ToolTip } ); History.Add(new CChangesHyperlinkToolTip(this, this.ToolTip, ToolTip));
this.ToolTip = ToolTip; this.ToolTip = ToolTip;
}; };
...@@ -320,268 +320,12 @@ ParaHyperlink.prototype.Get_Value = function() ...@@ -320,268 +320,12 @@ ParaHyperlink.prototype.Get_Value = function()
ParaHyperlink.prototype.Set_Value = function(Value) ParaHyperlink.prototype.Set_Value = function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Hyperlink_Value, New : Value, Old : this.Value } ); History.Add(new CChangesHyperlinkValue(this, this.Value, Value));
this.Value = Value; this.Value = Value;
}; };
//-----------------------------------------------------------------------------------
// Undo/Redo функции
//-----------------------------------------------------------------------------------
ParaHyperlink.prototype.Undo = function(Data)
{
var Type = Data.Type;
switch(Type)
{
case AscDFH.historyitem_Hyperlink_AddItem :
{
this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 );
this.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
case AscDFH.historyitem_Hyperlink_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.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
case AscDFH.historyitem_Hyperlink_Value :
{
this.Value = Data.Old;
break;
}
case AscDFH.historyitem_Hyperlink_ToolTip :
{
this.ToolTip = Data.Old;
break;
}
}
};
ParaHyperlink.prototype.Redo = function(Data)
{
var Type = Data.Type;
switch(Type)
{
case AscDFH.historyitem_Hyperlink_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_Hyperlink_RemoveItem :
{
this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 );
this.private_UpdateTrackRevisions();
this.protected_UpdateSpellChecking();
break;
}
case AscDFH.historyitem_Hyperlink_Value :
{
this.Value = Data.New;
break;
}
case AscDFH.historyitem_Hyperlink_ToolTip :
{
this.ToolTip = Data.New;
break;
}
}
};
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// Функции совместного редактирования // Функции совместного редактирования
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
ParaHyperlink.prototype.Save_Changes = function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer.WriteLong( AscDFH.historyitem_type_Hyperlink );
var Type = Data.Type;
// Пишем тип
Writer.WriteLong( Type );
switch(Type)
{
case AscDFH.historyitem_Hyperlink_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_Hyperlink_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;
}
case AscDFH.historyitem_Hyperlink_Value :
{
// String : Value
Writer.WriteString2( Data.New );
break;
}
case AscDFH.historyitem_Hyperlink_ToolTip :
{
// String : ToolTip
Writer.WriteString2( Data.New );
break;
}
}
};
ParaHyperlink.prototype.Load_Changes = function(Reader)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_Hyperlink != ClassType )
return;
var Type = Reader.GetLong();
switch ( Type )
{
case AscDFH.historyitem_Hyperlink_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_Hyperlink_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;
}
case AscDFH.historyitem_Hyperlink_Value:
{
// String : Value
this.Value = Reader.GetString2();
break;
}
case AscDFH.historyitem_Hyperlink_ToolTip :
{
// String : ToolTip
this.ToolTip = Reader.GetString2();
break;
}
}
};
ParaHyperlink.prototype.Write_ToBinary2 = function(Writer) ParaHyperlink.prototype.Write_ToBinary2 = function(Writer)
{ {
Writer.WriteLong( AscDFH.historyitem_type_Hyperlink ); Writer.WriteLong( AscDFH.historyitem_type_Hyperlink );
......
/*
* (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: 08.11.2016
* Time: 18:59
*/
AscDFH.changesFactory[AscDFH.historyitem_Hyperlink_Value] = CChangesHyperlinkValue;
AscDFH.changesFactory[AscDFH.historyitem_Hyperlink_ToolTip] = CChangesHyperlinkToolTip;
AscDFH.changesFactory[AscDFH.historyitem_Hyperlink_AddItem] = CChangesHyperlinkAddItem;
AscDFH.changesFactory[AscDFH.historyitem_Hyperlink_RemoveItem] = CChangesHyperlinkRemoveItem;
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringValue}
*/
function CChangesHyperlinkValue(Class, Old, New, Color)
{
CChangesHyperlinkValue.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesHyperlinkValue, AscDFH.CChangesBaseStringValue);
CChangesHyperlinkValue.prototype.Type = AscDFH.historyitem_Hyperlink_Value;
CChangesHyperlinkValue.prototype.private_SetValue = function(Value)
{
this.Class.Value = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringValue}
*/
function CChangesHyperlinkToolTip(Class, Old, New, Color)
{
CChangesHyperlinkToolTip.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesHyperlinkToolTip, AscDFH.CChangesBaseStringValue);
CChangesHyperlinkToolTip.prototype.Type = AscDFH.historyitem_Hyperlink_ToolTip;
CChangesHyperlinkToolTip.prototype.private_SetValue = function(Value)
{
this.Class.ToolTip = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesHyperlinkAddItem(Class, Pos, Items)
{
CChangesHyperlinkAddItem.superclass.constructor.call(this, Class);
this.Pos = Pos;
this.Items = Items;
this.UseArray = false;
this.PosArray = [];
}
AscCommon.extendClass(CChangesHyperlinkAddItem, AscDFH.CChangesBase);
CChangesHyperlinkAddItem.prototype.Type = AscDFH.historyitem_Hyperlink_AddItem;
CChangesHyperlinkAddItem.prototype.Undo = function()
{
var oHyperlink = this.Class;
oHyperlink.Content.splice(this.Pos, this.Items.length);
oHyperlink.private_UpdateTrackRevisions();
oHyperlink.protected_UpdateSpellChecking();
};
CChangesHyperlinkAddItem.prototype.Redo = function()
{
var oHyperlink = this.Class;
var Array_start = oHyperlink.Content.slice(0, this.Pos);
var Array_end = oHyperlink.Content.slice(this.Pos);
oHyperlink.Content = Array_start.concat(this.Items, Array_end);
oHyperlink.private_UpdateTrackRevisions();
oHyperlink.protected_UpdateSpellChecking();
};
CChangesHyperlinkAddItem.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());
}
};
CChangesHyperlinkAddItem.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());
}
};
CChangesHyperlinkAddItem.prototype.Load = function(Color)
{
var oHyperlink = this.Class;
for (var nIndex = 0, nCount = this.Items.length; nIndex < nCount; ++nIndex)
{
var Pos = oHyperlink.m_oContentChanges.Check(AscCommon.contentchanges_Add, this.PosArray[nIndex]);
var Element = this.Items[nIndex];
if (null != Element)
{
oHyperlink.Content.splice(Pos, 0, Element);
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(oHyperlink, Pos);
}
}
oHyperlink.private_UpdateTrackRevisions();
oHyperlink.protected_UpdateSpellChecking();
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesHyperlinkRemoveItem(Class, Pos, Items)
{
CChangesHyperlinkRemoveItem.superclass.constructor.call(this, Class);
this.Pos = Pos;
this.Items = Items;
this.UseArray = false;
this.PosArray = [];
}
AscCommon.extendClass(CChangesHyperlinkRemoveItem, AscDFH.CChangesBase);
CChangesHyperlinkRemoveItem.prototype.Type = AscDFH.historyitem_Hyperlink_RemoveItem;
CChangesHyperlinkRemoveItem.prototype.Undo = function()
{
var oHyperlink = this.Class;
var Array_start = oHyperlink.Content.slice(0, this.Pos);
var Array_end = oHyperlink.Content.slice(this.Pos);
oHyperlink.Content = Array_start.concat(this.Items, Array_end);
oHyperlink.private_UpdateTrackRevisions();
oHyperlink.protected_UpdateSpellChecking();
};
CChangesHyperlinkRemoveItem.prototype.Redo = function()
{
var oHyperlink = this.Class;
oHyperlink.Content.splice(this.Pos, this.Items.length);
oHyperlink.private_UpdateTrackRevisions();
oHyperlink.protected_UpdateSpellChecking();
};
CChangesHyperlinkRemoveItem.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);
};
CChangesHyperlinkRemoveItem.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());
}
};
CChangesHyperlinkRemoveItem.prototype.Load = function(Color)
{
var oHyperlink = this.Class;
for (var nIndex = 0, nCount = this.Items.length; nIndex < nCount; ++nIndex)
{
var ChangesPos = oHyperlink.m_oContentChanges.Check(AscCommon.contentchanges_Remove, this.PosArray[nIndex]);
if (false === ChangesPos)
continue;
oHyperlink.Content.splice(ChangesPos, 1);
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oHyperlink, ChangesPos, 1);
}
oHyperlink.private_UpdateTrackRevisions();
oHyperlink.protected_UpdateSpellChecking();
};
\ No newline at end of file
...@@ -161,7 +161,7 @@ CChangesParagraphAddItem.prototype.ReadFromBinary = function(Reader) ...@@ -161,7 +161,7 @@ CChangesParagraphAddItem.prototype.ReadFromBinary = function(Reader)
for (var nIndex = 0; nIndex < nCount; ++nIndex) for (var nIndex = 0; nIndex < nCount; ++nIndex)
{ {
this.PosArray[nIndex] = Reader.GetLong(); this.PosArray[nIndex] = Reader.GetLong();
this.Items[nIndex] = g_oTableId.Get_ById(Reader.GetString2()); this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
} }
}; };
CChangesParagraphAddItem.prototype.Load = function(Color) CChangesParagraphAddItem.prototype.Load = function(Color)
...@@ -176,7 +176,7 @@ CChangesParagraphAddItem.prototype.Load = function(Color) ...@@ -176,7 +176,7 @@ CChangesParagraphAddItem.prototype.Load = function(Color)
{ {
if (para_Comment === Element.Type) if (para_Comment === Element.Type)
{ {
var Comment = g_oTableId.Get_ById(Element.CommentId); var Comment = AscCommon.g_oTableId.Get_ById(Element.CommentId);
// При копировании не всегда сразу заполняется правильно CommentId // При копировании не всегда сразу заполняется правильно CommentId
if (null != Comment && Comment instanceof CComment) if (null != Comment && Comment instanceof CComment)
...@@ -296,7 +296,7 @@ CChangesParagraphRemoveItem.prototype.ReadFromBinary = function(Reader) ...@@ -296,7 +296,7 @@ CChangesParagraphRemoveItem.prototype.ReadFromBinary = function(Reader)
for (var nIndex = 0; nIndex < nCount; ++nIndex) for (var nIndex = 0; nIndex < nCount; ++nIndex)
{ {
this.PosArray[nIndex] = Reader.GetLong(); this.PosArray[nIndex] = Reader.GetLong();
this.Items[nIndex] = g_oTableId.Get_ById(Reader.GetString2()); this.Items[nIndex] = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
} }
}; };
CChangesParagraphRemoveItem.prototype.Load = function(Color) CChangesParagraphRemoveItem.prototype.Load = function(Color)
...@@ -1101,12 +1101,12 @@ CChangesParagraphSectPr.prototype.ReadFromBinary = function(Reader) ...@@ -1101,12 +1101,12 @@ CChangesParagraphSectPr.prototype.ReadFromBinary = function(Reader)
var nFlags = Reader.GetLong(); var nFlags = Reader.GetLong();
if (nFlags & 1) if (nFlags & 1)
this.New = g_oTableId.Get_ById(Reader.GetString2()); this.New = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
else else
this.New = undefined; this.New = undefined;
if (nFlags & 2) if (nFlags & 2)
this.Old = g_oTableId.Get_ById(Reader.GetString2()); this.Old = AscCommon.g_oTableId.Get_ById(Reader.GetString2());
else else
this.Old = undefined; this.Old = undefined;
}; };
......
...@@ -319,82 +319,82 @@ CStyle.prototype = ...@@ -319,82 +319,82 @@ CStyle.prototype =
return Style; return Style;
}, },
Set_TextPr : function(Value) Set_TextPr : function(Value)
{ {
var Old = this.TextPr; var Old = this.TextPr;
var New = new CTextPr(); var New = new CTextPr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TextPr = New; this.TextPr = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TextPr, Old : Old, New : New } ); History.Add(new CChangesStyleTextPr(this, Old, New));
}, },
Set_ParaPr : function(Value) Set_ParaPr : function(Value)
{ {
var Old = this.ParaPr; var Old = this.ParaPr;
var New = new CParaPr(); var New = new CParaPr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.ParaPr = New; this.ParaPr = New;
History.Add( this, { Type : AscDFH.historyitem_Style_ParaPr, Old : Old, New : New } ); History.Add(new CChangesStyleParaPr(this, Old, New));
}, },
Set_TablePr : function(Value) Set_TablePr : function(Value)
{ {
var Old = this.TablePr; var Old = this.TablePr;
var New = new CTablePr(); var New = new CTablePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TablePr = New; this.TablePr = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TablePr, Old : Old, New : New } ); History.Add(new CChangesStyleTablePr(this, Old, New));
}, },
Set_TableRowPr : function(Value) Set_TableRowPr : function(Value)
{ {
var Old = this.TableRowPr; var Old = this.TableRowPr;
var New = new CTableRowPr(); var New = new CTableRowPr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableRowPr = New; this.TableRowPr = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableRowPr, Old : Old, New : New } ); History.Add(new CChangesStyleTableRowPr(this, Old, New));
}, },
Set_TableCellPr : function(Value) Set_TableCellPr : function(Value)
{ {
var Old = this.TableCellPr; var Old = this.TableCellPr;
var New = new CTableCellPr(); var New = new CTableCellPr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableCellPr = New; this.TableCellPr = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableCellPr, Old : Old, New : New } ); History.Add(new CChangesStyleTableCellPr(this, Old, New));
}, },
Set_TableBand1Horz : function(Value) Set_TableBand1Horz : function(Value)
{ {
var Old = this.TableBand1Horz; var Old = this.TableBand1Horz;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableBand1Horz = New; this.TableBand1Horz = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableBand1Horz, Old : Old, New : New } ); History.Add(new CChangesStyleTableBand1Horz(this, Old, New));
}, },
Set_TableBand1Vert : function(Value) Set_TableBand1Vert : function(Value)
{ {
var Old = this.TableBand1Vert; var Old = this.TableBand1Vert;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableBand1Vert = New; this.TableBand1Vert = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableBand1Vert, Old : Old, New : New } ); History.Add(new CChangesStyleTableBand1Vert(this, Old, New));
}, },
Set_TableBand2Horz : function(Value) Set_TableBand2Horz : function(Value)
{ {
...@@ -404,218 +404,218 @@ CStyle.prototype = ...@@ -404,218 +404,218 @@ CStyle.prototype =
this.TableBand2Horz = New; this.TableBand2Horz = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableBand2Horz, Old : Old, New : New } ); History.Add(new CChangesStyleTableBand2Horz(this, Old, New));
}, },
Set_TableBand2Vert : function(Value) Set_TableBand2Vert : function(Value)
{ {
var Old = this.TableBand2Vert; var Old = this.TableBand2Vert;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableBand2Vert = New; this.TableBand2Vert = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableBand2Vert, Old : Old, New : New } ); History.Add(new CChangesStyleTableBand2Vert(this, Old, New));
}, },
Set_TableFirstCol : function(Value) Set_TableFirstCol : function(Value)
{ {
var Old = this.TableFirstCol; var Old = this.TableFirstCol;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableFirstCol = New; this.TableFirstCol = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableFirstCol, Old : Old, New : New } ); History.Add(new CChangesStyleTableFirstCol(this, Old, New));
}, },
Set_TableFirstRow : function(Value) Set_TableFirstRow : function(Value)
{ {
var Old = this.TableFirstRow; var Old = this.TableFirstRow;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableFirstRow = New; this.TableFirstRow = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableFirstRow, Old : Old, New : New } ); History.Add(new CChangesStyleTableFirstRow(this, Old, New));
}, },
Set_TableLastCol : function(Value) Set_TableLastCol : function(Value)
{ {
var Old = this.TableLastCol; var Old = this.TableLastCol;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableLastCol = New; this.TableLastCol = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableLastCol, Old : Old, New : New } ); History.Add(new CChangesStyleTableLastCol(this, Old, New));
}, },
Set_TableLastRow : function(Value) Set_TableLastRow : function(Value)
{ {
var Old = this.TableLastRow; var Old = this.TableLastRow;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableLastRow = New; this.TableLastRow = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableLastRow, Old : Old, New : New } ); History.Add(new CChangesStyleTableLastRow(this, Old, New));
}, },
Set_TableTLCell : function(Value) Set_TableTLCell : function(Value)
{ {
var Old = this.TableTLCell; var Old = this.TableTLCell;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableTLCell = New; this.TableTLCell = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableTLCell, Old : Old, New : New } ); History.Add(new CChangesStyleTableTLCell(this, Old, New));
}, },
Set_TableTRCell : function(Value) Set_TableTRCell : function(Value)
{ {
var Old = this.TableTRCell; var Old = this.TableTRCell;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableTRCell = New; this.TableTRCell = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableTRCell, Old : Old, New : New } ); History.Add(new CChangesStyleTableTRCell(this, Old, New));
}, },
Set_TableBLCell : function(Value) Set_TableBLCell : function(Value)
{ {
var Old = this.TableBLCell; var Old = this.TableBLCell;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableBLCell = New; this.TableBLCell = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableBLCell, Old : Old, New : New } ); History.Add(new CChangesStyleTableBLCell(this, Old, New));
}, },
Set_TableBRCell : function(Value) Set_TableBRCell : function(Value)
{ {
var Old = this.TableBRCell; var Old = this.TableBRCell;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableBRCell = New; this.TableBRCell = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableBRCell, Old : Old, New : New } ); History.Add(new CChangesStyleTableBRCell(this, Old, New));
}, },
Set_TableWholeTable : function(Value) Set_TableWholeTable : function(Value)
{ {
var Old = this.TableWholeTable; var Old = this.TableWholeTable;
var New = new CTableStylePr(); var New = new CTableStylePr();
New.Set_FromObject(Value); New.Set_FromObject(Value);
this.TableWholeTable = New; this.TableWholeTable = New;
History.Add( this, { Type : AscDFH.historyitem_Style_TableWholeTable, Old : Old, New : New } ); History.Add(new CChangesStyleTableWholeTable(this, Old, New));
}, },
Set_Name : function(Value) Set_Name : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_Name, Old : this.Name, New : Value } ); History.Add(new CChangesStyleName(this, this.Name, Value));
this.Name = Value; this.Name = Value;
}, },
Get_Name : function() Get_Name : function()
{ {
return this.Name; return this.Name;
}, },
Set_BasedOn : function(Value) Set_BasedOn : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_BasedOn, Old : this.BasedOn, New : Value } ); History.Add(new CChangesStyleBasedOn(this, this.BasedOn, Value));
this.BasedOn = Value; this.BasedOn = Value;
}, },
Get_BasedOn : function() Get_BasedOn : function()
{ {
return this.BasedOn; return this.BasedOn;
}, },
Set_Next : function(Value) Set_Next : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_Next, Old : this.Next, New : Value } ); History.Add(new CChangesStyleNext(this, this.Next, Value));
this.Next = Value; this.Next = Value;
}, },
Get_Next : function() Get_Next : function()
{ {
return this.Next; return this.Next;
}, },
Set_Link : function(Value) Set_Link : function(Value)
{ {
History.Add(this, { Type : AscDFH.historyitem_Style_Link, Old : this.Link, New : Value }); History.Add(new CChangesStyleLink(this, this.Link, Value));
this.Link = Value; this.Link = Value;
}, },
Set_Type : function(Value) Set_Type : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_Type, Old : this.Type, New : Value } ); History.Add(new CChangesStyleType(this, this.Type, Value));
this.Type = Value; this.Type = Value;
}, },
Get_Type : function() Get_Type : function()
{ {
return this.Type; return this.Type;
}, },
Set_QFormat : function(Value) Set_QFormat : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_QFormat, Old : this.qFormat, New : Value } ); History.Add(new CChangesStyleQFormat(this, this.qFormat, Value));
this.qFormat = Value; this.qFormat = Value;
}, },
Get_QFormat : function() Get_QFormat : function()
{ {
return this.qFormat; return this.qFormat;
}, },
Set_UiPriority : function(Value) Set_UiPriority : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_UiPriority, Old : this.uiPriority, New : Value } ); History.Add(new CChangesStyleUiPriority(this, this.uiPriority, Value));
this.uiPriority = Value; this.uiPriority = Value;
}, },
Get_UiPriority : function() Get_UiPriority : function()
{ {
return this.uiPriority; return this.uiPriority;
}, },
Set_Hidden : function(Value) Set_Hidden : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_Hidden, Old : this.hidden, New : Value } ); History.Add(new CChangesStyleHidden(this, this.hidden, Value));
this.hidden = Value; this.hidden = Value;
}, },
Get_Hidden : function() Get_Hidden : function()
{ {
return this.hidden; return this.hidden;
}, },
Set_SemiHidden : function(Value) Set_SemiHidden : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_SemiHidden, Old : this.semiHidden, New : Value } ); History.Add(new CChangesStyleSemiHidden(this, this.semiHidden, Value));
this.semiHidden = Value; this.semiHidden = Value;
}, },
Get_SemiHidden : function() Get_SemiHidden : function()
{ {
return this.semiHidden; return this.semiHidden;
}, },
Set_UnhideWhenUsed : function(Value) Set_UnhideWhenUsed : function(Value)
{ {
History.Add( this, { Type : AscDFH.historyitem_Style_UnhideWhenUsed, Old : this.unhideWhenUsed, New : Value } ); History.Add(new CChangesStyleUnhideWhenUsed(this, this.unhideWhenUsed, Value));
this.unhideWhenUsed = Value; this.unhideWhenUsed = Value;
}, },
Get_UnhideWhenUsed : function() Get_UnhideWhenUsed : function()
{ {
...@@ -2764,901 +2764,101 @@ CStyle.prototype = ...@@ -2764,901 +2764,101 @@ CStyle.prototype =
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Undo/Redo функции // Undo/Redo функции
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Undo : function(Data) Get_SelectionState : function()
{ {
var Type = Data.Type; },
switch ( Type )
{
case AscDFH.historyitem_Style_TextPr:
{
this.TextPr = Data.Old;
break;
}
case AscDFH.historyitem_Style_ParaPr:
{
this.ParaPr = Data.Old;
break;
}
case AscDFH.historyitem_Style_TablePr: Set_SelectionState : function(State, StateIndex)
{ {
this.TablePr = Data.Old; },
break;
}
case AscDFH.historyitem_Style_TableRowPr: Get_ParentObject_or_DocumentPos : function()
{ {
this.TableRowPr = Data.Old; return { Type : AscDFH.historyitem_recalctype_Inline, Data : 0 };
break; },
}
case AscDFH.historyitem_Style_TableCellPr: Refresh_RecalcData : function(Data)
{ {
this.TableCellPr = Data.Old; var Type = Data.Type;
break;
}
case AscDFH.historyitem_Style_TableBand1Horz: var bNeedRecalc = false;
{
this.TableBand1Horz = Data.Old;
break;
}
case AscDFH.historyitem_Style_TableBand1Vert: switch ( Type )
{
case AscDFH.historyitem_Style_TextPr :
case AscDFH.historyitem_Style_ParaPr :
case AscDFH.historyitem_Style_TablePr :
case AscDFH.historyitem_Style_TableRowPr :
case AscDFH.historyitem_Style_TableCellPr :
case AscDFH.historyitem_Style_TableBand1Horz :
case AscDFH.historyitem_Style_TableBand1Vert :
case AscDFH.historyitem_Style_TableBand2Horz :
case AscDFH.historyitem_Style_TableBand2Vert :
case AscDFH.historyitem_Style_TableFirstCol :
case AscDFH.historyitem_Style_TableFirstRow :
case AscDFH.historyitem_Style_TableLastCol :
case AscDFH.historyitem_Style_TableLastRow :
case AscDFH.historyitem_Style_TableTLCell :
case AscDFH.historyitem_Style_TableTRCell :
case AscDFH.historyitem_Style_TableBLCell :
case AscDFH.historyitem_Style_TableBRCell :
case AscDFH.historyitem_Style_TableWholeTable :
case AscDFH.historyitem_Style_Name :
case AscDFH.historyitem_Style_BasedOn :
case AscDFH.historyitem_Style_Next :
case AscDFH.historyitem_Style_Type :
case AscDFH.historyitem_Style_QFormat :
case AscDFH.historyitem_Style_UiPriority :
case AscDFH.historyitem_Style_Hidden :
case AscDFH.historyitem_Style_SemiHidden :
case AscDFH.historyitem_Style_UnhideWhenUsed :
case AscDFH.historyitem_Style_Link :
{ {
this.TableBand1Vert = Data.Old; bNeedRecalc = true;
break; break;
} }
}
case AscDFH.historyitem_Style_TableBand2Horz: if ( true === bNeedRecalc )
{ {
this.TableBand2Horz = Data.Old; // Сообщаем родительскому классу, что изменения произошли в элементе с номером this.Index и на странице this.PageNum
break; return this.Refresh_RecalcData2();
} }
},
case AscDFH.historyitem_Style_TableBand2Vert: Refresh_RecalcData2 : function()
{ {
this.TableBand2Vert = Data.Old; // TODO: Надо сделать механизм, чтобы данное действие не вызывалось много раз подряд, а только 1.
break; var LogicDocument = editor.WordControl.m_oLogicDocument;
} var Styles = LogicDocument.Get_Styles();
case AscDFH.historyitem_Style_TableFirstCol: var AllParagraphs = [];
{
this.TableFirstCol = Data.Old;
break;
}
case AscDFH.historyitem_Style_TableFirstRow: if (this.Id != Styles.Default.Paragraph)
{ {
this.TableFirstRow = Data.Old; var AllStylesId = Styles.private_GetAllBasedStylesId(this.Id);
break; AllParagraphs = LogicDocument.Get_AllParagraphsByStyle(AllStylesId);
} LogicDocument.Add_ChangedStyle(AllStylesId);
}
else
{
AllParagraphs = LogicDocument.Get_AllParagraphs({All : true});
LogicDocument.Add_ChangedStyle([this.Id]);
}
case AscDFH.historyitem_Style_TableLastCol: var Count = AllParagraphs.length;
{ for ( var Index = 0; Index < Count; Index++ )
this.TableLastCol = Data.Old; {
break; var Para = AllParagraphs[Index];
} Para.Refresh_RecalcData( { Type : AscDFH.historyitem_Paragraph_PStyle } );
}
case AscDFH.historyitem_Style_TableLastRow: },
{ //-----------------------------------------------------------------------------------
this.TableLastRow = Data.Old; // Функции для совместного редактирования
break; //-----------------------------------------------------------------------------------
} Write_ToBinary2 : function(Writer)
{
case AscDFH.historyitem_Style_TableTLCell: Writer.WriteLong(AscDFH.historyitem_type_Style);
{
this.TableTLCell = Data.Old;
break;
}
case AscDFH.historyitem_Style_TableTRCell:
{
this.TableTRCell = Data.Old;
break;
}
case AscDFH.historyitem_Style_TableBLCell:
{
this.TableBLCell = Data.Old;
break;
}
case AscDFH.historyitem_Style_TableBRCell:
{
this.TableBRCell = Data.Old;
break;
}
case AscDFH.historyitem_Style_TableWholeTable:
{
this.TableWholeTable = Data.Old;
break;
}
case AscDFH.historyitem_Style_Name:
{
this.Name = Data.Old;
break;
}
case AscDFH.historyitem_Style_BasedOn:
{
this.BasedOn = Data.Old;
break;
}
case AscDFH.historyitem_Style_Next:
{
this.Next = Data.Old;
break;
}
case AscDFH.historyitem_Style_Type:
{
this.Type = Data.Old;
break;
}
case AscDFH.historyitem_Style_QFormat:
{
this.qFormat = Data.Old;
break;
}
case AscDFH.historyitem_Style_UiPriority:
{
this.uiPriority = Data.Old;
break;
}
case AscDFH.historyitem_Style_Hidden:
{
this.hidden = Data.Old;
break;
}
case AscDFH.historyitem_Style_SemiHidden:
{
this.semiHidden = Data.Old;
break;
}
case AscDFH.historyitem_Style_UnhideWhenUsed:
{
this.unhideWhenUsed = Data.Old;
break;
}
case AscDFH.historyitem_Style_Link:
{
this.Link = Data.Old;
break;
}
}
},
Redo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case AscDFH.historyitem_Style_TextPr:
{
this.TextPr = Data.New;
break;
}
case AscDFH.historyitem_Style_ParaPr:
{
this.ParaPr = Data.New;
break;
}
case AscDFH.historyitem_Style_TablePr:
{
this.TablePr = Data.New;
break;
}
case AscDFH.historyitem_Style_TableRowPr:
{
this.TableRowPr = Data.New;
break;
}
case AscDFH.historyitem_Style_TableCellPr:
{
this.TableCellPr = Data.New;
break;
}
case AscDFH.historyitem_Style_TableBand1Horz:
{
this.TableBand1Horz = Data.New;
break;
}
case AscDFH.historyitem_Style_TableBand1Vert:
{
this.TableBand1Vert = Data.New;
break;
}
case AscDFH.historyitem_Style_TableBand2Horz:
{
this.TableBand2Horz = Data.New;
break;
}
case AscDFH.historyitem_Style_TableBand2Vert:
{
this.TableBand2Vert = Data.New;
break;
}
case AscDFH.historyitem_Style_TableFirstCol:
{
this.TableFirstCol = Data.New;
break;
}
case AscDFH.historyitem_Style_TableFirstRow:
{
this.TableFirstRow = Data.New;
break;
}
case AscDFH.historyitem_Style_TableLastCol:
{
this.TableLastCol = Data.New;
break;
}
case AscDFH.historyitem_Style_TableLastRow:
{
this.TableLastRow = Data.New;
break;
}
case AscDFH.historyitem_Style_TableTLCell:
{
this.TableTLCell = Data.New;
break;
}
case AscDFH.historyitem_Style_TableTRCell:
{
this.TableTRCell = Data.New;
break;
}
case AscDFH.historyitem_Style_TableBLCell:
{
this.TableBLCell = Data.New;
break;
}
case AscDFH.historyitem_Style_TableBRCell:
{
this.TableBRCell = Data.New;
break;
}
case AscDFH.historyitem_Style_TableWholeTable:
{
this.TableWholeTable = Data.New;
break;
}
case AscDFH.historyitem_Style_Name:
{
this.Name = Data.New;
break;
}
case AscDFH.historyitem_Style_BasedOn:
{
this.BasedOn = Data.New;
break;
}
case AscDFH.historyitem_Style_Next:
{
this.Next = Data.New;
break;
}
case AscDFH.historyitem_Style_Type:
{
this.Type = Data.New;
break;
}
case AscDFH.historyitem_Style_QFormat:
{
this.qFormat = Data.New;
break;
}
case AscDFH.historyitem_Style_UiPriority:
{
this.uiPriority = Data.New;
break;
}
case AscDFH.historyitem_Style_Hidden:
{
this.hidden = Data.New;
break;
}
case AscDFH.historyitem_Style_SemiHidden:
{
this.semiHidden = Data.New;
break;
}
case AscDFH.historyitem_Style_UnhideWhenUsed:
{
this.unhideWhenUsed = Data.New;
break;
}
case AscDFH.historyitem_Style_Link:
{
this.Link = Data.New;
break;
}
}
},
Get_SelectionState : function()
{
},
Set_SelectionState : function(State, StateIndex)
{
},
Get_ParentObject_or_DocumentPos : function()
{
return { Type : AscDFH.historyitem_recalctype_Inline, Data : 0 };
},
Refresh_RecalcData : function(Data)
{
var Type = Data.Type;
var bNeedRecalc = false;
switch ( Type )
{
case AscDFH.historyitem_Style_TextPr :
case AscDFH.historyitem_Style_ParaPr :
case AscDFH.historyitem_Style_TablePr :
case AscDFH.historyitem_Style_TableRowPr :
case AscDFH.historyitem_Style_TableCellPr :
case AscDFH.historyitem_Style_TableBand1Horz :
case AscDFH.historyitem_Style_TableBand1Vert :
case AscDFH.historyitem_Style_TableBand2Horz :
case AscDFH.historyitem_Style_TableBand2Vert :
case AscDFH.historyitem_Style_TableFirstCol :
case AscDFH.historyitem_Style_TableFirstRow :
case AscDFH.historyitem_Style_TableLastCol :
case AscDFH.historyitem_Style_TableLastRow :
case AscDFH.historyitem_Style_TableTLCell :
case AscDFH.historyitem_Style_TableTRCell :
case AscDFH.historyitem_Style_TableBLCell :
case AscDFH.historyitem_Style_TableBRCell :
case AscDFH.historyitem_Style_TableWholeTable :
case AscDFH.historyitem_Style_Name :
case AscDFH.historyitem_Style_BasedOn :
case AscDFH.historyitem_Style_Next :
case AscDFH.historyitem_Style_Type :
case AscDFH.historyitem_Style_QFormat :
case AscDFH.historyitem_Style_UiPriority :
case AscDFH.historyitem_Style_Hidden :
case AscDFH.historyitem_Style_SemiHidden :
case AscDFH.historyitem_Style_UnhideWhenUsed :
case AscDFH.historyitem_Style_Link :
{
bNeedRecalc = true;
break;
}
}
if ( true === bNeedRecalc )
{
// Сообщаем родительскому классу, что изменения произошли в элементе с номером this.Index и на странице this.PageNum
return this.Refresh_RecalcData2();
}
},
Refresh_RecalcData2 : function()
{
// TODO: Надо сделать механизм, чтобы данное действие не вызывалось много раз подряд, а только 1.
var LogicDocument = editor.WordControl.m_oLogicDocument;
var Styles = LogicDocument.Get_Styles();
var AllParagraphs = [];
if (this.Id != Styles.Default.Paragraph)
{
var AllStylesId = Styles.private_GetAllBasedStylesId(this.Id);
AllParagraphs = LogicDocument.Get_AllParagraphsByStyle(AllStylesId);
LogicDocument.Add_ChangedStyle(AllStylesId);
}
else
{
AllParagraphs = LogicDocument.Get_AllParagraphs({All : true});
LogicDocument.Add_ChangedStyle([this.Id]);
}
var Count = AllParagraphs.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Para = AllParagraphs[Index];
Para.Refresh_RecalcData( { Type : AscDFH.historyitem_Paragraph_PStyle } );
}
},
//-----------------------------------------------------------------------------------
// Функции для совместного редактирования
//-----------------------------------------------------------------------------------
Save_Changes : function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer.WriteLong( AscDFH.historyitem_type_Style );
var Type = Data.Type;
// Пишем тип
Writer.WriteLong( Type );
switch ( Type )
{
case AscDFH.historyitem_Style_TextPr:
case AscDFH.historyitem_Style_ParaPr:
case AscDFH.historyitem_Style_TablePr:
case AscDFH.historyitem_Style_TableRowPr:
case AscDFH.historyitem_Style_TableCellPr:
case AscDFH.historyitem_Style_TableBand1Horz:
case AscDFH.historyitem_Style_TableBand1Vert:
case AscDFH.historyitem_Style_TableBand2Horz:
case AscDFH.historyitem_Style_TableBand2Vert:
case AscDFH.historyitem_Style_TableFirstCol:
case AscDFH.historyitem_Style_TableFirstRow:
case AscDFH.historyitem_Style_TableLastCol:
case AscDFH.historyitem_Style_TableLastRow:
case AscDFH.historyitem_Style_TableTLCell:
case AscDFH.historyitem_Style_TableTRCell:
case AscDFH.historyitem_Style_TableBLCell:
case AscDFH.historyitem_Style_TableBRCell:
case AscDFH.historyitem_Style_TableWholeTable:
{
// Variable
Data.New.Write_ToBinary( Writer );
break;
}
case AscDFH.historyitem_Style_Name:
case AscDFH.historyitem_Style_BasedOn:
case AscDFH.historyitem_Style_Next:
case AscDFH.historyitem_Style_Link:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// String : value
if ( undefined === Data.New )
Writer.WriteBool( true );
else
{
Writer.WriteBool( false );
if ( null === Data.New )
Writer.WriteBool( true );
else
{
Writer.WriteBool( false );
Writer.WriteString2( Data.New );
}
}
break;
}
case AscDFH.historyitem_Style_Type:
{
// Long : value
Writer.WriteLong( Data.New );
break;
}
case AscDFH.historyitem_Style_QFormat:
case AscDFH.historyitem_Style_Hidden:
case AscDFH.historyitem_Style_SemiHidden:
case AscDFH.historyitem_Style_UnhideWhenUsed:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Bool : value
if ( undefined === Data.New )
Writer.WriteBool( true );
else
{
Writer.WriteBool( false );
if ( null === Data.New )
Writer.WriteBool( true );
else
{
Writer.WriteBool( false );
Writer.WriteBool( Data.New );
}
}
break;
}
case AscDFH.historyitem_Style_UiPriority:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Long : value
if ( undefined === Data.New )
Writer.WriteBool( true );
else
{
Writer.WriteBool( false );
if ( null === Data.New )
Writer.WriteBool( true );
else
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
}
break;
}
}
return Writer;
},
Load_Changes : function(Reader)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_Style != ClassType )
return;
var Type = Reader.GetLong();
switch ( Type )
{
case AscDFH.historyitem_Style_TextPr:
{
// Variable
this.TextPr = new CTextPr();
this.TextPr.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_ParaPr:
{
// Variable
this.ParaPr = new CParaPr();
this.ParaPr.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TablePr:
{
// Variable
this.TablePr = new CTablePr();
this.TablePr.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableRowPr:
{
// Variable
this.TableRowPr = new CTableRowPr();
this.TableRowPr.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableCellPr:
{
// Variable
this.TableCellPr = new CTableCellPr();
this.TableCellPr.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableBand1Horz:
{
// Variable
this.TableBand1Horz = new CTableStylePr();
this.TableBand1Horz.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableBand1Vert:
{
// Variable
this.TableBand1Vert = new CTableStylePr();
this.TableBand1Vert.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableBand2Horz:
{
// Variable
this.TableBand2Horz = new CTableStylePr();
this.TableBand2Horz.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableBand2Vert:
{
// Variable
this.TableBand2Vert = new CTableStylePr();
this.TableBand2Vert.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableFirstCol:
{
// Variable
this.TableFirstCol = new CTableStylePr();
this.TableFirstCol.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableFirstRow:
{
// Variable
this.TableFirstRow = new CTableStylePr();
this.TableFirstRow.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableLastCol:
{
// Variable
this.TableLastCol = new CTableStylePr();
this.TableLastCol.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableLastRow:
{
// Variable
this.TableLastRow = new CTableStylePr();
this.TableLastRow.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableTLCell:
{
// Variable
this.TableTLCell = new CTableStylePr();
this.TableTLCell.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableTRCell:
{
// Variable
this.TableTRCell = new CTableStylePr();
this.TableTRCell.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableBLCell:
{
// Variable
this.TableBLCell = new CTableStylePr();
this.TableBLCell.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableBRCell:
{
// Variable
this.TableBRCell = new CTableStylePr();
this.TableBRCell.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_TableWholeTable:
{
// Variable
this.TableWholeTable = new CTableStylePr();
this.TableWholeTable.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_Style_Name:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// String : value
if ( true === Reader.GetBool() )
this.Name = undefined;
else if ( true === Reader.GetBool() )
this.Name = null;
else
this.Name = Reader.GetString2();
break;
}
case AscDFH.historyitem_Style_BasedOn:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// String : value
if ( true === Reader.GetBool() )
this.BasedOn = undefined;
else if ( true === Reader.GetBool() )
this.BasedOn = null;
else
this.BasedOn = Reader.GetString2();
break;
}
case AscDFH.historyitem_Style_Next:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// String : value
if ( true === Reader.GetBool() )
this.Next = undefined;
else if ( true === Reader.GetBool() )
this.Next = null;
else
this.Next = Reader.GetString2();
break;
}
case AscDFH.historyitem_Style_Type:
{
// Long : value
this.Type = Reader.GetLong();
break;
}
case AscDFH.historyitem_Style_QFormat:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Bool : value
if ( true === Reader.GetBool() )
this.qFormat = undefined;
else if ( true === Reader.GetBool() )
this.qFormat = null;
else
this.qFormat = Reader.GetBool();
break;
}
case AscDFH.historyitem_Style_Hidden:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Bool : value
if ( true === Reader.GetBool() )
this.hidden = undefined;
else if ( true === Reader.GetBool() )
this.hidden = null;
else
this.hidden = Reader.GetBool();
break;
}
case AscDFH.historyitem_Style_SemiHidden:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Bool : value
if ( true === Reader.GetBool() )
this.semiHidden = undefined;
else if ( true === Reader.GetBool() )
this.semiHidden = null;
else
this.semiHidden = Reader.GetBool();
break;
}
case AscDFH.historyitem_Style_UnhideWhenUsed:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Bool : value
if ( true === Reader.GetBool() )
this.unhideWhenUsed = undefined;
else if ( true === Reader.GetBool() )
this.unhideWhenUsed = null;
else
this.unhideWhenUsed = Reader.GetBool();
break;
}
case AscDFH.historyitem_Style_UiPriority:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// Long : value
if ( true === Reader.GetBool() )
this.uiPriority = undefined;
else if ( true === Reader.GetBool() )
this.uiPriority = null;
else
this.uiPriority = Reader.GetLong();
break;
}
case AscDFH.historyitem_Style_Link:
{
// Bool : is undefined
// (false)
// Bool : is null
// (false)
// String : value
if ( true === Reader.GetBool() )
this.Link = undefined;
else if ( true === Reader.GetBool() )
this.Link = null;
else
this.Link = Reader.GetString2();
break;
}
}
AscCommon.CollaborativeEditing.Add_LinkData(this, {StyleUpdate : true});
},
Write_ToBinary2 : function(Writer)
{
Writer.WriteLong(AscDFH.historyitem_type_Style);
// String : Id // String : Id
// Bool(und) -> Bool(null) -> String : Name // Bool(und) -> Bool(null) -> String : Name
...@@ -4299,21 +3499,21 @@ CStyles.prototype = ...@@ -4299,21 +3499,21 @@ CStyles.prototype =
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Базовые функции для работы со стилем // Базовые функции для работы со стилем
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Add : function(Style) Add : function(Style)
{ {
var Id = Style.Get_Id(); var Id = Style.Get_Id();
History.Add( this, { Type : AscDFH.historyitem_Styles_Add, Id : Id, Style : Style } ); History.Add(new CChangesStylesAdd(this, Id, Style));
this.Style[Id] = Style; this.Style[Id] = Style;
this.Update_Interface(Id); this.Update_Interface(Id);
return Id; return Id;
}, },
Remove : function(Id) Remove : function(Id)
{ {
History.Add( this, { Type : AscDFH.historyitem_Styles_Remove, Id : Id, Style : this.Style[Id] } ); History.Add(new CChangesStylesRemove(this, Id, this.Style[Id]));
delete this.Style[Id]; delete this.Style[Id];
this.Update_Interface(Id); this.Update_Interface(Id);
}, },
Copy : function() Copy : function()
{ {
...@@ -4364,28 +3564,28 @@ CStyles.prototype = ...@@ -4364,28 +3564,28 @@ CStyles.prototype =
return this.Default.ParaPr; return this.Default.ParaPr;
}, },
Set_DefaultParaPr : function(ParaPr) Set_DefaultParaPr : function(ParaPr)
{ {
History.Add(this, {Type : AscDFH.historyitem_Styles_ChangeDefaultParaPr, Old : this.Default.ParaPr, New : ParaPr}); History.Add(new CChangesStylesChangeDefaultParaPr(this, this.Default.ParaPr, ParaPr));
this.Default.ParaPr = ParaPr; this.Default.ParaPr = ParaPr;
// TODO: Пока данная функция используется только в билдере, как только будет использоваться в самом редакторе, // TODO: Пока данная функция используется только в билдере, как только будет использоваться в самом редакторе,
// надо будет сделать, чтобы происходил пересчет всех стилей. // надо будет сделать, чтобы происходил пересчет всех стилей.
}, },
Get_DefaultTextPr : function() Get_DefaultTextPr : function()
{ {
return this.Default.TextPr; return this.Default.TextPr;
}, },
Set_DefaultTextPr : function(TextPr) Set_DefaultTextPr : function(TextPr)
{ {
History.Add(this, {Type : AscDFH.historyitem_Styles_ChangeDefaultTextPr, Old : this.Default.TextPr, New : TextPr}); History.Add(new CChangesStylesChangeDefaultTextPr(this, this.Default.TextPr, TextPr));
this.Default.TextPr = TextPr; this.Default.TextPr = TextPr;
// TODO: Пока данная функция используется только в билдере, как только будет использоваться в самом редакторе, // TODO: Пока данная функция используется только в билдере, как только будет использоваться в самом редакторе,
// надо будет сделать, чтобы происходил пересчет всех стилей. // надо будет сделать, чтобы происходил пересчет всех стилей.
}, },
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// //
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
...@@ -4936,74 +4136,6 @@ CStyles.prototype = ...@@ -4936,74 +4136,6 @@ CStyles.prototype =
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Undo/Redo функции // Undo/Redo функции
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Undo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case AscDFH.historyitem_Styles_Add:
{
delete this.Style[Data.Id];
this.Update_Interface(Data.Id);
break;
}
case AscDFH.historyitem_Styles_Remove:
{
this.Style[Data.Id] = Data.Style;
this.Update_Interface(Data.Id);
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultParaPr:
{
this.Default.ParaPr = Data.Old;
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultTextPr:
{
this.Default.TextPr = Data.Old;
break;
}
}
},
Redo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case AscDFH.historyitem_Styles_Add:
{
this.Style[Data.Id] = Data.Style;
this.Update_Interface(Data.Id);
break;
}
case AscDFH.historyitem_Styles_Remove:
{
delete this.Style[Data.Id];
this.Update_Interface(Data.Id);
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultParaPr:
{
this.Default.ParaPr = Data.New;
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultTextPr:
{
this.Default.TextPr = Data.New;
break;
}
}
},
Get_SelectionState : function() Get_SelectionState : function()
{ {
}, },
...@@ -5070,98 +4202,6 @@ CStyles.prototype = ...@@ -5070,98 +4202,6 @@ CStyles.prototype =
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Функции для совместного редактирования // Функции для совместного редактирования
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Save_Changes : function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer.WriteLong( AscDFH.historyitem_type_Styles );
var Type = Data.Type;
// Пишем тип
Writer.WriteLong( Type );
switch ( Type )
{
case AscDFH.historyitem_Styles_Add:
case AscDFH.historyitem_Styles_Remove:
{
// String : Id стиля
Writer.WriteString2( Data.Id );
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultParaPr:
case AscDFH.historyitem_Styles_ChangeDefaultTextPr:
{
// Variable : ParaPr | TextPr
Data.New.Write_ToBinary(Writer);
break;
}
}
return Writer;
},
Load_Changes : function(Reader)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_Styles != ClassType )
return;
var Type = Reader.GetLong();
switch ( Type )
{
case AscDFH.historyitem_Styles_Add:
{
// String : Id стиля
// Спокойно добавляем стиль по Id, т.к. сначала стиль создается и только
// потом он добавляется в список стилей.
var Id = Reader.GetString2();
this.Style[Id] = g_oTableId.Get_ById( Id );
this.Update_Interface(Id);
AscCommon.CollaborativeEditing.Add_LinkData(this, {UpdateStyleId : Id});
break;
}
case AscDFH.historyitem_Styles_Remove:
{
// String : Id стиля
var Id = Reader.GetString2();
delete this.Style[Id];
this.Update_Interface(Id);
AscCommon.CollaborativeEditing.Add_LinkData(this, {UpdateStyleId : Id});
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultParaPr:
{
// Variable : ParaPr
var oParaPr = new CParaPr();
oParaPr.Read_FromBinary(Reader);
this.Default.ParaPr = oParaPr;
break;
}
case AscDFH.historyitem_Styles_ChangeDefaultTextPr:
{
// Variable : TextPr
var oTextPr = new CTextPr();
oTextPr.Read_FromBinary(Reader);
this.Default.TextPr = oTextPr;
break;
}
}
},
Load_LinkData : function(LinkData) Load_LinkData : function(LinkData)
{ {
if (undefined !== LinkData.UpdateStyleId) if (undefined !== LinkData.UpdateStyleId)
......
/*
* (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: 08.11.2016
* Time: 19:48
*/
AscDFH.changesFactory[AscDFH.historyitem_Style_TextPr] = CChangesStyleTextPr;
AscDFH.changesFactory[AscDFH.historyitem_Style_ParaPr] = CChangesStyleParaPr;
AscDFH.changesFactory[AscDFH.historyitem_Style_TablePr] = CChangesStyleTablePr;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableRowPr] = CChangesStyleTableRowPr;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableCellPr] = CChangesStyleTableCellPr;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand1Horz] = CChangesStyleTableBand1Horz;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand1Vert] = CChangesStyleTableBand1Vert;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand2Horz] = CChangesStyleTableBand2Horz;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableBand2Vert] = CChangesStyleTableBand2Vert;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableFirstCol] = CChangesStyleTableFirstCol;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableFirstRow] = CChangesStyleTableFirstRow;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableLastCol] = CChangesStyleTableLastCol;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableLastRow] = CChangesStyleTableLastRow;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableTLCell] = CChangesStyleTableTLCell;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableTRCell] = CChangesStyleTableTRCell;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableBLCell] = CChangesStyleTableBLCell;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableBRCell] = CChangesStyleTableBRCell;
AscDFH.changesFactory[AscDFH.historyitem_Style_TableWholeTable] = CChangesStyleTableWholeTable;
AscDFH.changesFactory[AscDFH.historyitem_Style_Name] = CChangesStyleName;
AscDFH.changesFactory[AscDFH.historyitem_Style_BasedOn] = CChangesStyleBasedOn;
AscDFH.changesFactory[AscDFH.historyitem_Style_Next] = CChangesStyleNext;
AscDFH.changesFactory[AscDFH.historyitem_Style_Type] = CChangesStyleType;
AscDFH.changesFactory[AscDFH.historyitem_Style_QFormat] = CChangesStyleQFormat;
AscDFH.changesFactory[AscDFH.historyitem_Style_UiPriority] = CChangesStyleUiPriority;
AscDFH.changesFactory[AscDFH.historyitem_Style_Hidden] = CChangesStyleHidden;
AscDFH.changesFactory[AscDFH.historyitem_Style_SemiHidden] = CChangesStyleSemiHidden;
AscDFH.changesFactory[AscDFH.historyitem_Style_UnhideWhenUsed] = CChangesStyleUnhideWhenUsed;
AscDFH.changesFactory[AscDFH.historyitem_Style_Link] = CChangesStyleLink;
AscDFH.changesFactory[AscDFH.historyitem_Styles_Add] = CChangesStylesAdd;
AscDFH.changesFactory[AscDFH.historyitem_Styles_Remove] = CChangesStylesRemove;
AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultTextPr] = CChangesStylesChangeDefaultTextPr;
AscDFH.changesFactory[AscDFH.historyitem_Styles_ChangeDefaultParaPr] = CChangesStylesChangeDefaultParaPr;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectValue}
*/
function CChangesStyleBaseObjectProperty(Class, Old, New)
{
CChangesStyleBaseObjectProperty.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleBaseObjectProperty, AscDFH.CChangesBaseObjectValue);
CChangesStyleBaseObjectProperty.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {StyleUpdate : true});
};
/**
* Базовый класс для строковых параметров у стиля.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesStyleBaseStringProperty(Class, Old, New)
{
CChangesStyleBaseStringProperty.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleBaseStringProperty, AscDFH.CChangesBaseProperty);
CChangesStyleBaseStringProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Is undefined new
// 2-bit : Is null new
// 3-bit : Is undefined old
// 4-bit : Is null old
// String : New (1,2 - bits are zero)
// String : Old (3,4 - bits are zero)
var nFlags = 0;
if (undefined === this.New)
nFlags |= 1;
else if (null === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
else if (null === this.Old)
nFlags |= 8;
Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New)
Writer.WriteString2(this.New);
if (undefined !== this.Old && null !== this.Old)
Writer.WriteString2(this.Old);
};
CChangesStyleBaseStringProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Is undefined new
// 2-bit : Is null new
// 3-bit : Is undefined old
// 4-bit : Is null old
// String : New (1,2 - bits are zero)
// String : Old (3,4 - bits are zero)
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.New = undefined;
else if (nFlags & 2)
this.New = null;
else
this.New = Reader.GetString2();
if (nFlags & 4)
this.Old = undefined;
else if (nFlags & 8)
this.Old = null;
else
this.Old = Reader.GetString2();
};
CChangesStyleBaseStringProperty.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {StyleUpdate : true});
};
/**
* Базовый класс для строковых параметров у стиля.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesStyleBaseBoolProperty(Class, Old, New)
{
CChangesStyleBaseBoolProperty.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleBaseBoolProperty, AscDFH.CChangesBaseProperty);
CChangesStyleBaseBoolProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Is undefined new
// 2-bit : Is null new
// 3-bit : Is undefined old
// 4-bit : Is null old
// Bool : New (1,2 - bits are zero)
// Bool : Old (3,4 - bits are zero)
var nFlags = 0;
if (undefined === this.New)
nFlags |= 1;
else if (null === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
else if (null === this.Old)
nFlags |= 8;
Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New)
Writer.WriteBool(this.New);
if (undefined !== this.Old && null !== this.Old)
Writer.WriteBool(this.Old);
};
CChangesStyleBaseBoolProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Is undefined new
// 2-bit : Is null new
// 3-bit : Is undefined old
// 4-bit : Is null old
// Bool : New (1,2 - bits are zero)
// Bool : Old (3,4 - bits are zero)
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.New = undefined;
else if (nFlags & 2)
this.New = null;
else
this.New = Reader.GetBool();
if (nFlags & 4)
this.Old = undefined;
else if (nFlags & 8)
this.Old = null;
else
this.Old = Reader.GetBool();
};
CChangesStyleBaseBoolProperty.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {StyleUpdate : true});
};
/**
* Базовый класс для строковых параметров у стиля.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesStyleBaseLongProperty(Class, Old, New)
{
CChangesStyleBaseLongProperty.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleBaseLongProperty, AscDFH.CChangesBaseProperty);
CChangesStyleBaseLongProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Is undefined new
// 2-bit : Is null new
// 3-bit : Is undefined old
// 4-bit : Is null old
// Long : New (1,2 - bits are zero)
// Long : Old (3,4 - bits are zero)
var nFlags = 0;
if (undefined === this.New)
nFlags |= 1;
else if (null === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
else if (null === this.Old)
nFlags |= 8;
Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New)
Writer.WriteLong(this.New);
if (undefined !== this.Old && null !== this.Old)
Writer.WriteLong(this.Old);
};
CChangesStyleBaseLongProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Is undefined new
// 2-bit : Is null new
// 3-bit : Is undefined old
// 4-bit : Is null old
// Long : New (1,2 - bits are zero)
// Long : Old (3,4 - bits are zero)
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.New = undefined;
else if (nFlags & 2)
this.New = null;
else
this.New = Reader.GetLong();
if (nFlags & 4)
this.Old = undefined;
else if (nFlags & 8)
this.Old = null;
else
this.Old = Reader.GetLong();
};
CChangesStyleBaseLongProperty.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {StyleUpdate : true});
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTextPr(Class, Old, New, Color)
{
CChangesStyleTextPr.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTextPr, CChangesStyleBaseObjectProperty);
CChangesStyleTextPr.prototype.Type = AscDFH.historyitem_Style_TextPr;
CChangesStyleTextPr.prototype.private_CreateObject = function()
{
return new CTextPr();
};
CChangesStyleTextPr.prototype.private_SetValue = function(Value)
{
this.Class.TextPr = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleParaPr(Class, Old, New, Color)
{
CChangesStyleParaPr.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleParaPr, CChangesStyleBaseObjectProperty);
CChangesStyleParaPr.prototype.Type = AscDFH.historyitem_Style_ParaPr;
CChangesStyleParaPr.prototype.private_CreateObject = function()
{
return new CParaPr();
};
CChangesStyleParaPr.prototype.private_SetValue = function(Value)
{
this.Class.ParaPr = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTablePr(Class, Old, New, Color)
{
CChangesStyleTablePr.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTablePr, CChangesStyleBaseObjectProperty);
CChangesStyleTablePr.prototype.Type = AscDFH.historyitem_Style_TablePr;
CChangesStyleTablePr.prototype.private_CreateObject = function()
{
return new CTablePr();
};
CChangesStyleTablePr.prototype.private_SetValue = function(Value)
{
this.Class.TablePr = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableRowPr(Class, Old, New, Color)
{
CChangesStyleTableRowPr.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableRowPr, CChangesStyleBaseObjectProperty);
CChangesStyleTableRowPr.prototype.Type = AscDFH.historyitem_Style_TableRowPr;
CChangesStyleTableRowPr.prototype.private_CreateObject = function()
{
return new CTableRowPr();
};
CChangesStyleTableRowPr.prototype.private_SetValue = function(Value)
{
this.Class.TableRowPr = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableCellPr(Class, Old, New, Color)
{
CChangesStyleTableCellPr.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableCellPr, CChangesStyleBaseObjectProperty);
CChangesStyleTableCellPr.prototype.Type = AscDFH.historyitem_Style_TableCellPr;
CChangesStyleTableCellPr.prototype.private_CreateObject = function()
{
return new CTableCellPr();
};
CChangesStyleTableCellPr.prototype.private_SetValue = function(Value)
{
this.Class.TableCellPr = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableBand1Horz(Class, Old, New, Color)
{
CChangesStyleTableBand1Horz.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableBand1Horz, CChangesStyleBaseObjectProperty);
CChangesStyleTableBand1Horz.prototype.Type = AscDFH.historyitem_Style_TableBand1Horz;
CChangesStyleTableBand1Horz.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableBand1Horz.prototype.private_SetValue = function(Value)
{
this.Class.TableBand1Horz = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableBand1Vert(Class, Old, New, Color)
{
CChangesStyleTableBand1Vert.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableBand1Vert, CChangesStyleBaseObjectProperty);
CChangesStyleTableBand1Vert.prototype.Type = AscDFH.historyitem_Style_TableBand1Vert;
CChangesStyleTableBand1Vert.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableBand1Vert.prototype.private_SetValue = function(Value)
{
this.Class.TableBand1Vert = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableBand2Horz(Class, Old, New, Color)
{
CChangesStyleTableBand2Horz.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableBand2Horz, CChangesStyleBaseObjectProperty);
CChangesStyleTableBand2Horz.prototype.Type = AscDFH.historyitem_Style_TableBand2Horz;
CChangesStyleTableBand2Horz.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableBand2Horz.prototype.private_SetValue = function(Value)
{
this.Class.TableBand2Horz = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableBand2Vert(Class, Old, New, Color)
{
CChangesStyleTableBand2Vert.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableBand2Vert, CChangesStyleBaseObjectProperty);
CChangesStyleTableBand2Vert.prototype.Type = AscDFH.historyitem_Style_TableBand2Vert;
CChangesStyleTableBand2Vert.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableBand2Vert.prototype.private_SetValue = function(Value)
{
this.Class.TableBand2Vert = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableFirstCol(Class, Old, New, Color)
{
CChangesStyleTableFirstCol.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableFirstCol, CChangesStyleBaseObjectProperty);
CChangesStyleTableFirstCol.prototype.Type = AscDFH.historyitem_Style_TableFirstCol;
CChangesStyleTableFirstCol.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableFirstCol.prototype.private_SetValue = function(Value)
{
this.Class.TableFirstCol = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableFirstRow(Class, Old, New, Color)
{
CChangesStyleTableFirstRow.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableFirstRow, CChangesStyleBaseObjectProperty);
CChangesStyleTableFirstRow.prototype.Type = AscDFH.historyitem_Style_TableFirstRow;
CChangesStyleTableFirstRow.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableFirstRow.prototype.private_SetValue = function(Value)
{
this.Class.TableFirstRow = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableLastCol(Class, Old, New, Color)
{
CChangesStyleTableLastCol.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableLastCol, CChangesStyleBaseObjectProperty);
CChangesStyleTableLastCol.prototype.Type = AscDFH.historyitem_Style_TableLastCol;
CChangesStyleTableLastCol.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableLastCol.prototype.private_SetValue = function(Value)
{
this.Class.TableLastCol = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableLastRow(Class, Old, New, Color)
{
CChangesStyleTableLastRow.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableLastRow, CChangesStyleBaseObjectProperty);
CChangesStyleTableLastRow.prototype.Type = AscDFH.historyitem_Style_TableLastRow;
CChangesStyleTableLastRow.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableLastRow.prototype.private_SetValue = function(Value)
{
this.Class.TableLastRow = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableTLCell(Class, Old, New, Color)
{
CChangesStyleTableTLCell.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableTLCell, CChangesStyleBaseObjectProperty);
CChangesStyleTableTLCell.prototype.Type = AscDFH.historyitem_Style_TableTLCell;
CChangesStyleTableTLCell.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableTLCell.prototype.private_SetValue = function(Value)
{
this.Class.TableTLCell = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableTRCell(Class, Old, New, Color)
{
CChangesStyleTableTRCell.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableTRCell, CChangesStyleBaseObjectProperty);
CChangesStyleTableTRCell.prototype.Type = AscDFH.historyitem_Style_TableTRCell;
CChangesStyleTableTRCell.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableTRCell.prototype.private_SetValue = function(Value)
{
this.Class.TableTRCell = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableBLCell(Class, Old, New, Color)
{
CChangesStyleTableBLCell.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableBLCell, CChangesStyleBaseObjectProperty);
CChangesStyleTableBLCell.prototype.Type = AscDFH.historyitem_Style_TableBLCell;
CChangesStyleTableBLCell.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableBLCell.prototype.private_SetValue = function(Value)
{
this.Class.TableBLCell = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableBRCell(Class, Old, New, Color)
{
CChangesStyleTableBRCell.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableBRCell, CChangesStyleBaseObjectProperty);
CChangesStyleTableBRCell.prototype.Type = AscDFH.historyitem_Style_TableBRCell;
CChangesStyleTableBRCell.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableBRCell.prototype.private_SetValue = function(Value)
{
this.Class.TableBRCell = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseObjectProperty}
*/
function CChangesStyleTableWholeTable(Class, Old, New, Color)
{
CChangesStyleTableWholeTable.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesStyleTableWholeTable, CChangesStyleBaseObjectProperty);
CChangesStyleTableWholeTable.prototype.Type = AscDFH.historyitem_Style_TableWholeTable;
CChangesStyleTableWholeTable.prototype.private_CreateObject = function()
{
return new CTableStylePr();
};
CChangesStyleTableWholeTable.prototype.private_SetValue = function(Value)
{
this.Class.TableWholeTable = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseStringProperty}
*/
function CChangesStyleName(Class, Old, New)
{
CChangesStyleName.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleName, CChangesStyleBaseStringProperty);
CChangesStyleName.prototype.Type = AscDFH.historyitem_Style_Name;
CChangesStyleName.prototype.private_SetValue = function(Value)
{
this.Class.Name = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseStringProperty}
*/
function CChangesStyleBasedOn(Class, Old, New)
{
CChangesStyleBasedOn.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleBasedOn, CChangesStyleBaseStringProperty);
CChangesStyleBasedOn.prototype.Type = AscDFH.historyitem_Style_BasedOn;
CChangesStyleBasedOn.prototype.private_SetValue = function(Value)
{
this.Class.BasedOn = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseStringProperty}
*/
function CChangesStyleNext(Class, Old, New)
{
CChangesStyleNext.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleNext, CChangesStyleBaseStringProperty);
CChangesStyleNext.prototype.Type = AscDFH.historyitem_Style_Next;
CChangesStyleNext.prototype.private_SetValue = function(Value)
{
this.Class.Next = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongValue}
*/
function CChangesStyleType(Class, Old, New)
{
CChangesStyleType.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleType, AscDFH.CChangesBaseLongValue);
CChangesStyleType.prototype.Type = AscDFH.historyitem_Style_Type;
CChangesStyleType.prototype.private_SetValue = function(Value)
{
this.Class.Type = Value;
};
CChangesStyleType.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {StyleUpdate : true});
};
/**
* @constructor
* @extends {CChangesStyleBaseBoolProperty}
*/
function CChangesStyleQFormat(Class, Old, New)
{
CChangesStyleQFormat.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleQFormat, CChangesStyleBaseBoolProperty);
CChangesStyleQFormat.prototype.Type = AscDFH.historyitem_Style_QFormat;
CChangesStyleQFormat.prototype.private_SetValue = function(Value)
{
this.Class.qFormat = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseLongProperty}
*/
function CChangesStyleUiPriority(Class, Old, New)
{
CChangesStyleUiPriority.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleUiPriority, CChangesStyleBaseLongProperty);
CChangesStyleUiPriority.prototype.Type = AscDFH.historyitem_Style_UiPriority;
CChangesStyleUiPriority.prototype.private_SetValue = function(Value)
{
this.Class.uiPriority = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseBoolProperty}
*/
function CChangesStyleHidden(Class, Old, New)
{
CChangesStyleHidden.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleHidden, CChangesStyleBaseBoolProperty);
CChangesStyleHidden.prototype.Type = AscDFH.historyitem_Style_Hidden;
CChangesStyleHidden.prototype.private_SetValue = function(Value)
{
this.Class.hidden = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseBoolProperty}
*/
function CChangesStyleSemiHidden(Class, Old, New)
{
CChangesStyleSemiHidden.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleSemiHidden, CChangesStyleBaseBoolProperty);
CChangesStyleSemiHidden.prototype.Type = AscDFH.historyitem_Style_SemiHidden;
CChangesStyleSemiHidden.prototype.private_SetValue = function(Value)
{
this.Class.semiHidden = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseBoolProperty}
*/
function CChangesStyleUnhideWhenUsed(Class, Old, New)
{
CChangesStyleUnhideWhenUsed.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleUnhideWhenUsed, CChangesStyleBaseBoolProperty);
CChangesStyleUnhideWhenUsed.prototype.Type = AscDFH.historyitem_Style_UnhideWhenUsed;
CChangesStyleUnhideWhenUsed.prototype.private_SetValue = function(Value)
{
this.Class.unhideWhenUsed = Value;
};
/**
* @constructor
* @extends {CChangesStyleBaseStringProperty}
*/
function CChangesStyleLink(Class, Old, New)
{
CChangesStyleLink.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStyleLink, CChangesStyleBaseStringProperty);
CChangesStyleLink.prototype.Type = AscDFH.historyitem_Style_Link;
CChangesStyleLink.prototype.private_SetValue = function(Value)
{
this.Class.Link = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesStylesAdd(Class, Id, Style)
{
CChangesStylesAdd.superclass.constructor.call(this, Class);
this.Id = Id;
this.Style = Style;
}
AscCommon.extendClass(CChangesStylesAdd, AscDFH.CChangesBase);
CChangesStylesAdd.prototype.Type = AscDFH.historyitem_Styles_Add;
CChangesStylesAdd.prototype.Undo = function()
{
delete this.Class.Style[this.Id];
this.Class.Update_Interface(this.Id);
};
CChangesStylesAdd.prototype.Redo = function()
{
this.Class.Style[this.Id] = this.Style;
this.Class.Update_Interface(this.Id);
};
CChangesStylesAdd.prototype.WriteToBinary = function(Writer)
{
// String : Id
Writer.WriteString2(this.Id);
};
CChangesStylesAdd.prototype.ReadFromBinary = function(Reader)
{
// String : Id
this.Id = Reader.GetString2();
this.Style = AscCommon.g_oTableId.Get_ById(this.Id);
};
CChangesStylesAdd.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {UpdateStyleId : this.Id});
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesStylesRemove(Class, Id, Style)
{
CChangesStylesRemove.superclass.constructor.call(this, Class);
this.Id = Id;
this.Style = Style;
}
AscCommon.extendClass(CChangesStylesRemove, AscDFH.CChangesBase);
CChangesStylesRemove.prototype.Type = AscDFH.historyitem_Styles_Remove;
CChangesStylesRemove.prototype.Undo = function()
{
this.Class.Style[this.Id] = this.Style;
this.Class.Update_Interface(this.Id);
};
CChangesStylesRemove.prototype.Redo = function()
{
delete this.Class.Style[this.Id];
this.Class.Update_Interface(this.Id);
};
CChangesStylesRemove.prototype.WriteToBinary = function(Writer)
{
// String : Id
Writer.WriteString2(this.Id);
};
CChangesStylesRemove.prototype.ReadFromBinary = function(Reader)
{
// String : Id
this.Id = Reader.GetString2();
this.Style = AscCommon.g_oTableId.Get_ById(this.Id);
};
CChangesStylesRemove.prototype.Load = function()
{
this.Redo();
AscCommon.CollaborativeEditing.Add_LinkData(this.Class, {UpdateStyleId : this.Id});
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectValue}
*/
function CChangesStylesChangeDefaultTextPr(Class, Old, New)
{
CChangesStylesChangeDefaultTextPr.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStylesChangeDefaultTextPr, AscDFH.CChangesBaseObjectValue);
CChangesStylesChangeDefaultTextPr.prototype.Type = AscDFH.historyitem_Styles_ChangeDefaultTextPr;
CChangesStylesChangeDefaultTextPr.prototype.private_CreateObject = function()
{
return new CTextPr();
};
CChangesStylesChangeDefaultTextPr.prototype.private_SetValue = function(Value)
{
this.Class.Default.TextPr = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectValue}
*/
function CChangesStylesChangeDefaultParaPr(Class, Old, New)
{
CChangesStylesChangeDefaultParaPr.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(CChangesStylesChangeDefaultParaPr, AscDFH.CChangesBaseObjectValue);
CChangesStylesChangeDefaultParaPr.prototype.Type = AscDFH.historyitem_Styles_ChangeDefaultParaPr;
CChangesStylesChangeDefaultParaPr.prototype.private_CreateObject = function()
{
return new CParaPr();
};
CChangesStylesChangeDefaultParaPr.prototype.private_SetValue = function(Value)
{
this.Class.Default.ParaPr = Value;
};
\ No newline at end of file
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