Commit 45a6d2c0 authored by Ilya Kirillov's avatar Ilya Kirillov

All changes for class ParaRun were reworked in to a classes. Also added a...

All changes for class ParaRun were reworked in to a classes. Also added a scheme sketch for Undo/Redo for fast collaboration.
parent c2d1018d
......@@ -461,7 +461,7 @@ CCollaborativeEditingBase.prototype.Apply_OtherChanges = function()
//this.m_nErrorLog_PointChangesCount++;
}
this.m_aChanges = [];
this.private_ClearChanges();
// У новых элементов выставляем указатели на другие классы
this.Apply_LinkData();
......@@ -752,6 +752,13 @@ CCollaborativeEditingBase.prototype.InitMemory = function() {
this.m_oMemory = new AscCommon.CMemory();
}
};
//----------------------------------------------------------------------------------------------------------------------
// Private area
//----------------------------------------------------------------------------------------------------------------------
CCollaborativeEditingBase.prototype.private_ClearChanges = function()
{
this.m_aChanges = [];
};
//----------------------------------------------------------------------------------------------------------------------
......@@ -903,7 +910,6 @@ CDocumentPositionsManager.prototype.Remove_DocumentPosition = function(DocPos)
}
}
};
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].FOREIGN_CURSOR_LABEL_HIDETIME = FOREIGN_CURSOR_LABEL_HIDETIME;
......
......@@ -1579,7 +1579,7 @@
window['AscDFH'].historyitem_ParaRun_Italic = window['AscDFH'].historyitem_type_ParaRun | 4;
window['AscDFH'].historyitem_ParaRun_Strikeout = window['AscDFH'].historyitem_type_ParaRun | 5;
window['AscDFH'].historyitem_ParaRun_Underline = window['AscDFH'].historyitem_type_ParaRun | 6;
window['AscDFH'].historyitem_ParaRun_FontFamily = window['AscDFH'].historyitem_type_ParaRun | 7;
window['AscDFH'].historyitem_ParaRun_FontFamily = window['AscDFH'].historyitem_type_ParaRun | 7; // obsolete
window['AscDFH'].historyitem_ParaRun_FontSize = window['AscDFH'].historyitem_type_ParaRun | 8;
window['AscDFH'].historyitem_ParaRun_Color = window['AscDFH'].historyitem_type_ParaRun | 9;
window['AscDFH'].historyitem_ParaRun_VertAlign = window['AscDFH'].historyitem_type_ParaRun | 10;
......@@ -1590,7 +1590,7 @@
window['AscDFH'].historyitem_ParaRun_Caps = window['AscDFH'].historyitem_type_ParaRun | 15;
window['AscDFH'].historyitem_ParaRun_SmallCaps = window['AscDFH'].historyitem_type_ParaRun | 16;
window['AscDFH'].historyitem_ParaRun_Position = window['AscDFH'].historyitem_type_ParaRun | 17;
window['AscDFH'].historyitem_ParaRun_Value = window['AscDFH'].historyitem_type_ParaRun | 18;
window['AscDFH'].historyitem_ParaRun_Value = window['AscDFH'].historyitem_type_ParaRun | 18; // obsolete
window['AscDFH'].historyitem_ParaRun_RFonts = window['AscDFH'].historyitem_type_ParaRun | 19;
window['AscDFH'].historyitem_ParaRun_Lang = window['AscDFH'].historyitem_type_ParaRun | 20;
window['AscDFH'].historyitem_ParaRun_RFonts_Ascii = window['AscDFH'].historyitem_type_ParaRun | 21;
......@@ -2884,27 +2884,42 @@
};
window['AscDFH'].CChangesBase = CChangesBase;
/**
* Базовый класс для изменения булевых свойств.
* Базовый класс для изменения свойств.
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesBaseBoolProperty(Class, Old, New)
function CChangesBaseProperty(Class, Old, New, Color)
{
CChangesBaseBoolProperty.superclass.constructor.call(this, Class);
CChangesBaseProperty.superclass.constructor.call(this, Class);
this.Color = false;
this.Color = true === Color ? true : false;
this.Old = Old;
this.New = New;
}
AscCommon.extendClass(CChangesBase, CChangesBaseBoolProperty);
CChangesBaseBoolProperty.prototype.Undo = function()
AscCommon.extendClass(CChangesBase, CChangesBaseProperty);
CChangesBaseProperty.prototype.Undo = function()
{
this.private_SetValue(this.Old);
};
CChangesBaseBoolProperty.prototype.Redo = function()
CChangesBaseProperty.prototype.Redo = function()
{
this.private_SetValue(this.New);
};
CChangesBaseProperty.prototype.private_SetValue = function(Value)
{
// Эту функцию нужно переопределить в дочернем классе
};
window['AscDFH'].CChangesBaseProperty = CChangesBaseProperty;
/**
* Базовый класс для изменения булевых свойств.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesBaseBoolProperty(Class, Old, New, Color)
{
CChangesBaseBoolProperty.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesBaseProperty, CChangesBaseBoolProperty);
CChangesBaseBoolProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
......@@ -2961,9 +2976,295 @@
else
this.Old = false;
};
CChangesBaseBoolProperty.prototype.private_SetValue = function(Value)
window['AscDFH'].CChangesBaseBoolProperty = CChangesBaseBoolProperty;
/**
* Базовый класс для изменения числовых (double) свойств.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesBaseDoubleProperty(Class, Old, New, Color)
{
CChangesBaseDoubleProperty.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesBaseProperty, CChangesBaseDoubleProperty);
CChangesBaseDoubleProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// double : New
// double : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteDouble(this.New);
if (undefined !== this.Old)
Writer.WriteDouble(this.Old);
};
CChangesBaseDoubleProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// double : New
// double : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
this.New = undefined;
else
this.New = Reader.GetDouble();
if (nFlags & 4)
this.Old = undefined;
else
this.Old = Reader.GetDouble();
};
window['AscDFH'].CChangesBaseDoubleProperty = CChangesBaseDoubleProperty;
/**
* Базовый класс для изменения объектных свойств, т.е. если свойство задано объектом.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesBaseObjectProperty(Class, Old, New, Color)
{
CChangesBaseObjectProperty.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesBaseProperty, CChangesBaseObjectProperty);
CChangesBaseObjectProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// Variable : New
// Variable : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New && this.New.Write_ToBinary)
this.New.Write_ToBinary(Writer);
if (undefined !== this.Old && this.Old.Write_ToBinary)
this.Old.Write_ToBinary(Writer);
};
CChangesBaseObjectProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// Variable : New
// Variable : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
{
if (true === this.private_IsCreateEmptyObject())
this.New = this.private_CreateObject();
else
this.New = undefined;
}
else
{
this.New = this.private_CreateObject();
if (this.New && this.New.Read_FromBinary)
this.New.Read_FromBinary(Reader);
}
if (nFlags & 4)
{
if (true === this.private_IsCreateEmptyObject())
this.Old = this.private_CreateObject();
else
this.Old = undefined;
}
else
{
this.Old = this.private_CreateObject();
if (this.Old && this.Old.Read_FromBinary)
this.Old.Read_FromBinary(Reader);
}
};
CChangesBaseObjectProperty.prototype.private_CreateObject = function()
{
// Эту функцию нужно переопределить в дочернем классе
return null;
};
window['AscDFH'].CChangesBaseBoolProperty = CChangesBaseBoolProperty;
CChangesBaseObjectProperty.prototype.private_IsCreateEmptyObject = function()
{
return false;
};
window['AscDFH'].CChangesBaseObjectProperty = CChangesBaseObjectProperty;
/**
* Базовый класс для изменения числовых (long) свойств.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesBaseLongProperty(Class, Old, New, Color)
{
CChangesBaseLongProperty.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesBaseProperty, CChangesBaseLongProperty);
CChangesBaseLongProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// long : New
// long : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteLong(this.New);
if (undefined !== this.Old)
Writer.WriteLong(this.Old);
};
CChangesBaseLongProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// double : New
// double : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
this.New = undefined;
else
this.New = Reader.GetLong();
if (nFlags & 4)
this.Old = undefined;
else
this.Old = Reader.GetLong();
};
window['AscDFH'].CChangesBaseLongProperty = CChangesBaseLongProperty;
/**
* Базовый класс для изменения строковых свойств.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesBaseStringProperty(Class, Old, New, Color)
{
CChangesBaseStringProperty.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesBaseProperty, CChangesBaseStringProperty);
CChangesBaseStringProperty.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// string : New
// string : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteString2(this.New);
if (undefined !== this.Old)
Writer.WriteString2(this.Old);
};
CChangesBaseStringProperty.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// string : New
// string : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
this.New = undefined;
else
this.New = Reader.GetString2();
if (nFlags & 4)
this.Old = undefined;
else
this.Old = Reader.GetString2();
};
window['AscDFH'].CChangesBaseStringProperty = CChangesBaseStringProperty;
})(window);
......@@ -47,6 +47,9 @@ function CWordCollaborativeEditing()
this.m_aForeignCursors = {};
this.m_aForeignCursorsXY = {};
this.m_aForeignCursorsToShow = {};
this.m_aAllChanges = []; // Список всех изменений
this.m_aOwnChangesIndexes = []; // Список номеров своих изменений в общем списке, которые мы можем откатить
}
AscCommon.extendClass(CWordCollaborativeEditing, AscCommon.CCollaborativeEditingBase);
......@@ -81,7 +84,7 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition
}
var deleteIndex = ( null === AscCommon.History.SavedIndex ? null : SumIndex );
var aChanges = [];
var aChanges = [], aChanges2 = [];
for (var PointIndex = StartPoint; PointIndex <= LastPoint; PointIndex++)
{
var Point = AscCommon.History.Points[PointIndex];
......@@ -92,6 +95,7 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition
var Item = Point.Items[Index];
var oChanges = new AscCommon.CCollaborativeChanges();
oChanges.Set_FromUndoRedo(Item.Class, Item.Data, Item.Binary);
aChanges2.push(oChanges);
aChanges.push(oChanges.m_pData);
}
}
......@@ -111,11 +115,16 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition
this.m_aNeedUnlock2.length = 0;
var deleteIndex = ( null === AscCommon.History.SavedIndex ? null : SumIndex );
if (0 < aChanges.length || null !== deleteIndex) {
if (0 < aChanges.length || null !== deleteIndex)
{
this.private_OnSendOwnChanges(aChanges2, deleteIndex);
editor.CoAuthoringApi.saveChanges(aChanges, deleteIndex, AdditionalInfo);
AscCommon.History.CanNotAddChanges = true;
} else
}
else
{
editor.CoAuthoringApi.unLockDocument(true);
}
if (-1 === this.m_nUseType)
{
......@@ -577,6 +586,99 @@ CWordCollaborativeEditing.prototype.Update_ForeignCursorLabelPosition = function
var Api = this.m_oLogicDocument.Get_Api();
Api.sync_ShowForeignCursorLabel(UserId, X, Y, Color);
};
//----------------------------------------------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------------------------------------------
CWordCollaborativeEditing.prototype.private_ClearChanges = function()
{
this.m_aAllChanges = this.m_aAllChanges.concat(this.m_aChanges);
this.m_aChanges = [];
};
CWordCollaborativeEditing.prototype.private_OnSendOwnChanges = function(arrChanges, nDeleteIndex)
{
this.m_aOwnChangesIndexes.push({
Position : this.m_aAllChanges.length,
Count : arrChanges.length
});
this.m_aAllChanges = this.m_aAllChanges.concat(arrChanges);
// TODO: Пока nDeleteIndex не учитывается, исправить.
// TODO: Тут возможен случай, когда arrChanges пустой. Возможно необходимо убрать несколько последних записей
// в массиве this.m_aOwnChangesIndexes
// TODO: Пока мы делаем это как одну точку, которую надо откатить. Надо пробежаться по массиву и разбить его
// по отдельным действиям.
};
CWordCollaborativeEditing.prototype.Undo = function()
{
if (this.m_aOwnChangesIndexes.length <= 0)
return false;
// Формируем новую пачку действий, которые будут откатывать нужные нам действия.
var oIndexes = this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length - 1];
var nPosition = oIndexes.Position;
var nCount = oIndexes.Count;
for (var nIndex = 0; nIndex < nCount; ++nIndex)
{
var oChange = this.m_aAllChanges[nPosition + nIndex];
if (this.private_IsChangeContentChange(oChange))
{
var bAdd = this.private_IsChangeAddToContent(oChange);
console.log(bAdd);
}
}
// Удаляем запись о последнем изменении
this.m_aOwnChangesIndexes.length = this.m_aOwnChangesIndexes.length - 1;
};
CWordCollaborativeEditing.prototype.CanUndo = function()
{
return this.m_aOwnChangesIndexes.length <= 0 ? false : true;
};
CWordCollaborativeEditing.prototype.private_IsChangeContentChange = function(Data)
{
if (AscDFH.historyitem_Document_AddItem === Data.Type
|| AscDFH.historyitem_Document_RemoveItem === Data.Type
|| AscDFH.historyitem_DocumentContent_AddItem === Data.Type
|| AscDFH.historyitem_DocumentContent_RemoveItem === Data.Type
|| AscDFH.historyitem_Table_AddRow === Data.Type
|| AscDFH.historyitem_Table_RemoveRow === Data.Type
|| AscDFH.historyitem_TableRow_AddCell === Data.Type
|| AscDFH.historyitem_TableRow_RemoveCell === Data.Type
|| AscDFH.historyitem_Paragraph_AddItem === Data.Type
|| AscDFH.historyitem_Paragraph_RemoveItem === Data.Type
|| AscDFH.historyitem_Hyperlink_AddItem === Data.Type
|| AscDFH.historyitem_Hyperlink_RemoveItem === Data.Type
|| AscDFH.historyitem_ParaRun_AddItem === Data.Type
|| AscDFH.historyitem_ParaRun_RemoveItem === Data.Type
|| AscDFH.historyitem_Presentation_AddSlide === Data.Type
|| AscDFH.historyitem_Presentation_RemoveSlide === Data.Type
|| AscDFH.historyitem_SlideAddToSpTree === Data.Type
|| AscDFH.historyitem_SlideRemoveFromSpTree === Data.Type)
return true;
return false;
};
CWordCollaborativeEditing.prototype.private_IsChangeAddToContent = function(Data)
{
if (AscDFH.historyitem_Document_AddItem === Data.Type
|| AscDFH.historyitem_DocumentContent_AddItem === Data.Type
|| AscDFH.historyitem_Table_AddRow === Data.Type
|| AscDFH.historyitem_TableRow_AddCell === Data.Type
|| AscDFH.historyitem_Paragraph_AddItem === Data.Type
|| AscDFH.historyitem_Hyperlink_AddItem === Data.Type
|| AscDFH.historyitem_ParaRun_AddItem === Data.Type
|| AscDFH.historyitem_Presentation_AddSlide === Data.Type
|| AscDFH.historyitem_SlideAddToSpTree === Data.Type)
return true;
return false;
};
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
......
......@@ -7300,2066 +7300,69 @@ ParaRun.prototype.Undo = function(Data)
switch ( Type )
{
case AscDFH.historyitem_ParaRun_TextPr:
{
if ( undefined != Data.Old )
this.Pr = Data.Old;
else
this.Pr = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Bold:
{
if ( undefined != Data.Old )
this.Pr.Bold = Data.Old;
else
this.Pr.Bold = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Italic:
{
if ( undefined != Data.Old )
this.Pr.Italic = Data.Old;
else
this.Pr.Italic = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Strikeout:
{
if ( undefined != Data.Old )
this.Pr.Strikeout = Data.Old;
else
this.Pr.Strikeout = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Underline:
{
if ( undefined != Data.Old )
this.Pr.Underline = Data.Old;
else
this.Pr.Underline = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_FontSize:
{
if ( undefined != Data.Old )
this.Pr.FontSize = Data.Old;
else
this.Pr.FontSize = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Color:
{
if ( undefined != Data.Old )
this.Pr.Color = Data.Old;
else
this.Pr.Color = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Unifill:
{
if ( undefined != Data.Old )
this.Pr.Unifill = Data.Old;
else
this.Pr.Unifill = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_TextFill:
{
if ( undefined != Data.Old )
this.Pr.TextFill = Data.Old;
else
this.Pr.TextFill = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_TextOutline:
{
if ( undefined != Data.Old )
this.Pr.TextOutline = Data.Old;
else
this.Pr.TextOutline = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_VertAlign:
{
if ( undefined != Data.Old )
this.Pr.VertAlign = Data.Old;
else
this.Pr.VertAlign = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_HighLight:
{
if ( undefined != Data.Old )
this.Pr.HighLight = Data.Old;
else
this.Pr.HighLight = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RStyle:
{
if ( undefined != Data.Old )
this.Pr.RStyle = Data.Old;
else
this.Pr.RStyle = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Spacing:
{
if ( undefined != Data.Old )
this.Pr.Spacing = Data.Old;
else
this.Pr.Spacing = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_DStrikeout:
{
if ( undefined != Data.Old )
this.Pr.DStrikeout = Data.Old;
else
this.Pr.DStrikeout = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Caps:
{
if ( undefined != Data.Old )
this.Pr.Caps = Data.Old;
else
this.Pr.Caps = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_SmallCaps:
{
if ( undefined != Data.Old )
this.Pr.SmallCaps = Data.Old;
else
this.Pr.SmallCaps = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Position:
{
if ( undefined != Data.Old )
this.Pr.Position = Data.Old;
else
this.Pr.Position = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts:
{
if ( undefined != Data.Old )
this.Pr.RFonts = Data.Old;
else
this.Pr.RFonts = new CRFonts();
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Ascii:
{
if ( undefined != Data.Old )
this.Pr.RFonts.Ascii = Data.Old;
else
this.Pr.RFonts.Ascii = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_HAnsi:
{
if ( undefined != Data.Old )
this.Pr.RFonts.HAnsi = Data.Old;
else
this.Pr.RFonts.HAnsi = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_CS:
{
if ( undefined != Data.Old )
this.Pr.RFonts.CS = Data.Old;
else
this.Pr.RFonts.CS = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_EastAsia:
{
if ( undefined != Data.Old )
this.Pr.RFonts.EastAsia = Data.Old;
else
this.Pr.RFonts.EastAsia = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Hint:
{
if ( undefined != Data.Old )
this.Pr.RFonts.Hint = Data.Old;
else
this.Pr.RFonts.Hint = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang:
{
if ( undefined != Data.Old )
this.Pr.Lang = Data.Old;
else
this.Pr.Lang = new CLang();
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_Bidi:
{
if ( undefined != Data.Old )
this.Pr.Lang.Bidi = Data.Old;
else
this.Pr.Lang.Bidi = undefined;
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_EastAsia:
{
if ( undefined != Data.Old )
this.Pr.Lang.EastAsia = Data.Old;
else
this.Pr.Lang.EastAsia = undefined;
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_Val:
{
if ( undefined != Data.Old )
this.Pr.Lang.Val = Data.Old;
else
this.Pr.Lang.Val = undefined;
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Shd:
{
this.Pr.Shd = Data.Old;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_MathStyle:
{
this.MathPrp.sty = Data.Old;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_MathPrp:
{
this.MathPrp = Data.Old;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_ReviewType:
{
this.ReviewType = Data.Old.ReviewType;
this.ReviewInfo = Data.Old.ReviewInfo;
this.private_UpdateTrackRevisions();
break;
}
case AscDFH.historyitem_ParaRun_PrChange:
{
this.Pr.PrChange = Data.Old.PrChange;
this.Pr.ReviewInfo = Data.Old.ReviewInfo;
this.private_UpdateTrackRevisions();
break;
}
case AscDFH.historyitem_ParaRun_ContentReviewInfo:
{
this.ReviewInfo = Data.Old;
break;
}
case AscDFH.historyitem_ParaRun_PrReviewInfo:
{
this.Pr.ReviewInfo = Data.Old;
break;
}
case AscDFH.historyitem_ParaRun_MathAlnAt:
{
this.MathPrp.Apply_AlnAt(Data.Old);
break;
}
case AscDFH.historyitem_ParaRun_MathForcedBreak:
{
if(Data.bInsert)
{
this.MathPrp.Delete_ForcedBreak();
}
else
{
this.MathPrp.Insert_ForcedBreak(Data.alnAt);
}
break;
}
}
};
ParaRun.prototype.Redo = function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case AscDFH.historyitem_ParaRun_TextPr:
{
if ( undefined != Data.New )
this.Pr = Data.New;
else
this.Pr = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Bold:
{
if ( undefined != Data.New )
this.Pr.Bold = Data.New;
else
this.Pr.Bold = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Italic:
{
if ( undefined != Data.New )
this.Pr.Italic = Data.New;
else
this.Pr.Italic = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Strikeout:
{
if ( undefined != Data.New )
this.Pr.Strikeout = Data.New;
else
this.Pr.Strikeout = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Underline:
{
if ( undefined != Data.New )
this.Pr.Underline = Data.New;
else
this.Pr.Underline = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_FontSize:
{
if ( undefined != Data.New )
this.Pr.FontSize = Data.New;
else
this.Pr.FontSize = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Color:
{
if ( undefined != Data.New )
this.Pr.Color = Data.New;
else
this.Pr.Color = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Unifill:
{
if ( undefined != Data.New )
this.Pr.Unifill = Data.New;
else
this.Pr.Unifill = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_TextFill:
{
if ( undefined != Data.New )
this.Pr.TextFill = Data.New;
else
this.Pr.TextFill = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_TextOutline:
{
if ( undefined != Data.New )
this.Pr.TextOutline = Data.New;
else
this.Pr.TextOutline = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_VertAlign:
{
if ( undefined != Data.New )
this.Pr.VertAlign = Data.New;
else
this.Pr.VertAlign = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_HighLight:
{
if ( undefined != Data.New )
this.Pr.HighLight = Data.New;
else
this.Pr.HighLight = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RStyle:
{
if ( undefined != Data.New )
this.Pr.RStyle = Data.New;
else
this.Pr.RStyle = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Spacing:
{
if ( undefined != Data.New )
this.Pr.Spacing = Data.New;
else
this.Pr.Spacing = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_DStrikeout:
{
if ( undefined != Data.New )
this.Pr.DStrikeout = Data.New;
else
this.Pr.DStrikeout = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Caps:
{
if ( undefined != Data.New )
this.Pr.Caps = Data.New;
else
this.Pr.Caps = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_SmallCaps:
{
if ( undefined != Data.New )
this.Pr.SmallCaps = Data.New;
else
this.Pr.SmallCaps = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Position:
{
if ( undefined != Data.New )
this.Pr.Position = Data.New;
else
this.Pr.Position = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts:
{
if ( undefined != Data.New )
this.Pr.RFonts = Data.New;
else
this.Pr.RFonts = new CRFonts();
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Ascii:
{
if ( undefined != Data.New )
this.Pr.RFonts.Ascii = Data.New;
else
this.Pr.RFonts.Ascii = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_HAnsi:
{
if ( undefined != Data.New )
this.Pr.RFonts.HAnsi = Data.New;
else
this.Pr.RFonts.HAnsi = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_CS:
{
if ( undefined != Data.New )
this.Pr.RFonts.CS = Data.New;
else
this.Pr.RFonts.CS = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_EastAsia:
{
if ( undefined != Data.New )
this.Pr.RFonts.EastAsia = Data.New;
else
this.Pr.RFonts.EastAsia = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Hint:
{
if ( undefined != Data.New )
this.Pr.RFonts.Hint = Data.New;
else
this.Pr.RFonts.Hint = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang:
{
if ( undefined != Data.New )
this.Pr.Lang = Data.New;
else
this.Pr.Lang = new CLang();
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_Bidi:
{
if ( undefined != Data.New )
this.Pr.Lang.Bidi = Data.New;
else
this.Pr.Lang.Bidi = undefined;
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_EastAsia:
{
if ( undefined != Data.New )
this.Pr.Lang.EastAsia = Data.New;
else
this.Pr.Lang.EastAsia = undefined;
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_Val:
{
if ( undefined != Data.New )
this.Pr.Lang.Val = Data.New;
else
this.Pr.Lang.Val = undefined;
this.Recalc_CompiledPr(false);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Shd:
{
this.Pr.Shd = Data.New;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_MathStyle:
{
this.MathPrp.sty = Data.New;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_MathPrp:
{
this.MathPrp = Data.New;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_ReviewType:
{
this.ReviewType = Data.New.ReviewType;
this.ReviewInfo = Data.New.ReviewInfo;
this.private_UpdateTrackRevisions();
break;
}
case AscDFH.historyitem_ParaRun_PrChange:
{
this.Pr.PrChange = Data.New.PrChange;
this.Pr.ReviewInfo = Data.New.ReviewInfo;
this.private_UpdateTrackRevisions();
break;
}
case AscDFH.historyitem_ParaRun_ContentReviewInfo:
{
this.ReviewInfo = Data.New;
break;
}
case AscDFH.historyitem_ParaRun_PrReviewInfo:
{
this.Pr.ReviewInfo = Data.New;
break;
}
case AscDFH.historyitem_ParaRun_MathAlnAt:
{
this.MathPrp.Apply_AlnAt(Data.New);
break;
}
case AscDFH.historyitem_ParaRun_MathForcedBreak:
{
if(Data.bInsert)
{
this.MathPrp.Insert_ForcedBreak(Data.alnAt);
}
else
{
this.MathPrp.Delete_ForcedBreak();
}
break;
}
}
};
ParaRun.prototype.Check_HistoryUninon = function(Data1, Data2)
{
var Type1 = Data1.Type;
var Type2 = Data2.Type;
if ( AscDFH.historyitem_ParaRun_AddItem === Type1 && AscDFH.historyitem_ParaRun_AddItem === Type2 )
{
if ( 1 === Data1.Items.length && 1 === Data2.Items.length && Data1.Pos === Data2.Pos - 1 && para_Text === Data1.Items[0].Type && para_Text === Data2.Items[0].Type )
return true;
}
return false;
};
//-----------------------------------------------------------------------------------
// Функции для совместного редактирования
//-----------------------------------------------------------------------------------
ParaRun.prototype.Save_Changes = function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer.WriteLong( AscDFH.historyitem_type_ParaRun );
var Type = Data.Type;
// Пишем тип
Writer.WriteLong( Type );
switch ( Type )
{
case AscDFH.historyitem_ParaRun_TextPr:
{
// Bool : Подсвечивать ли данные изменения
// CTextPr
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
this.Pr.Write_ToBinary( Writer );
break;
}
case AscDFH.historyitem_ParaRun_Bold:
case AscDFH.historyitem_ParaRun_Italic:
case AscDFH.historyitem_ParaRun_Strikeout:
case AscDFH.historyitem_ParaRun_Underline:
{
// Bool : Подсвечивать ли данные изменения
// Bool : IsUndefined
// Bool : Value
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteBool( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_FontSize:
{
// Bool : Подсвечивать ли данные изменения
// Bool : IsUndefined
// Double : FontSize
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Writer.WriteDouble( Data.New );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_ParaRun_Color:
{
// Bool : Подсвечивать ли данные изменения
// Bool : IsUndefined
// Variable : Color (CDocumentColor)
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_ParaRun_Unifill:
case AscDFH.historyitem_ParaRun_TextFill:
case AscDFH.historyitem_ParaRun_TextOutline:
{
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_ParaRun_VertAlign:
{
// Bool : IsUndefined
// Long : VertAlign
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Writer.WriteLong(Data.New);
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_ParaRun_HighLight:
{
// Bool : IsUndefined
// Если false
// Bool : IsNone
// Если false
// Variable : Color (CDocumentColor)
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool(false);
if ( highlight_None != Data.New )
{
Writer.WriteBool( false );
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool( true );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_ParaRun_RStyle:
{
// Bool : IsUndefined
// Если false
// String : RStyle
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteString2( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_Spacing:
case AscDFH.historyitem_ParaRun_Position:
{
// Bool : IsUndefined
// Если false
// Double : Spacing
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteDouble( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_DStrikeout:
case AscDFH.historyitem_ParaRun_Caps:
case AscDFH.historyitem_ParaRun_SmallCaps:
{
// Bool : IsUndefined
// Если false
// Bool : value
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteBool( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_RFonts:
{
// Bool : undefined ?
// false -> CRFonts
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Ascii:
case AscDFH.historyitem_ParaRun_RFonts_HAnsi:
case AscDFH.historyitem_ParaRun_RFonts_CS:
case AscDFH.historyitem_ParaRun_RFonts_EastAsia:
{
// Bool : undefined?
// false -> String
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteString2( Data.New.Name );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Hint:
{
// Bool : undefined?
// false -> Long
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_Lang:
{
// Bool : undefined ?
// false -> CLang
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_Lang_Bidi:
case AscDFH.historyitem_ParaRun_Lang_EastAsia:
case AscDFH.historyitem_ParaRun_Lang_Val:
{
// Bool : undefined ?
// false -> Long
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_Shd:
{
// Bool : undefined
// false - >
// Variable : CDocumentShd
if (false === Data.Color)
Writer.WriteBool(false);
else
Writer.WriteBool(true);
if ( undefined !== Data.New )
{
Writer.WriteBool(false);
Data.New.Write_ToBinary(Writer);
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_ParaRun_MathStyle:
{
// Bool : undefined ?
// false -> Long
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_ParaRun_MathPrp:
{
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
var Flags = 0;
if ( undefined != this.MathPrp.aln )
{
Writer.WriteBool( this.MathPrp.aln );
Flags |= 1;
}
if ( undefined != this.MathPrp.brk )
{
this.MathPrp.brk.Write_ToBinary(Writer);
Flags |= 2;
}
if ( undefined != this.MathPrp.lit )
{
Writer.WriteBool( this.MathPrp.lit );
Flags |= 4;
}
if ( undefined != this.MathPrp.nor )
{
Writer.WriteBool( this.MathPrp.nor );
Flags |= 8;
}
if ( undefined != this.MathPrp.scr )
{
Writer.WriteLong( this.MathPrp.scr );
Flags |= 16;
}
if ( undefined != this.MathPrp.sty )
{
Writer.WriteLong( this.MathPrp.sty );
Flags |= 32;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos );
Writer.WriteLong( Flags );
Writer.Seek( EndPos );
break;
}
case AscDFH.historyitem_ParaRun_ReviewType:
{
// Long : ReviewType
// CReviewInfo : ReviewInfo
Writer.WriteLong(Data.New.ReviewType);
Data.New.ReviewInfo.Write_ToBinary(Writer);
break;
}
case AscDFH.historyitem_ParaRun_PrChange:
{
// Bool : is undefined ?
// false -> TextPr
// Bool : is undefined ?
// false -> ReviewInfo
if (undefined === Data.New.PrChange)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Data.New.PrChange.Write_ToBinary(Writer);
}
if (undefined === Data.New.ReviewInfo)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Data.New.ReviewInfo.Write_ToBinary(Writer);
}
break;
}
case AscDFH.historyitem_ParaRun_ContentReviewInfo:
{
// Bool : is undefined ?
// false -> ReviewInfo
if (undefined === Data.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Data.New.Write_ToBinary(Writer);
}
break;
}
case AscDFH.historyitem_ParaRun_PrReviewInfo:
{
// Bool : is undefined ?
// false -> ReviewInfo
if (undefined === Data.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Data.New.Write_ToBinary(Writer);
}
break;
}
case AscDFH.historyitem_ParaRun_OnStartSplit:
{
Writer.WriteLong(Data.Pos);
break;
}
case AscDFH.historyitem_ParaRun_OnEndSplit:
{
Writer.WriteString2(Data.NewRun.Get_Id());
break;
}
case AscDFH.historyitem_ParaRun_MathAlnAt:
{
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
{
Writer.WriteBool( true );
}
break;
}
case AscDFH.historyitem_ParaRun_MathForcedBreak:
{
if(Data.bInsert)
{
Writer.WriteBool( true );
}
else
{
Writer.WriteBool( false );
}
break;
}
}
return Writer;
};
ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_ParaRun != ClassType )
return;
var Type = Reader.GetLong();
var bColorPrChange = false;
switch ( Type )
{
case AscDFH.historyitem_ParaRun_TextPr:
{
// CTextPr
bColorPrChange = Reader.GetBool();
this.Pr = new CTextPr();
this.Pr.Read_FromBinary( Reader );
var unifill = this.Pr.Unifill;
if(typeof AscCommon.CollaborativeEditing !== "undefined")
{
if(unifill && unifill.fill && unifill.fill.type === Asc.c_oAscFill.FILL_TYPE_BLIP && typeof unifill.fill.RasterImageId === "string" && unifill.fill.RasterImageId.length > 0)
{
AscCommon.CollaborativeEditing.Add_NewImage(AscCommon.getFullImageSrc2(unifill.fill.RasterImageId));
}
}
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Bold:
{
// Bool : IsUndefined
// Bool : Bold
bColorPrChange = Reader.GetBool();
if ( true === Reader.GetBool() )
this.Pr.Bold = undefined;
else
this.Pr.Bold = Reader.GetBool();
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Italic:
{
// Bool : IsUndefined
// Bool : Italic
bColorPrChange = Reader.GetBool();
if ( true === Reader.GetBool() )
this.Pr.Italic = undefined;
else
this.Pr.Italic = Reader.GetBool();
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Strikeout:
{
// Bool : IsUndefined
// Bool : Strikeout
bColorPrChange = Reader.GetBool();
if ( true === Reader.GetBool() )
this.Pr.Strikeout = undefined;
else
this.Pr.Strikeout = Reader.GetBool();
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Underline:
{
// Bool : IsUndefined?
// Bool : Underline
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.Underline = Reader.GetBool();
else
this.Pr.Underline = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_FontSize:
{
// Bool : IsUndefined
// Double : FontSize
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.FontSize = Reader.GetDouble();
else
this.Pr.FontSize = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Color:
{
// Bool : IsUndefined
// Variable : Color (CDocumentColor)
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
{
this.Pr.Color = new CDocumentColor(0, 0, 0, false);
this.Pr.Color.Read_FromBinary(Reader);
}
else
this.Pr.Color = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Unifill:
{
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
{
var unifill = new AscFormat.CUniFill();
unifill.Read_FromBinary(Reader);
this.Pr.Unifill = unifill;
if(typeof AscCommon.CollaborativeEditing !== "undefined")
{
if(unifill.fill && unifill.fill.type === Asc.c_oAscFill.FILL_TYPE_BLIP && typeof unifill.fill.RasterImageId === "string" && unifill.fill.RasterImageId.length > 0)
{
AscCommon.CollaborativeEditing.Add_NewImage(AscCommon.getFullImageSrc2(unifill.fill.RasterImageId));
}
}
}
else
this.Pr.Unifill = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_TextFill:
{
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
{
var unifill = new AscFormat.CUniFill();
unifill.Read_FromBinary(Reader);
this.Pr.TextFill = unifill;
}
else
this.Pr.TextFill = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_TextOutline:
{
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
{
var ln = new AscFormat.CLn();
ln.Read_FromBinary(Reader);
this.Pr.TextOutline = ln;
}
else
this.Pr.TextOutline = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_VertAlign:
{
// Bool : IsUndefined
// Long : VertAlign
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.VertAlign = Reader.GetLong();
else
this.Pr.VertAlign = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_HighLight:
{
// Bool : IsUndefined
// Если false
// Bool : IsNull
// Если false
// Variable : Color (CDocumentColor)
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
{
if ( true != Reader.GetBool() )
{
this.Pr.HighLight = new CDocumentColor(0,0,0);
this.Pr.HighLight.Read_FromBinary(Reader);
}
else
this.Pr.HighLight = highlight_None;
}
else
this.Pr.HighLight = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RStyle:
{
// Bool : IsUndefined
// Если false
// String : RStyle
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.RStyle = Reader.GetString2();
else
this.Pr.RStyle = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Spacing:
{
// Bool : IsUndefined
// Если false
// Double : Spacing
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.Spacing = Reader.GetDouble();
else
this.Pr.Spacing = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_DStrikeout:
{
// Bool : IsUndefined
// Если false
// Bool : DStrikeout
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.DStrikeout = Reader.GetBool();
else
this.Pr.DStrikeout = undefined;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Caps:
{
// Bool : IsUndefined
// Если false
// Bool : Caps
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.Caps = Reader.GetBool();
else
this.Pr.Caps = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_SmallCaps:
{
// Bool : IsUndefined
// Если false
// Bool : SmallCaps
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.SmallCaps = Reader.GetBool();
else
this.Pr.SmallCaps = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Position:
{
// Bool : IsUndefined
// Если false
// Double : Position
bColorPrChange = Reader.GetBool();
if ( true != Reader.GetBool() )
this.Pr.Position = Reader.GetDouble();
else
this.Pr.Position = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts:
{
// Bool : undefined ?
// false -> CRFonts
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.RFonts = new CRFonts();
this.Pr.RFonts.Read_FromBinary( Reader );
}
else
this.Pr.RFonts = new CRFonts();
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Ascii:
{
// Bool : undefined ?
// false -> String
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.RFonts.Ascii =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Pr.RFonts.Ascii = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_HAnsi:
{
// Bool : undefined ?
// false -> String
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.RFonts.HAnsi =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Pr.RFonts.HAnsi = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_CS:
{
// Bool : undefined ?
// false -> String
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.RFonts.CS =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Pr.RFonts.CS = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_EastAsia:
{
// Bool : undefined ?
// false -> String
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.RFonts.EastAsia =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Pr.RFonts.EastAsia = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_RFonts_Hint:
{
// Bool : undefined ?
// false -> Long
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
this.Pr.RFonts.Hint = Reader.GetLong();
else
this.Pr.RFonts.Hint = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang:
{
// Bool : undefined ?
// false -> Lang
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.Lang = new CLang();
this.Pr.Lang.Read_FromBinary( Reader );
}
else
this.Pr.Lang = new CLang();
this.Recalc_CompiledPr(true);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_Bidi:
{
// Bool : undefined ?
// false -> Long
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
this.Pr.Lang.Bidi = Reader.GetLong();
else
this.Pr.Lang.Bidi = undefined;
this.Recalc_CompiledPr(true);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_EastAsia:
{
// Bool : undefined ?
// false -> Long
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
this.Pr.Lang.EastAsia = Reader.GetLong();
else
this.Pr.Lang.EastAsia = undefined;
this.Recalc_CompiledPr(true);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_Lang_Val:
{
// Bool : undefined ?
// false -> Long
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
this.Pr.Lang.Val = Reader.GetLong();
else
this.Pr.Lang.Val = undefined;
this.Recalc_CompiledPr(true);
this.protected_UpdateSpellChecking();
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
};
case AscDFH.historyitem_ParaRun_Shd:
{
// Bool : undefined
// false - >
// Variable : CDocumentShd
bColorPrChange = Reader.GetBool();
if ( false === Reader.GetBool() )
{
this.Pr.Shd = new CDocumentShd();
this.Pr.Shd.Read_FromBinary( Reader );
}
else
this.Pr.Shd = undefined;
ParaRun.prototype.Redo = function(Data)
{
var Type = Data.Type;
this.Recalc_CompiledPr(false);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_MathStyle:
switch ( Type )
{
// Bool : undefined ?
// false -> Long
if ( false === Reader.GetBool() )
this.MathPrp.sty = Reader.GetLong();
else
this.MathPrp.sty = undefined;
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
case AscDFH.historyitem_ParaRun_MathPrp:
{
var Flags = Reader.GetLong();
if ( Flags & 1 )
this.MathPrp.aln = Reader.GetBool();
};
ParaRun.prototype.Check_HistoryUninon = function(Data1, Data2)
{
var Type1 = Data1.Type;
var Type2 = Data2.Type;
if ( Flags & 2 )
if ( AscDFH.historyitem_ParaRun_AddItem === Type1 && AscDFH.historyitem_ParaRun_AddItem === Type2 )
{
this.MathPrp.brk = new CMathBreak();
this.MathPrp.brk.Read_FromBinary(Reader);
if ( 1 === Data1.Items.length && 1 === Data2.Items.length && Data1.Pos === Data2.Pos - 1 && para_Text === Data1.Items[0].Type && para_Text === Data2.Items[0].Type )
return true;
}
if ( Flags & 4 )
this.MathPrp.lit = Reader.GetBool();
if ( Flags & 8 )
this.MathPrp.nor = Reader.GetBool();
if ( Flags & 16 )
this.MathPrp.scr = Reader.GetLong();
if ( Flags & 32 )
this.MathPrp.sty = Reader.GetLong();
return false;
};
//-----------------------------------------------------------------------------------
// Функции для совместного редактирования
//-----------------------------------------------------------------------------------
ParaRun.prototype.Save_Changes = function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
this.Recalc_CompiledPr(true);
this.private_UpdateTrackRevisionOnChangeTextPr(false);
break;
}
Writer.WriteLong( AscDFH.historyitem_type_ParaRun );
case AscDFH.historyitem_ParaRun_ReviewType:
{
// Long : ReviewType
// CReviewInfo : ReviewInfo
this.ReviewType = Reader.GetLong();
this.ReviewInfo.Read_FromBinary(Reader);
this.private_UpdateTrackRevisions();
break;
}
var Type = Data.Type;
case AscDFH.historyitem_ParaRun_PrChange:
{
// Bool : is undefined ?
// false -> TextPr
// Bool : is undefined ?
// false -> ReviewInfo
// Пишем тип
Writer.WriteLong( Type );
if (false === Reader.GetBool())
{
this.Pr.PrChange = new CTextPr();
this.Pr.PrChange.Read_FromBinary(Reader);
}
else
switch ( Type )
{
this.Pr.PrChange = undefined;
}
if (false === Reader.GetBool())
{
this.Pr.ReviewInfo = new CReviewInfo();
this.Pr.ReviewInfo.Read_FromBinary(Reader);
}
else
{
this.Pr.ReviewInfo = undefined;
}
this.private_UpdateTrackRevisions();
break;
}
return Writer;
};
case AscDFH.historyitem_ParaRun_ContentReviewInfo:
{
// Bool : is undefined ?
// false -> ReviewInfo
if (false === Reader.GetBool())
{
this.ReviewInfo = new CReviewInfo();
this.ReviewInfo.Read_FromBinary(Reader);
}
break;
}
ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
case AscDFH.historyitem_ParaRun_PrReviewInfo:
{
// Bool : is undefined ?
// false -> ReviewInfo
if (false === Reader.GetBool())
{
this.ReviewInfo = new CReviewInfo();
this.ReviewInfo.Read_FromBinary(Reader);
}
else
{
this.ReviewInfo = undefined;
}
break;
}
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_ParaRun != ClassType )
return;
case AscDFH.historyitem_ParaRun_OnStartSplit:
{
// Long
var Pos = Reader.GetLong();
AscCommon.CollaborativeEditing.OnStart_SplitRun(this, Pos);
break;
}
case AscDFH.historyitem_ParaRun_OnEndSplit:
{
// String2
var RunId = Reader.GetString2();
AscCommon.CollaborativeEditing.OnEnd_SplitRun(g_oTableId.Get_ById(RunId));
break;
}
case AscDFH.historyitem_ParaRun_MathAlnAt:
{
if ( false === Reader.GetBool() )
this.MathPrp.brk.Apply_AlnAt(Reader.GetLong());
else
this.MathPrp.brk.Apply_AlnAt(undefined);
var Type = Reader.GetLong();
break;
}
case AscDFH.historyitem_ParaRun_MathForcedBreak:
{
if ( true === Reader.GetBool() )
{
this.MathPrp.brk = new CMathBreak();
}
else
var bColorPrChange = false;
switch ( Type )
{
this.MathPrp.brk = undefined;
}
break;
}
}
if (bColorPrChange && Color)
......
......@@ -38,44 +38,6 @@
* Time: 12:56
*/
// window['AscDFH'].historyitem_ParaRun_FontFamily = window['AscDFH'].historyitem_type_ParaRun | 7;
// window['AscDFH'].historyitem_ParaRun_FontSize = window['AscDFH'].historyitem_type_ParaRun | 8;
// window['AscDFH'].historyitem_ParaRun_Color = window['AscDFH'].historyitem_type_ParaRun | 9;
// window['AscDFH'].historyitem_ParaRun_VertAlign = window['AscDFH'].historyitem_type_ParaRun | 10;
// window['AscDFH'].historyitem_ParaRun_HighLight = window['AscDFH'].historyitem_type_ParaRun | 11;
// window['AscDFH'].historyitem_ParaRun_RStyle = window['AscDFH'].historyitem_type_ParaRun | 12;
// window['AscDFH'].historyitem_ParaRun_Spacing = window['AscDFH'].historyitem_type_ParaRun | 13;
// window['AscDFH'].historyitem_ParaRun_DStrikeout = window['AscDFH'].historyitem_type_ParaRun | 14;
// window['AscDFH'].historyitem_ParaRun_Caps = window['AscDFH'].historyitem_type_ParaRun | 15;
// window['AscDFH'].historyitem_ParaRun_SmallCaps = window['AscDFH'].historyitem_type_ParaRun | 16;
// window['AscDFH'].historyitem_ParaRun_Position = window['AscDFH'].historyitem_type_ParaRun | 17;
// window['AscDFH'].historyitem_ParaRun_Value = window['AscDFH'].historyitem_type_ParaRun | 18;
// window['AscDFH'].historyitem_ParaRun_RFonts = window['AscDFH'].historyitem_type_ParaRun | 19;
// window['AscDFH'].historyitem_ParaRun_Lang = window['AscDFH'].historyitem_type_ParaRun | 20;
// window['AscDFH'].historyitem_ParaRun_RFonts_Ascii = window['AscDFH'].historyitem_type_ParaRun | 21;
// window['AscDFH'].historyitem_ParaRun_RFonts_HAnsi = window['AscDFH'].historyitem_type_ParaRun | 22;
// window['AscDFH'].historyitem_ParaRun_RFonts_CS = window['AscDFH'].historyitem_type_ParaRun | 23;
// window['AscDFH'].historyitem_ParaRun_RFonts_EastAsia = window['AscDFH'].historyitem_type_ParaRun | 24;
// window['AscDFH'].historyitem_ParaRun_RFonts_Hint = window['AscDFH'].historyitem_type_ParaRun | 25;
// window['AscDFH'].historyitem_ParaRun_Lang_Bidi = window['AscDFH'].historyitem_type_ParaRun | 26;
// window['AscDFH'].historyitem_ParaRun_Lang_EastAsia = window['AscDFH'].historyitem_type_ParaRun | 27;
// window['AscDFH'].historyitem_ParaRun_Lang_Val = window['AscDFH'].historyitem_type_ParaRun | 28;
// window['AscDFH'].historyitem_ParaRun_TextPr = window['AscDFH'].historyitem_type_ParaRun | 29;
// window['AscDFH'].historyitem_ParaRun_Unifill = window['AscDFH'].historyitem_type_ParaRun | 30;
// window['AscDFH'].historyitem_ParaRun_Shd = window['AscDFH'].historyitem_type_ParaRun | 31;
// window['AscDFH'].historyitem_ParaRun_MathStyle = window['AscDFH'].historyitem_type_ParaRun | 32;
// window['AscDFH'].historyitem_ParaRun_MathPrp = window['AscDFH'].historyitem_type_ParaRun | 33;
// window['AscDFH'].historyitem_ParaRun_ReviewType = window['AscDFH'].historyitem_type_ParaRun | 34;
// window['AscDFH'].historyitem_ParaRun_PrChange = window['AscDFH'].historyitem_type_ParaRun | 35;
// window['AscDFH'].historyitem_ParaRun_TextFill = window['AscDFH'].historyitem_type_ParaRun | 36;
// window['AscDFH'].historyitem_ParaRun_TextOutline = window['AscDFH'].historyitem_type_ParaRun | 37;
// window['AscDFH'].historyitem_ParaRun_PrReviewInfo = window['AscDFH'].historyitem_type_ParaRun | 38;
// window['AscDFH'].historyitem_ParaRun_ContentReviewInfo = window['AscDFH'].historyitem_type_ParaRun | 39;
// window['AscDFH'].historyitem_ParaRun_OnStartSplit = window['AscDFH'].historyitem_type_ParaRun | 40;
// window['AscDFH'].historyitem_ParaRun_OnEndSplit = window['AscDFH'].historyitem_type_ParaRun | 41;
// window['AscDFH'].historyitem_ParaRun_MathAlnAt = window['AscDFH'].historyitem_type_ParaRun | 42;
// window['AscDFH'].historyitem_ParaRun_MathForcedBreak = window['AscDFH'].historyitem_type_ParaRun | 43;
/**
* @constructor
* @extends {AscDFH.CChangesBase}
......@@ -338,6 +300,13 @@ CChangesRunBold.prototype.private_SetValue = function(Value)
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunBold.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
......@@ -356,6 +325,13 @@ CChangesRunItalic.prototype.private_SetValue = function(Value)
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunItalic.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
......@@ -371,9 +347,16 @@ CChangesRunStrikeout.prototype.private_SetValue = function(Value)
var oRun = this.Class;
oRun.Pr.Strikeout = Value;
oRun.Recalc_CompiledPr(true);
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunStrikeout.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
......@@ -389,7 +372,1513 @@ CChangesRunUnderline.prototype.private_SetValue = function(Value)
var oRun = this.Class;
oRun.Pr.Underline = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunUnderline.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesRunFontSize(Class, Old, New)
{
CChangesRunFontSize.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(AscDFH.CChangesBaseDoubleProperty, CChangesRunFontSize);
CChangesRunFontSize.Type = AscDFH.historyitem_ParaRun_FontSize;
CChangesRunFontSize.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.FontSize = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunFontSize.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunColor(Class, Old, New)
{
CChangesRunColor.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunColor);
CChangesRunColor.Type = AscDFH.historyitem_ParaRun_Color;
CChangesRunColor.prototype.private_CreateObject = function()
{
return new CDocumentColor(0, 0, 0, false);
};
CChangesRunColor.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Color = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunColor.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesRunVertAlign(Class, Old, New)
{
CChangesRunVertAlign.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(AscDFH.CChangesBaseLongProperty, CChangesRunVertAlign);
CChangesRunVertAlign.Type = AscDFH.historyitem_ParaRun_VertAlign;
CChangesRunVertAlign.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.VertAlign = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunVertAlign.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunHighLight(Class, Old, New, Color)
{
CChangesRunHighLight.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunHighLight);
CChangesRunHighLight.Type = AscDFH.historyitem_ParaRun_HighLight;
CChangesRunHighLight.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is "none" New ?
// 4-bit : Is undefined New ?
// 5-bit : Is "none" New ?
// Variable(?CDocumentColor) : New (если 2 и 3 биты нулевые)
// Variable(?CDocumentColor) : Old (если 4 и 5 биты нулевые)
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
else if (highlight_None === this.New)
nFlags |= 4;
if (undefined === this.Old)
nFlags |= 8;
else if (highlight_None === this.Old)
nFlags |= 16;
Writer.WriteLong(nFlags);
if (undefined !== this.New && highlight_None !== this.New)
this.New.Write_ToBinary(Writer);
if (undefined !== this.Old && highlight_None !== this.Old)
this.Old.Write_ToBinary(Writer);
};
CChangesRunHighLight.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is "none" New ?
// 4-bit : Is undefined New ?
// 5-bit : Is "none" New ?
// Variable(?CDocumentColor) : New (если 2 и 3 биты нулевые)
// Variable(?CDocumentColor) : Old (если 4 и 5 биты нулевые)
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
{
this.New = undefined;
}
else if (nFlags & 4)
{
this.New = highlight_None;
}
else
{
this.New = new CDocumentColor(0, 0, 0);
this.New.Read_FromBinary(Reader);
}
if (nFlags & 8)
{
this.Old = undefined;
}
else if (nFlags & 16)
{
this.Old = highlight_None;
}
else
{
this.Old = new CDocumentColor(0, 0, 0);
this.Old.Read_FromBinary(Reader);
}
};
CChangesRunHighLight.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.HighLight = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunHighLight.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringProperty}
*/
function CChangesRunRStyle(Class, Old, New, Color)
{
CChangesRunRStyle.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseStringProperty, CChangesRunRStyle);
CChangesRunRStyle.Type = AscDFH.historyitem_ParaRun_RStyle;
CChangesRunRStyle.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RStyle = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRStyle.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesRunSpacing(Class, Old, New, Color)
{
CChangesRunSpacing.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseDoubleProperty, CChangesRunSpacing);
CChangesRunSpacing.Type = AscDFH.historyitem_ParaRun_Spacing;
CChangesRunSpacing.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Spacing = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunSpacing.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesRunDStrikeout(Class, Old, New, Color)
{
CChangesRunDStrikeout.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseBoolProperty, CChangesRunDStrikeout);
CChangesRunDStrikeout.Type = AscDFH.historyitem_ParaRun_DStrikeout;
CChangesRunDStrikeout.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.DStrikeout = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunDStrikeout.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesRunCaps(Class, Old, New, Color)
{
CChangesRunCaps.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseBoolProperty, CChangesRunCaps);
CChangesRunCaps.Type = AscDFH.historyitem_ParaRun_Caps;
CChangesRunCaps.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Caps = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunCaps.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesRunSmallCaps(Class, Old, New, Color)
{
CChangesRunSmallCaps.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseBoolProperty, CChangesRunSmallCaps);
CChangesRunSmallCaps.Type = AscDFH.historyitem_ParaRun_SmallCaps;
CChangesRunSmallCaps.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.SmallCaps = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunSmallCaps.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesRunPosition(Class, Old, New, Color)
{
CChangesRunPosition.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseDoubleProperty, CChangesRunPosition);
CChangesRunPosition.Type = AscDFH.historyitem_ParaRun_Position;
CChangesRunPosition.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Position = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunPosition.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunRFonts(Class, Old, New, Color)
{
CChangesRunRFonts.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunRFonts);
CChangesRunRFonts.Type = AscDFH.historyitem_ParaRun_RFonts;
CChangesRunRFonts.prototype.private_CreateObject = function()
{
return new CRFonts();
};
CChangesRunRFonts.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
CChangesRunRFonts.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RFonts = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRFonts.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunLang(Class, Old, New, Color)
{
CChangesRunLang.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunLang);
CChangesRunLang.Type = AscDFH.historyitem_ParaRun_Lang;
CChangesRunLang.prototype.private_CreateObject = function()
{
return new CLang();
};
CChangesRunLang.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
CChangesRunLang.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Lang = Value;
oRun.Recalc_CompiledPr(true);
oRun.protected_UpdateSpellChecking();
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunLang.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunRFontsAscii(Class, Old, New, Color)
{
CChangesRunRFontsAscii.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunRFontsAscii);
CChangesRunRFontsAscii.Type = AscDFH.historyitem_ParaRun_RFonts_Ascii;
CChangesRunRFontsAscii.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteString2(this.New.Name);
if (undefined !== this.Old)
Writer.WriteString2(this.Old.Name);
};
CChangesRunRFontsAscii.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
{
this.New = undefined;
}
else
{
this.New = {
Name : Reader.GetString2(),
Index : -1
};
}
if (nFlags & 4)
{
this.Old = undefined;
}
else
{
this.Old = {
Name : Reader.GetString2(),
Index : -1
};
}
};
CChangesRunRFontsAscii.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RFonts.Ascii = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRFontsAscii.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunRFontsHAnsi(Class, Old, New, Color)
{
CChangesRunRFontsHAnsi.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunRFontsHAnsi);
CChangesRunRFontsHAnsi.Type = AscDFH.historyitem_ParaRun_RFonts_HAnsi;
CChangesRunRFontsHAnsi.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteString2(this.New.Name);
if (undefined !== this.Old)
Writer.WriteString2(this.Old.Name);
};
CChangesRunRFontsHAnsi.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
{
this.New = undefined;
}
else
{
this.New = {
Name : Reader.GetString2(),
Index : -1
};
}
if (nFlags & 4)
{
this.Old = undefined;
}
else
{
this.Old = {
Name : Reader.GetString2(),
Index : -1
};
}
};
CChangesRunRFontsHAnsi.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RFonts.HAnsi = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRFontsHAnsi.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunRFontsCS(Class, Old, New, Color)
{
CChangesRunRFontsCS.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunRFontsCS);
CChangesRunRFontsCS.Type = AscDFH.historyitem_ParaRun_RFonts_CS;
CChangesRunRFontsCS.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteString2(this.New.Name);
if (undefined !== this.Old)
Writer.WriteString2(this.Old.Name);
};
CChangesRunRFontsCS.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
{
this.New = undefined;
}
else
{
this.New = {
Name : Reader.GetString2(),
Index : -1
};
}
if (nFlags & 4)
{
this.Old = undefined;
}
else
{
this.Old = {
Name : Reader.GetString2(),
Index : -1
};
}
};
CChangesRunRFontsCS.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RFonts.CS = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRFontsCS.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunRFontsEastAsia(Class, Old, New, Color)
{
CChangesRunRFontsEastAsia.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunRFontsEastAsia);
CChangesRunRFontsEastAsia.Type = AscDFH.historyitem_ParaRun_RFonts_EastAsia;
CChangesRunRFontsEastAsia.prototype.WriteToBinary = function(Writer)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = 0;
if (false !== this.Color)
nFlags |= 1;
if (undefined === this.New)
nFlags |= 2;
if (undefined === this.Old)
nFlags |= 4;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteString2(this.New.Name);
if (undefined !== this.Old)
Writer.WriteString2(this.Old.Name);
};
CChangesRunRFontsEastAsia.prototype.ReadFromBinary = function(Reader)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : Is undefined New ?
// 3-bit : Is undefined Old ?
// String : New
// String : Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.Color = true;
else
this.Color = false;
if (nFlags & 2)
{
this.New = undefined;
}
else
{
this.New = {
Name : Reader.GetString2(),
Index : -1
};
}
if (nFlags & 4)
{
this.Old = undefined;
}
else
{
this.Old = {
Name : Reader.GetString2(),
Index : -1
};
}
};
CChangesRunRFontsEastAsia.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RFonts.EastAsia = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRFontsEastAsia.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesRunRFontsHint(Class, Old, New, Color)
{
CChangesRunRFontsHint.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseLongProperty, CChangesRunRFontsHint);
CChangesRunRFontsHint.Type = AscDFH.historyitem_ParaRun_RFonts_Hint;
CChangesRunRFontsHint.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.RFonts.Hint = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunRFontsHint.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesRunLangBidi(Class, Old, New, Color)
{
CChangesRunLangBidi.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseLongProperty, CChangesRunLangBidi);
CChangesRunLangBidi.Type = AscDFH.historyitem_ParaRun_Lang_Bidi;
CChangesRunLangBidi.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Lang.Bidi = Value;
oRun.Recalc_CompiledPr(true);
oRun.protected_UpdateSpellChecking();
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunLangBidi.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesRunLangEastAsia(Class, Old, New, Color)
{
CChangesRunLangEastAsia.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseLongProperty, CChangesRunLangEastAsia);
CChangesRunLangEastAsia.Type = AscDFH.historyitem_ParaRun_Lang_EastAsia;
CChangesRunLangEastAsia.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Lang.EastAsia = Value;
oRun.Recalc_CompiledPr(true);
oRun.protected_UpdateSpellChecking();
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunLangEastAsia.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesRunLangVal(Class, Old, New, Color)
{
CChangesRunLangVal.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseLongProperty, CChangesRunLangVal);
CChangesRunLangVal.Type = AscDFH.historyitem_ParaRun_Lang_Val;
CChangesRunLangVal.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Lang.Val = Value;
oRun.Recalc_CompiledPr(true);
oRun.protected_UpdateSpellChecking();
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunLangVal.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunTextPr(Class, Old, New, Color)
{
CChangesRunTextPr.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunTextPr);
CChangesRunTextPr.Type = AscDFH.historyitem_ParaRun_TextPr;
CChangesRunTextPr.prototype.private_CreateObject = function()
{
return new CTextPr();
};
CChangesRunTextPr.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
CChangesRunTextPr.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunTextPr.prototype.Load = function(Color)
{
this.Redo();
var Unifill = this.Class.Pr.Unifill;
if (AscCommon.CollaborativeEditing
&& Unifill
&& Unifill.fill
&& Unifill.fill.type === Asc.c_oAscFill.FILL_TYPE_BLIP
&& typeof Unifill.fill.RasterImageId === "string"
&& Unifill.fill.RasterImageId.length > 0)
{
AscCommon.CollaborativeEditing.Add_NewImage(AscCommon.getFullImageSrc2(Unifill.fill.RasterImageId));
}
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunUnifill(Class, Old, New, Color)
{
CChangesRunUnifill.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunUnifill);
CChangesRunUnifill.Type = AscDFH.historyitem_ParaRun_Unifill;
CChangesRunUnifill.prototype.private_CreateObject = function()
{
return new AscFormat.CUniFill();
};
CChangesRunUnifill.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Unifill = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunUnifill.prototype.Load = function(Color)
{
this.Redo();
var Unifill = this.Class.Pr.Unifill;
if (AscCommon.CollaborativeEditing
&& Unifill
&& Unifill.fill
&& Unifill.fill.type === Asc.c_oAscFill.FILL_TYPE_BLIP
&& typeof Unifill.fill.RasterImageId === "string"
&& Unifill.fill.RasterImageId.length > 0)
{
AscCommon.CollaborativeEditing.Add_NewImage(AscCommon.getFullImageSrc2(Unifill.fill.RasterImageId));
}
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunShd(Class, Old, New, Color)
{
CChangesRunShd.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunShd);
CChangesRunShd.Type = AscDFH.historyitem_ParaRun_Shd;
CChangesRunShd.prototype.private_CreateObject = function()
{
return new CDocumentShd();
};
CChangesRunShd.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.Shd = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunShd.prototype.Load = function(Color)
{
this.Redo();
var Unifill = this.Class.Pr.Unifill;
if (AscCommon.CollaborativeEditing
&& Unifill
&& Unifill.fill
&& Unifill.fill.type === Asc.c_oAscFill.FILL_TYPE_BLIP
&& typeof Unifill.fill.RasterImageId === "string"
&& Unifill.fill.RasterImageId.length > 0)
{
AscCommon.CollaborativeEditing.Add_NewImage(AscCommon.getFullImageSrc2(Unifill.fill.RasterImageId));
}
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesRunMathStyle(Class, Old, New)
{
CChangesRunMathStyle.superclass.constructor.call(this, Class, Old, New);
}
AscCommon.extendClass(AscDFH.CChangesBaseLongProperty, CChangesRunMathStyle);
CChangesRunMathStyle.Type = AscDFH.historyitem_ParaRun_MathStyle;
CChangesRunMathStyle.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.MathPrp.sty = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunMathPrp(Class, Old, New, Color)
{
CChangesRunMathPrp.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunMathPrp);
CChangesRunMathPrp.Type = AscDFH.historyitem_ParaRun_MathPrp;
CChangesRunMathPrp.prototype.private_CreateObject = function()
{
return new CMPrp();
};
CChangesRunMathPrp.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
CChangesRunMathPrp.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.MathPrp = Value;
oRun.Recalc_CompiledPr(true);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunReviewType(Class, Old, New, Color)
{
CChangesRunMathPrp.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunReviewType);
CChangesRunReviewType.Type = AscDFH.historyitem_ParaRun_ReviewType;
CChangesRunReviewType.prototype.WriteToBinary = function(Writer)
{
// Long : New ReviewType
// CReviewInfo : New ReviewInfo
// Long : Old ReviewType
// CReviewInfo : Old ReviewInfo
Writer.WriteLong(this.New.ReviewType);
this.New.ReviewInfo.Write_ToBinary(Writer);
Writer.WriteLong(this.Old.ReviewType);
this.Old.ReviewInfo.Write_ToBinary(Writer);
};
CChangesRunReviewType.prototype.ReadFromBinary = function(Reader)
{
// Long : New ReviewType
// CReviewInfo : New ReviewInfo
// Long : Old ReviewType
// CReviewInfo : Old ReviewInfo
this.New = {
ReviewType : reviewtype_Common,
ReviewInfo : new CReviewInfo()
};
this.Old = {
ReviewType : reviewtype_Common,
ReviewInfo : new CReviewInfo()
};
this.New.ReviewType = Reader.GetLong();
this.New.ReviewInfo.Read_FromBinary(Reader);
this.Old.ReviewType = Reader.GetLong();
this.Old.ReviewInfo.Read_FromBinary(Reader);
};
CChangesRunReviewType.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.ReviewType = Value.ReviewType;
oRun.ReviewInfo = Value.ReviewInfo;
oRun.private_UpdateTrackRevisions();
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesRunPrChange(Class, Old, New, Color)
{
CChangesRunPrChange.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseProperty, CChangesRunPrChange);
CChangesRunPrChange.Type = AscDFH.historyitem_ParaRun_PrChange;
CChangesRunPrChange.prototype.WriteToBinary = function(Writer)
{
// Long : Flags
// 1-bit : is New.PrChange undefined ?
// 2-bit : is New.ReviewInfo undefined ?
// 3-bit : is Old.PrChange undefined ?
// 4-bit : is Old.ReviewInfo undefined ?
// Variable(CTextPr) : New.PrChange (1bit = 0)
// Variable(CReviewInfo) : New.ReviewInfo (2bit = 0)
// Variable(CTextPr) : Old.PrChange (3bit = 0)
// Variable(CReviewInfo) : Old.ReviewInfo (4bit = 0)
var nFlags = 0;
if (undefined === this.New.PrChange)
nFlags |= 1;
if (undefined === this.New.ReviewInfo)
nFlags |= 2;
if (undefined === this.Old.PrChange)
nFlags |= 4;
if (undefined === this.Old.ReviewInfo)
nFlags |= 8;
Writer.WriteLong(nFlags);
if (undefined !== this.New.PrChange)
this.New.PrChange.Write_ToBinary(Writer);
if (undefined !== this.New.ReviewInfo)
this.New.ReviewInfo.Write_ToBinary(Writer);
if (undefined !== this.Old.PrChange)
this.Old.PrChange.Write_ToBinary(Writer);
if (undefined !== this.Old.ReviewInfo)
this.Old.ReviewInfo.Write_ToBinary(Writer);
};
CChangesRunPrChange.prototype.ReadFromBinary = function(Reader)
{
// Long : Flags
// 1-bit : is New.PrChange undefined ?
// 2-bit : is New.ReviewInfo undefined ?
// 3-bit : is Old.PrChange undefined ?
// 4-bit : is Old.ReviewInfo undefined ?
// Variable(CTextPr) : New.PrChange (1bit = 0)
// Variable(CReviewInfo) : New.ReviewInfo (2bit = 0)
// Variable(CTextPr) : Old.PrChange (3bit = 0)
// Variable(CReviewInfo) : Old.ReviewInfo (4bit = 0)
var nFlags = Reader.GetLong();
if (nFlags & 1)
{
this.New.PrChange = undefined;
}
else
{
this.New.PrChange = new CTextPr();
this.New.PrChange.Read_FromBinary(Reader);
}
if (nFlags & 2)
{
this.New.ReviewInfo = undefined;
}
else
{
this.New.ReviewInfo = new CReviewInfo();
this.New.ReviewInfo.Read_FromBinary(Reader);
}
if (nFlags & 4)
{
this.Old.PrChange = undefined;
}
else
{
this.Old.PrChange = new CTextPr();
this.Old.PrChange.Read_FromBinary(Reader);
}
if (nFlags & 8)
{
this.Old.ReviewInfo = undefined;
}
else
{
this.Old.ReviewInfo = new CReviewInfo();
this.Old.ReviewInfo.Read_FromBinary(Reader);
}
};
CChangesRunPrChange.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.PrChange = Value.PrChange;
oRun.Pr.ReviewInfo = Value.ReviewInfo;
oRun.private_UpdateTrackRevisions();
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunTextFill(Class, Old, New, Color)
{
CChangesRunTextFill.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunTextFill);
CChangesRunTextFill.Type = AscDFH.historyitem_ParaRun_TextFill;
CChangesRunTextFill.prototype.private_CreateObject = function()
{
return new AscFormat.CUniFill();
};
CChangesRunTextFill.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.TextFill = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunTextFill.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunTextOutline(Class, Old, New, Color)
{
CChangesRunTextOutline.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunTextOutline);
CChangesRunTextOutline.Type = AscDFH.historyitem_ParaRun_TextOutline;
CChangesRunTextOutline.prototype.private_CreateObject = function()
{
return new AscFormat.CLn();
};
CChangesRunTextOutline.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.TextOutline = Value;
oRun.Recalc_CompiledPr(false);
oRun.private_UpdateTrackRevisionOnChangeTextPr(false);
};
CChangesRunTextOutline.prototype.Load = function(Color)
{
this.Redo();
if (this.Color && Color)
this.Class.private_AddCollPrChangeOther(Color);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunPrReviewInfo(Class, Old, New, Color)
{
CChangesRunPrReviewInfo.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunPrReviewInfo);
CChangesRunPrReviewInfo.Type = AscDFH.historyitem_ParaRun_PrReviewInfo;
CChangesRunPrReviewInfo.prototype.private_CreateObject = function()
{
return new CReviewInfo();
};
CChangesRunPrReviewInfo.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.Pr.ReviewInfo = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesRunContentReviewInfo(Class, Old, New, Color)
{
CChangesRunContentReviewInfo.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(AscDFH.CChangesBaseObjectProperty, CChangesRunContentReviewInfo);
CChangesRunContentReviewInfo.Type = AscDFH.historyitem_ParaRun_ContentReviewInfo;
CChangesRunContentReviewInfo.prototype.private_CreateObject = function()
{
return new CReviewInfo();
};
CChangesRunContentReviewInfo.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
CChangesRunContentReviewInfo.prototype.private_SetValue = function(Value)
{
var oRun = this.Class;
oRun.ReviewInfo = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesRunOnStartSplit(Class, Pos)
{
CChangesRunOnStartSplit.superclass.constructor.call(this, Class);
this.Pos = Pos;
}
AscCommon.extendClass(AscDFH.CChangesBase, CChangesRunOnStartSplit);
CChangesRunOnStartSplit.prototype.Type = AscDFH.historyitem_ParaRun_OnStartSplit;
CChangesRunOnStartSplit.prototype.Undo = function()
{
};
CChangesRunOnStartSplit.prototype.Redo = function()
{
};
CChangesRunOnStartSplit.prototype.WriteToBinary = function(Writer)
{
Writer.WriteLong(this.Pos);
};
CChangesRunOnStartSplit.prototype.ReadFromBinary = function(Reader)
{
this.Pos = Reader.GetLong();
};
CChangesRunOnStartSplit.prototype.Load = function()
{
if (AscCommon.CollaborativeEditing)
AscCommon.CollaborativeEditing.OnStart_SplitRun(this.Class, this.Pos);
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesRunOnEndSplit(Class, NewRun)
{
CChangesRunOnEndSplit.superclass.constructor.call(this, Class);
this.NewRun = NewRun;
}
AscCommon.extendClass(AscDFH.CChangesBase, CChangesRunOnEndSplit);
CChangesRunOnEndSplit.prototype.Type = AscDFH.historyitem_ParaRun_OnEndSplit;
CChangesRunOnEndSplit.prototype.Undo = function()
{
};
CChangesRunOnEndSplit.prototype.Redo = function()
{
};
CChangesRunOnEndSplit.prototype.WriteToBinary = function(Writer)
{
Writer.WriteString2(this.NewRun.Get_Id());
};
CChangesRunOnEndSplit.prototype.ReadFromBinary = function(Reader)
{
var RunId = Reader.GetString2();
this.NewRun = g_oTableId.Get_ById(RunId);
};
CChangesRunOnEndSplit.prototype.Load = function()
{
if (AscCommon.CollaborativeEditing)
AscCommon.CollaborativeEditing.OnEnd_SplitRun(this.NewRun);
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesRunMathAlnAt(Class, Old, New)
{
CChangesRunMathAlnAt.superclass.constructor.call(this, Class);
this.Old = Old;
this.New = New;
}
AscCommon.extendClass(AscDFH.CChangesBase, CChangesRunMathAlnAt);
CChangesRunMathAlnAt.prototype.Type = AscDFH.historyitem_ParaRun_MathAlnAt;
CChangesRunMathAlnAt.prototype.Undo = function()
{
this.Class.MathPrp.Apply_AlnAt(this.Old);
};
CChangesRunMathAlnAt.prototype.Redo = function()
{
this.Class.MathPrp.Apply_AlnAt(this.Old);
};
CChangesRunMathAlnAt.prototype.WriteToBinary = function(Writer)
{
// Long : Flags
// 1-bit : New is undefined ?
// 2-bit : Old is undefined ?
// 1bit = 0 long : this.New
// 2bit = 0 long : this.Old
var nFlags = 0;
if (undefined === this.New)
nFlags |= 1;
if (undefined === this.Old)
nFlags |= 2;
Writer.WriteLong(nFlags);
if (undefined !== this.New)
Writer.WriteLong(this.New);
if (undefined !== this.Old)
Writer.WriteLong(this.Old);
};
CChangesRunMathAlnAt.prototype.ReadFromBinary = function(Reader)
{
// Long : Flags
// 1-bit : New is undefined ?
// 2-bit : Old is undefined ?
// 1bit = 0 long : this.New
// 2bit = 0 long : this.Old
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.New = undefined;
else
this.New = Reader.GetLong();
if (nFlags & 2)
this.Old = undefined;
else
this.Old = Reader.GetLong();
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function CChangesRunMathForcedBreak(Class, bInsert, alnAt)
{
CChangesRunMathForcedBreak.superclass.constructor.call(this, Class);
this.bInsert = bInsert;
this.alnAt = alnAt;
}
AscCommon.extendClass(AscDFH.CChangesBase, CChangesRunMathForcedBreak);
CChangesRunMathForcedBreak.prototype.Type = AscDFH.historyitem_ParaRun_MathForcedBreak;
CChangesRunMathForcedBreak.prototype.Undo = function()
{
var oRun = this.Class;
if(this.bInsert)
oRun.MathPrp.Delete_ForcedBreak();
else
oRun.MathPrp.Insert_ForcedBreak(this.alnAt);
};
CChangesRunMathForcedBreak.prototype.Redo = function()
{
var oRun = this.Class;
if(this.bInsert)
oRun.MathPrp.Insert_ForcedBreak(this.alnAt);
else
oRun.MathPrp.Delete_ForcedBreak();
};
CChangesRunMathForcedBreak.prototype.WriteToBinary = function(Writer)
{
// Long : Flags
// 1-bit : bInsert ?
// 2-bit : alnAt is undefined ?
// 2bit = 0 long : this.alnAt
var nFlags = 0;
if (true === this.bInsert)
nFlags |= 1;
if (undefined === this.alnAt)
nFlags |= 2;
Writer.WriteLong(nFlags);
if (undefined !== this.alnAt)
Writer.WriteLong(this.alnAt);
};
CChangesRunMathForcedBreak.prototype.ReadFromBinary = function(Reader)
{
// Long : Flags
// 1-bit : bInsert ?
// 2-bit : alnAt is undefined ?
// 2bit = 0 long : this.alnAt
var nFlags = Reader.GetLong();
if (nFlags & 1)
this.bInsert = true;
else
this.bInsert = false;
if (nFlags & 2)
this.alnAt = undefined;
else
this.alnAt = Reader.GetLong();
};
......@@ -1110,6 +1110,73 @@ CMPrp.prototype =
this.brk = undefined;
}
};
CMPrp.prototype.Write_ToBinary = function(Writer)
{
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
var Flags = 0;
if (undefined != this.aln)
{
Writer.WriteBool(this.aln);
Flags |= 1;
}
if (undefined != this.brk)
{
this.brk.Write_ToBinary(Writer);
Flags |= 2;
}
if (undefined != this.lit)
{
Writer.WriteBool(this.lit);
Flags |= 4;
}
if (undefined != this.nor)
{
Writer.WriteBool(this.nor);
Flags |= 8;
}
if (undefined != this.scr)
{
Writer.WriteLong(this.scr);
Flags |= 16;
}
if (undefined != this.sty)
{
Writer.WriteLong(this.sty);
Flags |= 32;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek(StartPos);
Writer.WriteLong(Flags);
Writer.Seek(EndPos);
};
CMPrp.prototype.Read_FromBinary = function(Reader)
{
var Flags = Reader.GetLong();
if (Flags & 1)
this.aln = Reader.GetBool();
if (Flags & 2)
{
this.brk = new CMathBreak();
this.brk.Read_FromBinary(Reader);
}
if (Flags & 4)
this.lit = Reader.GetBool();
if (Flags & 8)
this.nor = Reader.GetBool();
if (Flags & 16)
this.scr = Reader.GetLong();
if (Flags & 32)
this.sty = Reader.GetLong();
};
/**
*
......
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