Commit 82f4ba27 authored by Ilya Kirillov's avatar Ilya Kirillov

Class ParaTextPr was moved in a separate file. All changes for class...

Class ParaTextPr was moved in a separate file. All changes for class ParaTextPr were replaced with new classes.
parent 604c4834
...@@ -84,12 +84,15 @@ ...@@ -84,12 +84,15 @@
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/Sections.js", "../word/Editor/Sections.js",
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
......
...@@ -133,12 +133,15 @@ ...@@ -133,12 +133,15 @@
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/Sections.js", "../word/Editor/Sections.js",
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
......
...@@ -125,6 +125,8 @@ ...@@ -125,6 +125,8 @@
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
...@@ -144,6 +146,7 @@ ...@@ -144,6 +146,7 @@
"../word/Math/borderBox.js", "../word/Math/borderBox.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/DocumentContentBase.js", "../word/Editor/DocumentContentBase.js",
"../word/Editor/Document.js", "../word/Editor/Document.js",
......
...@@ -106,12 +106,15 @@ ...@@ -106,12 +106,15 @@
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Hyperlink.js", "../word/Editor/Hyperlink.js",
"../word/Editor/Field.js", "../word/Editor/Field.js",
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/Sections.js", "../word/Editor/Sections.js",
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
......
...@@ -1291,37 +1291,35 @@ ...@@ -1291,37 +1291,35 @@
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе ParaTextPr // Типы изменений в классе ParaTextPr
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
window['AscDFH'].historyitem_TextPr_Change = window['AscDFH'].historyitem_type_TextPr | 1; window['AscDFH'].historyitem_TextPr_Bold = window['AscDFH'].historyitem_type_TextPr | 1;
window['AscDFH'].historyitem_TextPr_Bold = window['AscDFH'].historyitem_type_TextPr | 2; window['AscDFH'].historyitem_TextPr_Italic = window['AscDFH'].historyitem_type_TextPr | 2;
window['AscDFH'].historyitem_TextPr_Italic = window['AscDFH'].historyitem_type_TextPr | 3; window['AscDFH'].historyitem_TextPr_Strikeout = window['AscDFH'].historyitem_type_TextPr | 3;
window['AscDFH'].historyitem_TextPr_Strikeout = window['AscDFH'].historyitem_type_TextPr | 4; window['AscDFH'].historyitem_TextPr_Underline = window['AscDFH'].historyitem_type_TextPr | 4;
window['AscDFH'].historyitem_TextPr_Underline = window['AscDFH'].historyitem_type_TextPr | 5; window['AscDFH'].historyitem_TextPr_FontSize = window['AscDFH'].historyitem_type_TextPr | 5;
window['AscDFH'].historyitem_TextPr_FontFamily = window['AscDFH'].historyitem_type_TextPr | 6; window['AscDFH'].historyitem_TextPr_Color = window['AscDFH'].historyitem_type_TextPr | 6;
window['AscDFH'].historyitem_TextPr_FontSize = window['AscDFH'].historyitem_type_TextPr | 7; window['AscDFH'].historyitem_TextPr_VertAlign = window['AscDFH'].historyitem_type_TextPr | 7;
window['AscDFH'].historyitem_TextPr_Color = window['AscDFH'].historyitem_type_TextPr | 8; window['AscDFH'].historyitem_TextPr_HighLight = window['AscDFH'].historyitem_type_TextPr | 8;
window['AscDFH'].historyitem_TextPr_VertAlign = window['AscDFH'].historyitem_type_TextPr | 9; window['AscDFH'].historyitem_TextPr_RStyle = window['AscDFH'].historyitem_type_TextPr | 9;
window['AscDFH'].historyitem_TextPr_HighLight = window['AscDFH'].historyitem_type_TextPr | 10; window['AscDFH'].historyitem_TextPr_Spacing = window['AscDFH'].historyitem_type_TextPr | 10;
window['AscDFH'].historyitem_TextPr_RStyle = window['AscDFH'].historyitem_type_TextPr | 11; window['AscDFH'].historyitem_TextPr_DStrikeout = window['AscDFH'].historyitem_type_TextPr | 11;
window['AscDFH'].historyitem_TextPr_Spacing = window['AscDFH'].historyitem_type_TextPr | 12; window['AscDFH'].historyitem_TextPr_Caps = window['AscDFH'].historyitem_type_TextPr | 12;
window['AscDFH'].historyitem_TextPr_DStrikeout = window['AscDFH'].historyitem_type_TextPr | 13; window['AscDFH'].historyitem_TextPr_SmallCaps = window['AscDFH'].historyitem_type_TextPr | 13;
window['AscDFH'].historyitem_TextPr_Caps = window['AscDFH'].historyitem_type_TextPr | 14; window['AscDFH'].historyitem_TextPr_Position = window['AscDFH'].historyitem_type_TextPr | 14;
window['AscDFH'].historyitem_TextPr_SmallCaps = window['AscDFH'].historyitem_type_TextPr | 15; window['AscDFH'].historyitem_TextPr_Value = window['AscDFH'].historyitem_type_TextPr | 15;
window['AscDFH'].historyitem_TextPr_Position = window['AscDFH'].historyitem_type_TextPr | 16; window['AscDFH'].historyitem_TextPr_RFonts = window['AscDFH'].historyitem_type_TextPr | 16;
window['AscDFH'].historyitem_TextPr_Value = window['AscDFH'].historyitem_type_TextPr | 17; window['AscDFH'].historyitem_TextPr_RFonts_Ascii = window['AscDFH'].historyitem_type_TextPr | 17;
window['AscDFH'].historyitem_TextPr_RFonts = window['AscDFH'].historyitem_type_TextPr | 18; window['AscDFH'].historyitem_TextPr_RFonts_HAnsi = window['AscDFH'].historyitem_type_TextPr | 18;
window['AscDFH'].historyitem_TextPr_Lang = window['AscDFH'].historyitem_type_TextPr | 19; window['AscDFH'].historyitem_TextPr_RFonts_CS = window['AscDFH'].historyitem_type_TextPr | 19;
window['AscDFH'].historyitem_TextPr_RFonts_Ascii = window['AscDFH'].historyitem_type_TextPr | 20; window['AscDFH'].historyitem_TextPr_RFonts_EastAsia = window['AscDFH'].historyitem_type_TextPr | 20;
window['AscDFH'].historyitem_TextPr_RFonts_HAnsi = window['AscDFH'].historyitem_type_TextPr | 21; window['AscDFH'].historyitem_TextPr_RFonts_Hint = window['AscDFH'].historyitem_type_TextPr | 21;
window['AscDFH'].historyitem_TextPr_RFonts_CS = window['AscDFH'].historyitem_type_TextPr | 22; window['AscDFH'].historyitem_TextPr_Lang = window['AscDFH'].historyitem_type_TextPr | 22;
window['AscDFH'].historyitem_TextPr_RFonts_EastAsia = window['AscDFH'].historyitem_type_TextPr | 23; window['AscDFH'].historyitem_TextPr_Lang_Bidi = window['AscDFH'].historyitem_type_TextPr | 23;
window['AscDFH'].historyitem_TextPr_RFonts_Hint = window['AscDFH'].historyitem_type_TextPr | 24; window['AscDFH'].historyitem_TextPr_Lang_EastAsia = window['AscDFH'].historyitem_type_TextPr | 24;
window['AscDFH'].historyitem_TextPr_Lang_Bidi = window['AscDFH'].historyitem_type_TextPr | 25; window['AscDFH'].historyitem_TextPr_Lang_Val = window['AscDFH'].historyitem_type_TextPr | 25;
window['AscDFH'].historyitem_TextPr_Lang_EastAsia = window['AscDFH'].historyitem_type_TextPr | 26; window['AscDFH'].historyitem_TextPr_Unifill = window['AscDFH'].historyitem_type_TextPr | 26;
window['AscDFH'].historyitem_TextPr_Lang_Val = window['AscDFH'].historyitem_type_TextPr | 27; window['AscDFH'].historyitem_TextPr_FontSizeCS = window['AscDFH'].historyitem_type_TextPr | 27;
window['AscDFH'].historyitem_TextPr_Unifill = window['AscDFH'].historyitem_type_TextPr | 28; window['AscDFH'].historyitem_TextPr_Outline = window['AscDFH'].historyitem_type_TextPr | 28;
window['AscDFH'].historyitem_TextPr_FontSizeCS = window['AscDFH'].historyitem_type_TextPr | 29; window['AscDFH'].historyitem_TextPr_Fill = window['AscDFH'].historyitem_type_TextPr | 29;
window['AscDFH'].historyitem_TextPr_Outline = window['AscDFH'].historyitem_type_TextPr | 30;
window['AscDFH'].historyitem_TextPr_Fill = window['AscDFH'].historyitem_type_TextPr | 31;
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе ParaDrawing // Типы изменений в классе ParaDrawing
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
......
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
"use strict";
/**
* User: Ilja.Kirillov
* Date: 02.11.2016
* Time: 16:36
*/
/**
* Класс представляющий собой настройки текста (сейчас используется как настройка текста для конца параграфа)
* @constructor
* @extends {CRunElementBase}
*/
function ParaTextPr(Props)
{
ParaTextPr.superclass.constructor.call(this);
this.Id = AscCommon.g_oIdCounter.Get_NewId();
this.Type = para_TextPr;
this.Value = new CTextPr();
this.Parent = null;
this.CalcValue = this.Value;
this.Width = 0;
this.Height = 0;
this.WidthVisible = 0;
if ("object" == typeof(Props))
{
this.Value.Set_FromObject(Props);
}
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add(this, this.Id);
}
AscCommon.extendClass(ParaTextPr, CRunElementBase);
ParaTextPr.prototype.Type = para_TextPr;
ParaTextPr.prototype.Get_Type = function()
{
return this.Type;
};
ParaTextPr.prototype.Copy = function()
{
var ParaTextPr_new = new ParaTextPr();
ParaTextPr_new.Set_Value(this.Value);
return ParaTextPr_new;
};
ParaTextPr.prototype.Is_RealContent = function()
{
return true;
};
ParaTextPr.prototype.Can_AddNumbering = function()
{
return false;
};
ParaTextPr.prototype.Set_Id = function(newId)
{
g_oTableId.Reset_Id(this, newId, this.Id);
this.Id = newId;
};
ParaTextPr.prototype.Get_Id = function()
{
return this.Id;
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для изменения свойств
//----------------------------------------------------------------------------------------------------------------------
ParaTextPr.prototype.Apply_TextPr = function(TextPr)
{
if (undefined != TextPr.Bold)
this.Set_Bold(TextPr.Bold);
if (undefined != TextPr.Italic)
this.Set_Italic(TextPr.Italic);
if (undefined != TextPr.Strikeout)
this.Set_Strikeout(TextPr.Strikeout);
if (undefined != TextPr.Underline)
this.Set_Underline(TextPr.Underline);
if (undefined != TextPr.FontSize)
this.Set_FontSize(TextPr.FontSize);
if (undefined != TextPr.FontSizeCS)
this.Set_FontSizeCS(TextPr.FontSizeCS);
if (undefined != TextPr.Color)
{
this.Set_Color(TextPr.Color);
if (undefined != this.Value.Unifill)
{
this.Set_Unifill(undefined);
}
if (undefined != this.Value.TextFill)
{
this.Set_TextFill(undefined);
}
}
if (undefined != TextPr.VertAlign)
this.Set_VertAlign(TextPr.VertAlign);
if (undefined != TextPr.HighLight)
this.Set_HighLight(TextPr.HighLight);
if (undefined != TextPr.RStyle)
this.Set_RStyle(TextPr.RStyle);
if (undefined != TextPr.Spacing)
this.Set_Spacing(TextPr.Spacing);
if (undefined != TextPr.DStrikeout)
this.Set_DStrikeout(TextPr.DStrikeout);
if (undefined != TextPr.Caps)
this.Set_Caps(TextPr.Caps);
if (undefined != TextPr.SmallCaps)
this.Set_SmallCaps(TextPr.SmallCaps);
if (undefined != TextPr.Position)
this.Set_Position(TextPr.Position);
if (undefined != TextPr.RFonts)
this.Set_RFonts2(TextPr.RFonts);
if (undefined != TextPr.Lang)
this.Set_Lang(TextPr.Lang);
if (undefined != TextPr.Unifill)
{
this.Set_Unifill(TextPr.Unifill.createDuplicate());
if (undefined != this.Value.Color)
{
this.Set_Color(undefined);
}
if (undefined != this.Value.TextFill)
{
this.Set_TextFill(undefined);
}
}
if (undefined != TextPr.TextOutline)
{
this.Set_TextOutline(TextPr.TextOutline);
}
if (undefined != TextPr.TextFill)
{
this.Set_TextFill(TextPr.TextFill);
if (undefined != this.Value.Color)
{
this.Set_Color(undefined);
}
if (undefined != this.Value.Unifill)
{
this.Set_Unifill(undefined);
}
}
};
ParaTextPr.prototype.Clear_Style = function()
{
// Пока удаляем все кроме настроек языка
if (undefined != this.Value.Bold)
this.Set_Bold(undefined);
if (undefined != this.Value.Italic)
this.Set_Italic(undefined);
if (undefined != this.Value.Strikeout)
this.Set_Strikeout(undefined);
if (undefined != this.Value.Underline)
this.Set_Underline(undefined);
if (undefined != this.Value.FontSize)
this.Set_FontSize(undefined);
if (undefined != this.Value.Color)
this.Set_Color(undefined);
if (undefined != this.Value.Unifill)
this.Set_Unifill(undefined);
if (undefined != this.Value.VertAlign)
this.Set_VertAlign(undefined);
if (undefined != this.Value.HighLight)
this.Set_HighLight(undefined);
if (undefined != this.Value.RStyle)
this.Set_RStyle(undefined);
if (undefined != this.Value.Spacing)
this.Set_Spacing(undefined);
if (undefined != this.Value.DStrikeout)
this.Set_DStrikeout(undefined);
if (undefined != this.Value.Caps)
this.Set_Caps(undefined);
if (undefined != this.Value.SmallCaps)
this.Set_SmallCaps(undefined);
if (undefined != this.Value.Position)
this.Set_Position(undefined);
if (undefined != this.Value.RFonts.Ascii)
this.Set_RFonts_Ascii(undefined);
if (undefined != this.Value.RFonts.HAnsi)
this.Set_RFonts_HAnsi(undefined);
if (undefined != this.Value.RFonts.CS)
this.Set_RFonts_CS(undefined);
if (undefined != this.Value.RFonts.EastAsia)
this.Set_RFonts_EastAsia(undefined);
if (undefined != this.Value.RFonts.Hint)
this.Set_RFonts_Hint(undefined);
if (undefined != this.Value.TextFill)
this.Set_TextFill(undefined);
if (undefined != this.Value.TextOutline)
this.Set_TextOutline(undefined);
};
ParaTextPr.prototype.Set_Bold = function(Value)
{
if (this.Value.Bold === Value)
return;
History.Add(new CChangesParaTextPrBold(this, this.Value.Bold, Value));
this.Value.Bold = Value;
};
ParaTextPr.prototype.Set_Italic = function(Value)
{
if (this.Value.Italic === Value)
return;
History.Add(new CChangesParaTextPrItalic(this, this.Value.Italic, Value));
this.Value.Italic = Value;
};
ParaTextPr.prototype.Set_Strikeout = function(Value)
{
if (this.Value.Strikeout === Value)
return;
History.Add(new CChangesParaTextPrStrikeout(this, this.Value.Strikeout, Value));
this.Value.Strikeout = Value;
};
ParaTextPr.prototype.Set_Underline = function(Value)
{
if (this.Value.Underline === Value)
return;
History.Add(new CChangesParaTextPrUnderline(this, this.Value.Underline, Value));
this.Value.Underline = Value;
};
ParaTextPr.prototype.Set_FontSize = function(Value)
{
if (this.Value.FontSize === Value)
return;
History.Add(new CChangesParaTextPrFontSize(this, this.Value.FontSize, Value));
this.Value.FontSize = Value;
};
ParaTextPr.prototype.Set_Color = function(Value)
{
History.Add(new CChangesParaTextPrColor(this, this.Value.Color, Value));
this.Value.Color = Value;
};
ParaTextPr.prototype.Set_VertAlign = function(Value)
{
if (this.Value.VertAlign === Value)
return;
History.Add(new CChangesParaTextPrVertAlign(this, this.Value.VertAlign, Value));
this.Value.VertAlign = Value;
};
ParaTextPr.prototype.Set_HighLight = function(Value)
{
History.Add(new CChangesParaTextPrHighLight(this, this.Value.HighLight, Value));
this.Value.HighLight = Value;
};
ParaTextPr.prototype.Set_RStyle = function(Value)
{
if (this.Value.RStyle === Value)
return;
History.Add(new CChangesParaTextPrRStyle(this, this.Value.RStyle, Value));
this.Value.RStyle = Value;
};
ParaTextPr.prototype.Set_Spacing = function(Value)
{
if (this.Value.Spacing === Value)
return;
History.Add(new CChangesParaTextPrSpacing(this, this.Value.Spacing, Value));
this.Value.Spacing = Value;
};
ParaTextPr.prototype.Set_DStrikeout = function(Value)
{
if (this.Value.DStrikeout === Value)
return;
History.Add(new CChangesParaTextPrDStrikeout(this, this.Value.DStrikeout, Value));
this.Value.DStrikeout = Value;
};
ParaTextPr.prototype.Set_Caps = function(Value)
{
if (this.Value.Caps === Value)
return;
History.Add(new CChangesParaTextPrCaps(this, this.Value.Caps, Value));
this.Value.Caps = Value;
};
ParaTextPr.prototype.Set_SmallCaps = function(Value)
{
if (this.Value.SmallCaps === Value)
return;
History.Add(new CChangesParaTextPrSmallCaps(this, this.Value.SmallCaps, Value));
this.Value.SmallCaps = Value;
};
ParaTextPr.prototype.Set_Position = function(Value)
{
if (this.Value.Position === Value)
return;
History.Add(new CChangesParaTextPrPosition(this, this.Value.Position, Value));
this.Value.Position = Value;
};
ParaTextPr.prototype.Set_Value = function(Value)
{
if (!Value || !(Value instanceof CTextPr) || true === this.Value.Is_Equal(Value))
return;
History.Add(new CChangesParaTextPrValue(this, this.Value, Value));
this.Value = Value;
};
ParaTextPr.prototype.Set_RFonts = function(Value)
{
var _Value = Value ? Value : new CRFonts();
History.Add(new CChangesParaTextPrRFonts(this, this.Value.RFonts, _Value));
this.Value.RFonts = _Value;
};
ParaTextPr.prototype.Set_RFonts2 = function(RFonts)
{
if (undefined != RFonts)
{
if (undefined != RFonts.Ascii)
this.Set_RFonts_Ascii(RFonts.Ascii);
if (undefined != RFonts.HAnsi)
this.Set_RFonts_HAnsi(RFonts.HAnsi);
if (undefined != RFonts.CS)
this.Set_RFonts_CS(RFonts.CS);
if (undefined != RFonts.EastAsia)
this.Set_RFonts_EastAsia(RFonts.EastAsia);
if (undefined != RFonts.Hint)
this.Set_RFonts_Hint(RFonts.Hint);
}
};
ParaTextPr.prototype.Set_RFonts_Ascii = function(Value)
{
History.Add(new CChangesParaTextPrRFontsAscii(this, this.Value.RFonts.Ascii, Value));
this.Value.RFonts.Ascii = Value;
};
ParaTextPr.prototype.Set_RFonts_HAnsi = function(Value)
{
History.Add(new CChangesParaTextPrRFontsHAnsi(this, this.Value.RFonts.HAnsi, Value));
this.Value.RFonts.HAnsi = Value;
};
ParaTextPr.prototype.Set_RFonts_CS = function(Value)
{
History.Add(new CChangesParaTextPrRFontsCS(this, this.Value.RFonts.CS, Value));
this.Value.RFonts.CS = Value;
};
ParaTextPr.prototype.Set_RFonts_EastAsia = function(Value)
{
History.Add(new CChangesParaTextPrRFontsEastAsia(this, this.Value.RFonts.EastAsia, Value));
this.Value.RFonts.EastAsia = Value;
};
ParaTextPr.prototype.Set_RFonts_Hint = function(Value)
{
History.Add(new CChangesParaTextPrRFontsHint(this, this.Value.RFonts, Hint, Value));
this.Value.RFonts.Hint = Value;
};
ParaTextPr.prototype.Set_Lang = function(Value)
{
var _Value = new CLang();
if (Value)
_Value.Set_FromObject(Value);
History.Add(new CChangesParaTextPrLang(this, this.Value.Lang, Value));
this.Value.Lang = _Value;
};
ParaTextPr.prototype.Set_Lang_Bidi = function(Value)
{
History.Add(new CChangesParaTextPrLangBidi(this, this.Value.Lang.Bidi, Value));
this.Value.Lang.Bidi = Value;
};
ParaTextPr.prototype.Set_Lang_EastAsia = function(Value)
{
History.Add(new CChangesParaTextPrLangEastAsia(this, this.Value.Lang.EastAsia, Value));
this.Value.Lang.EastAsia = Value;
};
ParaTextPr.prototype.Set_Lang_Val = function(Value)
{
History.Add(new CChangesParaTextPrLangVal(this, this.Value.Lang.Val, Value));
this.Value.Lang.Val = Value;
};
ParaTextPr.prototype.Set_Unifill = function(Value)
{
History.Add(new CChangesParaTextPrUnifill(this, this.Value.Unifill, Value));
this.Value.Unifill = Value;
};
ParaTextPr.prototype.Set_FontSizeCS = function(Value)
{
if (this.Value.FontSizeCS === Value)
return;
History.Add(new CChangesParaTextPrFontSizeCS(this, this.Value.FontSizeCS, Value));
this.Value.FontSizeCS = Value;
};
ParaTextPr.prototype.Set_TextOutline = function(Value)
{
History.Add(new CChangesParaTextPrTextOutline(this, this.Value.TextOutline, Value));
this.Value.TextOutline = Value;
};
ParaTextPr.prototype.Set_TextFill = function(Value)
{
History.Add(new CChangesParaTextPrTextFill(this, this.Value.TextFill, Value));
this.Value.TextFill = Value;
};
//----------------------------------------------------------------------------------------------------------------------
// Undo/Redo функции
//----------------------------------------------------------------------------------------------------------------------
ParaTextPr.prototype.Get_ParentObject_or_DocumentPos = function()
{
if (null != this.Parent)
return this.Parent.Get_ParentObject_or_DocumentPos();
};
ParaTextPr.prototype.Refresh_RecalcData = function(Data)
{
if (undefined !== this.Parent && null !== this.Parent)
this.Parent.Refresh_RecalcData2();
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с совместным редактирования
//----------------------------------------------------------------------------------------------------------------------
ParaTextPr.prototype.Write_ToBinary = function(Writer)
{
// Long : Type
// String : Id
Writer.WriteLong(this.Type);
Writer.WriteString2(this.Id);
};
ParaTextPr.prototype.Write_ToBinary2 = function(Writer)
{
Writer.WriteLong(AscDFH.historyitem_type_TextPr);
// Long : Type
// String : Id
// Long : Value
Writer.WriteLong(this.Type);
Writer.WriteString2(this.Id);
this.Value.Write_ToBinary(Writer);
};
ParaTextPr.prototype.Read_FromBinary2 = function(Reader)
{
this.Type = Reader.GetLong();
this.Id = Reader.GetString2();
this.Value.Clear();
this.Value.Read_FromBinary(Reader);
};
//--------------------------------------------------------export----------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].ParaTextPr = ParaTextPr;
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
"use strict";
/**
* User: Ilja.Kirillov
* Date: 02.11.2016
* Time: 16:42
*/
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Bold] = CChangesParaTextPrBold;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Italic] = CChangesParaTextPrItalic;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Strikeout] = CChangesParaTextPrStrikeout;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Underline] = CChangesParaTextPrUnderline;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_FontSize] = CChangesParaTextPrFontSize;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Color] = CChangesParaTextPrColor;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_VertAlign] = CChangesParaTextPrVertAlign;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_HighLight] = CChangesParaTextPrHighLight;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RStyle] = CChangesParaTextPrRStyle;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Spacing] = CChangesParaTextPrSpacing;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_DStrikeout] = CChangesParaTextPrDStrikeout;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Caps] = CChangesParaTextPrCaps;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_SmallCaps] = CChangesParaTextPrSmallCaps;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Position] = CChangesParaTextPrPosition;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Value] = CChangesParaTextPrValue;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts] = CChangesParaTextPrRFonts;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_Ascii] = CChangesParaTextPrRFontsAscii;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_HAnsi] = CChangesParaTextPrRFontsHAnsi;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_CS] = CChangesParaTextPrRFontsCS;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_EastAsia] = CChangesParaTextPrRFontsEastAsia;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_RFonts_Hint] = CChangesParaTextPrRFontsHint;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang] = CChangesParaTextPrLang;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang_Bidi] = CChangesParaTextPrLangBidi;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang_EastAsia] = CChangesParaTextPrLangEastAsia;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Lang_Val] = CChangesParaTextPrLangVal;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Unifill] = CChangesParaTextPrUnifill;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_FontSizeCS] = CChangesParaTextPrFontSizeCS;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Outline] = CChangesParaTextPrTextOutline;
AscDFH.changesFactory[AscDFH.historyitem_TextPr_Fill] = CChangesParaTextPrTextFill;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrBold(Class, Old, New, Color)
{
CChangesParaTextPrBold.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrBold, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrBold.prototype.Type = AscDFH.historyitem_TextPr_Bold;
CChangesParaTextPrBold.prototype.private_SetValue = function(Value)
{
this.Class.Value.Bold = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrItalic(Class, Old, New, Color)
{
CChangesParaTextPrItalic.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrItalic, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrItalic.prototype.Type = AscDFH.historyitem_TextPr_Italic;
CChangesParaTextPrItalic.prototype.private_SetValue = function(Value)
{
this.Class.Value.Italic = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrStrikeout(Class, Old, New, Color)
{
CChangesParaTextPrStrikeout.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrStrikeout, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrStrikeout.prototype.Type = AscDFH.historyitem_TextPr_Strikeout;
CChangesParaTextPrStrikeout.prototype.private_SetValue = function(Value)
{
this.Class.Value.Strikeout = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrUnderline(Class, Old, New, Color)
{
CChangesParaTextPrUnderline.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrUnderline, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrUnderline.prototype.Type = AscDFH.historyitem_TextPr_Underline;
CChangesParaTextPrUnderline.prototype.private_SetValue = function(Value)
{
this.Class.Value.Underline = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesParaTextPrFontSize(Class, Old, New, Color)
{
CChangesParaTextPrFontSize.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrFontSize, AscDFH.CChangesBaseDoubleProperty);
CChangesParaTextPrFontSize.prototype.Type = AscDFH.historyitem_TextPr_FontSize;
CChangesParaTextPrFontSize.prototype.private_SetValue = function(Value)
{
this.Class.Value.FontSize = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrColor(Class, Old, New, Color)
{
CChangesParaTextPrColor.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrColor, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrColor.prototype.Type = AscDFH.historyitem_TextPr_Color;
CChangesParaTextPrColor.prototype.private_SetValue = function(Value)
{
this.Class.Value.Color = Value;
};
CChangesParaTextPrColor.prototype.private_CreateObject = function()
{
return new CDocumentColor(0, 0, 0, false);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesParaTextPrVertAlign(Class, Old, New, Color)
{
CChangesParaTextPrVertAlign.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrVertAlign, AscDFH.CChangesBaseLongProperty);
CChangesParaTextPrVertAlign.prototype.Type = AscDFH.historyitem_TextPr_VertAlign;
CChangesParaTextPrVertAlign.prototype.private_SetValue = function(Value)
{
this.Class.Value.VertAlign = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesParaTextPrHighLight(Class, Old, New, Color)
{
CChangesParaTextPrHighLight.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrVertAlign, AscDFH.CChangesBaseProperty);
CChangesParaTextPrHighLight.prototype.Type = AscDFH.historyitem_TextPr_HighLight;
CChangesParaTextPrHighLight.prototype.private_SetValue = function(Value)
{
this.Class.Value.HighLight = Value;
};
CChangesParaTextPrHighLight.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);
};
CChangesParaTextPrHighLight.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);
}
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringProperty}
*/
function CChangesParaTextPrRStyle(Class, Old, New, Color)
{
CChangesParaTextPrRStyle.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRStyle, AscDFH.CChangesBaseStringProperty);
CChangesParaTextPrRStyle.prototype.Type = AscDFH.historyitem_TextPr_RStyle;
CChangesParaTextPrRStyle.prototype.private_SetValue = function(Value)
{
this.Class.Value.RStyle = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesParaTextPrSpacing(Class, Old, New, Color)
{
CChangesParaTextPrSpacing.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrSpacing, AscDFH.CChangesBaseDoubleProperty);
CChangesParaTextPrSpacing.prototype.Type = AscDFH.historyitem_TextPr_Spacing;
CChangesParaTextPrSpacing.prototype.private_SetValue = function(Value)
{
this.Class.Value.Spacing = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrDStrikeout(Class, Old, New, Color)
{
CChangesParaTextPrDStrikeout.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrDStrikeout, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrDStrikeout.prototype.Type = AscDFH.historyitem_TextPr_DStrikeout;
CChangesParaTextPrDStrikeout.prototype.private_SetValue = function(Value)
{
this.Class.Value.DStrikeout = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrCaps(Class, Old, New, Color)
{
CChangesParaTextPrCaps.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrCaps, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrCaps.prototype.Type = AscDFH.historyitem_TextPr_Caps;
CChangesParaTextPrCaps.prototype.private_SetValue = function(Value)
{
this.Class.Value.Caps = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function CChangesParaTextPrSmallCaps(Class, Old, New, Color)
{
CChangesParaTextPrSmallCaps.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrSmallCaps, AscDFH.CChangesBaseBoolProperty);
CChangesParaTextPrSmallCaps.prototype.Type = AscDFH.historyitem_TextPr_SmallCaps;
CChangesParaTextPrSmallCaps.prototype.private_SetValue = function(Value)
{
this.Class.Value.SmallCaps = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesParaTextPrPosition(Class, Old, New, Color)
{
CChangesParaTextPrPosition.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrPosition, AscDFH.CChangesBaseDoubleProperty);
CChangesParaTextPrPosition.prototype.Type = AscDFH.historyitem_TextPr_Position;
CChangesParaTextPrPosition.prototype.private_SetValue = function(Value)
{
this.Class.Value.Position = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrValue(Class, Old, New, Color)
{
CChangesParaTextPrValue.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrValue, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrValue.prototype.Type = AscDFH.historyitem_TextPr_Value;
CChangesParaTextPrValue.prototype.private_SetValue = function(Value)
{
this.Class.Value = Value;
};
CChangesParaTextPrValue.prototype.private_CreateObject = function()
{
return new CTextPr();
};
CChangesParaTextPrValue.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrRFonts(Class, Old, New, Color)
{
CChangesParaTextPrRFonts.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRFonts, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrRFonts.prototype.Type = AscDFH.historyitem_TextPr_RFonts;
CChangesParaTextPrRFonts.prototype.private_SetValue = function(Value)
{
this.Class.Value.RFonts = Value;
};
CChangesParaTextPrRFonts.prototype.private_CreateObject = function()
{
return new CRFonts();
};
CChangesParaTextPrRFonts.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesParaTextPrRFontsAscii(Class, Old, New, Color)
{
CChangesParaTextPrRFontsAscii.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRFontsAscii, AscDFH.CChangesBaseProperty);
CChangesParaTextPrRFontsAscii.prototype.Type = AscDFH.historyitem_TextPr_RFonts_Ascii;
CChangesParaTextPrRFontsAscii.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);
};
CChangesParaTextPrRFontsAscii.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
};
}
};
CChangesParaTextPrRFontsAscii.prototype.private_SetValue = function(Value)
{
this.Class.Value.RFonts.Ascii = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesParaTextPrRFontsHAnsi(Class, Old, New, Color)
{
CChangesParaTextPrRFontsHAnsi.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRFontsHAnsi, AscDFH.CChangesBaseProperty);
CChangesParaTextPrRFontsHAnsi.prototype.Type = AscDFH.historyitem_TextPr_RFonts_HAnsi;
CChangesParaTextPrRFontsHAnsi.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);
};
CChangesParaTextPrRFontsHAnsi.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
};
}
};
CChangesParaTextPrRFontsHAnsi.prototype.private_SetValue = function(Value)
{
this.Class.Value.RFonts.HAnsi = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesParaTextPrRFontsCS(Class, Old, New, Color)
{
CChangesParaTextPrRFontsCS.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRFontsCS, AscDFH.CChangesBaseProperty);
CChangesParaTextPrRFontsCS.prototype.Type = AscDFH.historyitem_TextPr_RFonts_CS;
CChangesParaTextPrRFontsCS.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);
};
CChangesParaTextPrRFontsCS.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
};
}
};
CChangesParaTextPrRFontsCS.prototype.private_SetValue = function(Value)
{
this.Class.Value.RFonts.CS = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function CChangesParaTextPrRFontsEastAsia(Class, Old, New, Color)
{
CChangesParaTextPrRFontsEastAsia.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRFontsEastAsia, AscDFH.CChangesBaseProperty);
CChangesParaTextPrRFontsEastAsia.prototype.Type = AscDFH.historyitem_TextPr_RFonts_EastAsia;
CChangesParaTextPrRFontsEastAsia.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);
};
CChangesParaTextPrRFontsEastAsia.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
};
}
};
CChangesParaTextPrRFontsEastAsia.prototype.private_SetValue = function(Value)
{
this.Class.Value.RFonts.EastAsia = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesParaTextPrRFontsHint(Class, Old, New, Color)
{
CChangesParaTextPrRFontsHint.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrRFontsHint, AscDFH.CChangesBaseLongProperty);
CChangesParaTextPrRFontsHint.prototype.Type = AscDFH.historyitem_TextPr_RFonts_Hint;
CChangesParaTextPrRFontsHint.prototype.private_SetValue = function(Value)
{
this.Class.Value.RFonts.Hint = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrLang(Class, Old, New, Color)
{
CChangesParaTextPrLang.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrLang, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrLang.prototype.Type = AscDFH.historyitem_TextPr_Lang;
CChangesParaTextPrLang.prototype.private_SetValue = function(Value)
{
this.Class.Value.Lang = Value;
};
CChangesParaTextPrLang.prototype.private_CreateObject = function()
{
return new CLang();
};
CChangesParaTextPrLang.prototype.private_IsCreateEmptyObject = function()
{
return true;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesParaTextPrLangBidi(Class, Old, New, Color)
{
CChangesParaTextPrLangBidi.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrLangBidi, AscDFH.CChangesBaseLongProperty);
CChangesParaTextPrLangBidi.prototype.Type = AscDFH.historyitem_TextPr_Lang_Bidi;
CChangesParaTextPrLangBidi.prototype.private_SetValue = function(Value)
{
this.Class.Value.Lang.Bidi = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesParaTextPrLangEastAsia(Class, Old, New, Color)
{
CChangesParaTextPrLangEastAsia.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrLangEastAsia, AscDFH.CChangesBaseLongProperty);
CChangesParaTextPrLangEastAsia.prototype.Type = AscDFH.historyitem_TextPr_Lang_EastAsia;
CChangesParaTextPrLangEastAsia.prototype.private_SetValue = function(Value)
{
this.Class.Value.Lang.EastAsia = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesParaTextPrLangVal(Class, Old, New, Color)
{
CChangesParaTextPrLangVal.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrLangVal, AscDFH.CChangesBaseLongProperty);
CChangesParaTextPrLangVal.prototype.Type = AscDFH.historyitem_TextPr_Lang_Val;
CChangesParaTextPrLangVal.prototype.private_SetValue = function(Value)
{
this.Class.Value.Lang.Val = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrUnifill(Class, Old, New, Color)
{
CChangesParaTextPrUnifill.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrUnifill, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrUnifill.prototype.Type = AscDFH.historyitem_TextPr_Unifill;
CChangesParaTextPrUnifill.prototype.private_SetValue = function(Value)
{
this.Class.Value.Unifill = Value;
};
CChangesParaTextPrUnifill.prototype.private_CreateObject = function()
{
return new AscFormat.CUniFill();
};
CChangesParaTextPrUnifill.prototype.Load = function(Color)
{
this.Redo();
var Unifill = this.Class.Value.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));
}
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function CChangesParaTextPrFontSizeCS(Class, Old, New, Color)
{
CChangesParaTextPrFontSizeCS.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrFontSizeCS, AscDFH.CChangesBaseDoubleProperty);
CChangesParaTextPrFontSizeCS.prototype.Type = AscDFH.historyitem_TextPr_FontSizeCS;
CChangesParaTextPrFontSizeCS.prototype.private_SetValue = function(Value)
{
this.Class.Value.FontSizeCS = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrTextOutline(Class, Old, New, Color)
{
CChangesParaTextPrTextOutline.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrTextOutline, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrTextOutline.prototype.Type = AscDFH.historyitem_TextPr_Outline;
CChangesParaTextPrTextOutline.prototype.private_SetValue = function(Value)
{
this.Class.Value.TextOutline = Value;
};
CChangesParaTextPrTextOutline.prototype.private_CreateObject = function()
{
return new AscFormat.CLn();
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function CChangesParaTextPrTextFill(Class, Old, New, Color)
{
CChangesParaTextPrTextFill.superclass.constructor.call(this, Class, Old, New, Color);
}
AscCommon.extendClass(CChangesParaTextPrTextFill, AscDFH.CChangesBaseObjectProperty);
CChangesParaTextPrTextFill.prototype.Type = AscDFH.historyitem_TextPr_Fill;
CChangesParaTextPrTextFill.prototype.private_SetValue = function(Value)
{
this.Class.Value.TextFill = Value;
};
CChangesParaTextPrTextFill.prototype.private_CreateObject = function()
{
return new AscFormat.CUniFill();
};
\ No newline at end of file
...@@ -668,2058 +668,6 @@ ParaSym.prototype = ...@@ -668,2058 +668,6 @@ ParaSym.prototype =
} }
}; };
// Класс ParaTextPr
function ParaTextPr(Props)
{
this.Id = AscCommon.g_oIdCounter.Get_NewId();
this.Type = para_TextPr;
this.Value = new CTextPr();
this.Parent = null;
this.CalcValue = this.Value;
this.Width = 0;
this.Height = 0;
this.WidthVisible = 0;
if ( "object" == typeof(Props) )
{
this.Value.Set_FromObject( Props );
}
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id );
}
ParaTextPr.prototype =
{
Type : para_TextPr,
Get_Type : function()
{
return para_TextPr;
},
Draw : function()//(X,Y,Context)
{
// Ничего не делаем
},
Measure : function()//(Context)
{
this.Width = 0;
this.Height = 0;
this.WidthVisible = 0;
},
Copy : function()
{
var ParaTextPr_new = new ParaTextPr( );
ParaTextPr_new.Set_Value( this.Value );
return ParaTextPr_new;
},
Is_RealContent : function()
{
return true;
},
Can_AddNumbering : function()
{
return false;
},
Set_Id : function(newId)
{
g_oTableId.Reset_Id( this, newId, this.Id );
this.Id = newId;
},
Get_Id : function()
{
return this.Id;
},
//-----------------------------------------------------------------------------------
// Функции для изменения свойств
//-----------------------------------------------------------------------------------
Apply_TextPr : function(TextPr)
{
if ( undefined != TextPr.Bold )
this.Set_Bold( TextPr.Bold );
if ( undefined != TextPr.Italic )
this.Set_Italic( TextPr.Italic );
if ( undefined != TextPr.Strikeout )
this.Set_Strikeout( TextPr.Strikeout );
if ( undefined != TextPr.Underline )
this.Set_Underline( TextPr.Underline );
if ( undefined != TextPr.FontFamily )
this.Set_FontFamily( TextPr.FontFamily );
if ( undefined != TextPr.FontSize )
this.Set_FontSize( TextPr.FontSize );
if ( undefined != TextPr.FontSizeCS )
this.Set_FontSizeCS( TextPr.FontSizeCS );
if ( undefined != TextPr.Color )
{
this.Set_Color(TextPr.Color);
if(undefined != this.Value.Unifill)
{
this.Set_Unifill(undefined);
}
if(undefined != this.Value.TextFill)
{
this.Set_TextFill(undefined);
}
}
if ( undefined != TextPr.VertAlign )
this.Set_VertAlign( TextPr.VertAlign );
if ( undefined != TextPr.HighLight )
this.Set_HighLight( TextPr.HighLight );
if ( undefined != TextPr.RStyle )
this.Set_RStyle( TextPr.RStyle );
if ( undefined != TextPr.Spacing )
this.Set_Spacing( TextPr.Spacing );
if ( undefined != TextPr.DStrikeout )
this.Set_DStrikeout( TextPr.DStrikeout );
if ( undefined != TextPr.Caps )
this.Set_Caps( TextPr.Caps );
if ( undefined != TextPr.SmallCaps )
this.Set_SmallCaps( TextPr.SmallCaps );
if ( undefined != TextPr.Position )
this.Set_Position( TextPr.Position );
if ( undefined != TextPr.RFonts )
this.Set_RFonts2( TextPr.RFonts );
if ( undefined != TextPr.Lang )
this.Set_Lang( TextPr.Lang );
if(undefined != TextPr.Unifill)
{
this.Set_Unifill(TextPr.Unifill.createDuplicate());
if(undefined != this.Value.Color)
{
this.Set_Color(undefined);
}
if(undefined != this.Value.TextFill)
{
this.Set_TextFill(undefined);
}
}
if(undefined != TextPr.TextOutline)
{
this.Set_TextOutline(TextPr.TextOutline);
}
if(undefined != TextPr.TextFill)
{
this.Set_TextFill(TextPr.TextFill);
if(undefined != this.Value.Color)
{
this.Set_Color(undefined);
}
if(undefined != this.Value.Unifill)
{
this.Set_Unifill(undefined);
}
}
},
Clear_Style : function()
{
// Пока удаляем все кроме настроек языка
if ( undefined != this.Value.Bold )
this.Set_Bold( undefined );
if ( undefined != this.Value.Italic )
this.Set_Italic( undefined );
if ( undefined != this.Value.Strikeout )
this.Set_Strikeout( undefined );
if ( undefined != this.Value.Underline )
this.Set_Underline( undefined );
if ( undefined != this.Value.FontSize )
this.Set_FontSize( undefined );
if ( undefined != this.Value.Color )
this.Set_Color( undefined );
if ( undefined != this.Value.Unifill )
this.Set_Unifill( undefined );
if ( undefined != this.Value.VertAlign )
this.Set_VertAlign( undefined );
if ( undefined != this.Value.HighLight )
this.Set_HighLight( undefined );
if ( undefined != this.Value.RStyle )
this.Set_RStyle( undefined );
if ( undefined != this.Value.Spacing )
this.Set_Spacing( undefined );
if ( undefined != this.Value.DStrikeout )
this.Set_DStrikeout( undefined );
if ( undefined != this.Value.Caps )
this.Set_Caps( undefined );
if ( undefined != this.Value.SmallCaps )
this.Set_SmallCaps( undefined );
if ( undefined != this.Value.Position )
this.Set_Position( undefined );
if ( undefined != this.Value.RFonts.Ascii )
this.Set_RFonts_Ascii( undefined );
if ( undefined != this.Value.RFonts.HAnsi )
this.Set_RFonts_HAnsi( undefined );
if ( undefined != this.Value.RFonts.CS )
this.Set_RFonts_CS( undefined );
if ( undefined != this.Value.RFonts.EastAsia )
this.Set_RFonts_EastAsia( undefined );
if ( undefined != this.Value.RFonts.Hint )
this.Set_RFonts_Hint( undefined );
if(undefined != this.Value.TextFill)
this.Set_TextFill( undefined );
if(undefined != this.Value.TextOutline)
this.Set_TextOutline( undefined );
},
Set_Prop : function(Prop, Value)
{
var OldValue = ( undefined != this.Value[Prop] ? this.Value[Prop] : undefined );
this.Value[Prop] = Value;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Change, Prop : Prop, New : Value, Old : OldValue } );
},
Delete_Prop : function(Prop)
{
if ( undefined === this.Value[Prop] )
return;
var OldValue = this.Value[Prop];
this.Value[Prop] = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Change, Prop : Prop, New : null, Old : OldValue } );
},
Set_Bold : function(Value)
{
var OldValue = ( undefined != this.Value.Bold ? this.Value.Bold : undefined );
if ( undefined != Value )
this.Value.Bold = Value;
else
this.Value.Bold = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Bold, New : Value, Old : OldValue } );
},
Set_Italic : function(Value)
{
var OldValue = ( undefined != this.Value.Italic ? this.Value.Italic : undefined );
if ( undefined != Value )
this.Value.Italic = Value;
else
this.Value.Italic = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Italic, New : Value, Old : OldValue } );
},
Set_Strikeout : function(Value)
{
var OldValue = ( undefined != this.Value.Strikeout ? this.Value.Strikeout : undefined );
if ( undefined != Value )
this.Value.Strikeout = Value;
else
this.Value.Strikeout = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Strikeout, New : Value, Old : OldValue } );
},
Set_Underline : function(Value)
{
var OldValue = ( undefined != this.Value.Underline ? this.Value.Underline : undefined );
if ( undefined != Value )
this.Value.Underline = Value;
else
this.Value.Underline = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Underline, New : Value, Old : OldValue } );
},
Set_FontFamily : function(Value)
{
var OldValue = ( undefined != this.Value.FontFamily ? this.Value.FontFamily : undefined );
if ( undefined != Value )
this.Value.FontFamily = Value;
else
this.Value.FontFamily = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_FontFamily, New : Value, Old : OldValue } );
},
Set_FontSize : function(Value)
{
var OldValue = ( undefined != this.Value.FontSize ? this.Value.FontSize : undefined );
if ( undefined != Value )
this.Value.FontSize = Value;
else
this.Value.FontSize = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_FontSize, New : Value, Old : OldValue } );
},
Set_FontSizeCS : function(Value)
{
var OldValue = ( undefined != this.Value.FontSizeCS ? this.Value.FontSizeCS : undefined );
if ( undefined != Value )
this.Value.FontSizeCS = Value;
else
this.Value.FontSizeCS = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_FontSizeCS, New : Value, Old : OldValue } );
},
Set_Color : function(Value)
{
var OldValue = ( undefined != this.Value.Color ? this.Value.Color : undefined );
if ( undefined != Value )
this.Value.Color = Value;
else
this.Value.Color = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Color, New : Value, Old : OldValue } );
},
Set_VertAlign : function(Value)
{
var OldValue = ( undefined != this.Value.VertAlign ? this.Value.VertAlign : undefined );
if ( undefined != Value )
this.Value.VertAlign = Value;
else
this.Value.VertAlign = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_VertAlign, New : Value, Old : OldValue } );
},
Set_HighLight : function(Value)
{
var OldValue = ( undefined != this.Value.HighLight ? this.Value.HighLight : undefined );
if ( undefined != Value )
this.Value.HighLight = Value;
else
this.Value.HighLight = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_HighLight, New : Value, Old : OldValue } );
},
Set_RStyle : function(Value)
{
var OldValue = ( undefined != this.Value.RStyle ? this.Value.RStyle : undefined );
if ( undefined != Value )
this.Value.RStyle = Value;
else
this.Value.RStyle = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_RStyle, New : Value, Old : OldValue } );
},
Set_Spacing : function(Value)
{
var OldValue = ( undefined != this.Value.Spacing ? this.Value.Spacing : undefined );
if ( undefined != Value )
this.Value.Spacing = Value;
else
this.Value.Spacing = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Spacing, New : Value, Old : OldValue } );
},
Set_DStrikeout : function(Value)
{
var OldValue = ( undefined != this.Value.DStrikeout ? this.Value.DStrikeout : undefined );
if ( undefined != Value )
this.Value.DStrikeout = Value;
else
this.Value.DStrikeout = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_DStrikeout, New : Value, Old : OldValue } );
},
Set_Caps : function(Value)
{
var OldValue = ( undefined != this.Value.Caps ? this.Value.Caps : undefined );
if ( undefined != Value )
this.Value.Caps = Value;
else
this.Value.Caps = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Caps, New : Value, Old : OldValue } );
},
Set_SmallCaps : function(Value)
{
var OldValue = ( undefined != this.Value.SmallCaps ? this.Value.SmallCaps : undefined );
if ( undefined != Value )
this.Value.SmallCaps = Value;
else
this.Value.SmallCaps = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_SmallCaps, New : Value, Old : OldValue } );
},
Set_Position : function(Value)
{
var OldValue = ( undefined != this.Value.Position ? this.Value.Position : undefined );
if ( undefined != Value )
this.Value.Position = Value;
else
this.Value.Position = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Position, New : Value, Old : OldValue } );
},
Set_Value : function(Value)
{
var OldValue = this.Value;
this.Value = Value;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Value, New : Value, Old : OldValue } );
},
Set_RFonts : function(Value)
{
var OldValue = this.RFonts.Value;
if ( undefined != Value )
this.Value.RFonts = Value;
else
this.Value.RFonts = new CRFonts();
History.Add( this, { Type : AscDFH.historyitem_TextPr_RFonts, New : Value, Old : OldValue } );
},
Set_RFonts2 : function(RFonts)
{
if ( undefined != RFonts )
{
if ( undefined != RFonts.Ascii )
this.Set_RFonts_Ascii( RFonts.Ascii );
if ( undefined != RFonts.HAnsi )
this.Set_RFonts_HAnsi( RFonts.HAnsi );
if ( undefined != RFonts.CS )
this.Set_RFonts_CS( RFonts.CS );
if ( undefined != RFonts.EastAsia )
this.Set_RFonts_EastAsia( RFonts.EastAsia );
if ( undefined != RFonts.Hint )
this.Set_RFonts_Hint( RFonts.Hint );
}
},
Set_RFonts_Ascii : function(Value)
{
var OldValue = this.Value.RFonts.Ascii;
if ( undefined != Value )
this.Value.RFonts.Ascii = Value;
else
this.Value.RFonts.Ascii = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_RFonts_Ascii, New : Value, Old : OldValue } );
},
Set_RFonts_HAnsi : function(Value)
{
var OldValue = this.Value.RFonts.HAnsi;
if ( undefined != Value )
this.Value.RFonts.HAnsi = Value;
else
this.Value.RFonts.HAnsi = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_RFonts_HAnsi, New : Value, Old : OldValue } );
},
Set_RFonts_CS : function(Value)
{
var OldValue = this.Value.RFonts.CS;
if ( undefined != Value )
this.Value.RFonts.CS = Value;
else
this.Value.RFonts.CS = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_RFonts_CS, New : Value, Old : OldValue } );
},
Set_RFonts_EastAsia : function(Value)
{
var OldValue = this.Value.RFonts.EastAsia;
if ( undefined != Value )
this.Value.RFonts.EastAsia = Value;
else
this.Value.RFonts.EastAsia = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_RFonts_EastAsia, New : Value, Old : OldValue } );
},
Set_RFonts_Hint : function(Value)
{
var OldValue = this.Value.RFonts.Hint;
if ( undefined != Value )
this.Value.RFonts.Hint = Value;
else
this.Value.RFonts.Hint = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_RFonts_Hint, New : Value, Old : OldValue } );
},
Set_Lang : function(Value)
{
var OldValue = this.Value.Lang;
var NewValue = new CLang();
if ( undefined != Value )
NewValue.Set_FromObject( Value );
this.Value.Lang = NewValue;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Lang, New : NewValue, Old : OldValue } );
},
Set_Lang_Bidi : function(Value)
{
var OldValue = this.Value.Lang.Bidi;
if ( undefined != Value )
this.Value.Lang.Bidi = Value;
else
this.Value.Lang.Bidi = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Lang_Bidi, New : Value, Old : OldValue } );
},
Set_Lang_EastAsia : function(Value)
{
var OldValue = this.Value.Lang.EastAsia;
if ( undefined != Value )
this.Value.Lang.EastAsia = Value;
else
this.Value.Lang.EastAsia = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Lang_EastAsia, New : Value, Old : OldValue } );
},
Set_Lang_Val : function(Value)
{
var OldValue = this.Value.Lang.Val;
if ( undefined != Value )
this.Value.Lang.Val = Value;
else
this.Value.Lang.Val = undefined;
History.Add( this, { Type : AscDFH.historyitem_TextPr_Lang_Val, New : Value, Old : OldValue } );
},
Set_Unifill : function(Value)
{
var OldValue = this.Value.Unifill;
if ( undefined != Value )
this.Value.Unifill = Value;
else
this.Value.Unifill = undefined;
History.Add(this, {Type: AscDFH.historyitem_TextPr_Unifill, New: Value, Old: OldValue});
},
Set_TextOutline : function(Value)
{
var OldValue = this.Value.TextOutline;
if ( undefined != Value )
this.Value.TextOutline = Value;
else
this.Value.TextOutline = undefined;
History.Add(this, {Type: AscDFH.historyitem_TextPr_Outline, New: Value, Old: OldValue});
},
Set_TextFill : function(Value)
{
var OldValue = this.Value.TextFill;
if ( undefined != Value )
this.Value.TextFill = Value;
else
this.Value.TextFill = undefined;
History.Add(this, {Type: AscDFH.historyitem_TextPr_Fill, New: Value, Old: OldValue});
},
//-----------------------------------------------------------------------------------
// Undo/Redo функции
//-----------------------------------------------------------------------------------
Undo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case AscDFH.historyitem_TextPr_Change:
{
if ( undefined != Data.Old )
this.Value[Data.Prop] = Data.Old;
else
this.Value[Data.Prop] = undefined;
break;
}
case AscDFH.historyitem_TextPr_Bold:
{
if ( undefined != Data.Old )
this.Value.Bold = Data.Old;
else
this.Value.Bold = undefined;
break;
}
case AscDFH.historyitem_TextPr_Italic:
{
if ( undefined != Data.Old )
this.Value.Italic = Data.Old;
else
this.Value.Italic = undefined;
break;
}
case AscDFH.historyitem_TextPr_Strikeout:
{
if ( undefined != Data.Old )
this.Value.Strikeout = Data.Old;
else
this.Value.Strikeout = undefined;
break;
}
case AscDFH.historyitem_TextPr_Underline:
{
if ( undefined != Data.Old )
this.Value.Underline = Data.Old;
else
this.Value.Underline = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontFamily:
{
if ( undefined != Data.Old )
this.Value.FontFamily = Data.Old;
else
this.Value.FontFamily = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontSize:
{
if ( undefined != Data.Old )
this.Value.FontSize = Data.Old;
else
this.Value.FontSize = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontSizeCS:
{
if ( undefined != Data.Old )
this.Value.FontSizeCS = Data.Old;
else
this.Value.FontSizeCS = undefined;
break;
}
case AscDFH.historyitem_TextPr_Color:
{
if ( undefined != Data.Old )
this.Value.Color = Data.Old;
else
this.Value.Color = undefined;
break;
}
case AscDFH.historyitem_TextPr_VertAlign:
{
if ( undefined != Data.Old )
this.Value.VertAlign = Data.Old;
else
this.Value.VertAlign = undefined;
break;
}
case AscDFH.historyitem_TextPr_HighLight:
{
if ( undefined != Data.Old )
this.Value.HighLight = Data.Old;
else
this.Value.HighLight = undefined;
break;
}
case AscDFH.historyitem_TextPr_RStyle:
{
if ( undefined != Data.Old )
this.Value.RStyle = Data.Old;
else
this.Value.RStyle = undefined;
break;
}
case AscDFH.historyitem_TextPr_Spacing:
{
if ( undefined != Data.Old )
this.Value.Spacing = Data.Old;
else
this.Value.Spacing = undefined;
break;
}
case AscDFH.historyitem_TextPr_DStrikeout:
{
if ( undefined != Data.Old )
this.Value.DStrikeout = Data.Old;
else
this.Value.DStrikeout = undefined;
break;
}
case AscDFH.historyitem_TextPr_Caps:
{
if ( undefined != Data.Old )
this.Value.Caps = Data.Old;
else
this.Value.Caps = undefined;
break;
}
case AscDFH.historyitem_TextPr_SmallCaps:
{
if ( undefined != Data.Old )
this.Value.SmallCaps = Data.Old;
else
this.Value.SmallCaps = undefined;
break;
}
case AscDFH.historyitem_TextPr_Position:
{
if ( undefined != Data.Old )
this.Value.Position = Data.Old;
else
this.Value.Position = undefined;
break;
}
case AscDFH.historyitem_TextPr_Value:
{
this.Value = Data.Old;
break;
}
case AscDFH.historyitem_TextPr_RFonts:
{
if ( undefined != Data.Old )
this.Value.RFonts = Data.Old;
else
this.Value.RFonts = new CRFonts();
break;
}
case AscDFH.historyitem_TextPr_Lang:
{
if ( undefined != Data.Old )
this.Value.Lang = Data.Old;
else
this.Value.Lang = new CLang();
break;
}
case AscDFH.historyitem_TextPr_RFonts_Ascii:
{
if ( undefined != Data.Old )
this.Value.RFonts.Ascii = Data.Old;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_HAnsi:
{
if ( undefined != Data.Old )
this.Value.RFonts.Ascii = Data.Old;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_CS:
{
if ( undefined != Data.Old )
this.Value.RFonts.Ascii = Data.Old;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_EastAsia:
{
if ( undefined != Data.Old )
this.Value.RFonts.Ascii = Data.Old;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_Hint:
{
if ( undefined != Data.Old )
this.Value.RFonts.Ascii = Data.Old;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_Bidi:
{
if ( undefined != Data.Old )
this.Value.Lang.Bidi = Data.Old;
else
this.Value.Lang.Bidi = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_EastAsia:
{
if ( undefined != Data.Old )
this.Value.Lang.EastAsia = Data.Old;
else
this.Value.Lang.EastAsia = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_Val:
{
if ( undefined != Data.Old )
this.Value.Lang.Val = Data.Old;
else
this.Value.Lang.Val = undefined;
break;
}
case AscDFH.historyitem_TextPr_Unifill:
{
if ( undefined != Data.Old )
this.Value.Unifill = Data.Old;
else
this.Value.Unifill = undefined;
break;
}
case AscDFH.historyitem_TextPr_Outline:
{
if ( undefined != Data.Old )
this.Value.TextOutline = Data.Old;
else
this.Value.TextOutline = undefined;
break;
}
case AscDFH.historyitem_TextPr_Fill:
{
if ( undefined != Data.Old )
this.Value.TextFill = Data.Old;
else
this.Value.TextFill = undefined;
break;
}
}
},
Redo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case AscDFH.historyitem_TextPr_Change:
{
if ( undefined != Data.New )
this.Value[Data.Prop] = Data.New;
else
this.Value[Data.Prop] = undefined;
break;
}
case AscDFH.historyitem_TextPr_Bold:
{
if ( undefined != Data.New )
this.Value.Bold = Data.New;
else
this.Value.Bold = undefined;
break;
}
case AscDFH.historyitem_TextPr_Italic:
{
if ( undefined != Data.New )
this.Value.Italic = Data.New;
else
this.Value.Italic = undefined;
break;
}
case AscDFH.historyitem_TextPr_Strikeout:
{
if ( undefined != Data.New )
this.Value.Strikeout = Data.New;
else
this.Value.Strikeout = undefined;
break;
}
case AscDFH.historyitem_TextPr_Underline:
{
if ( undefined != Data.New )
this.Value.Underline = Data.New;
else
this.Value.Underline = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontFamily:
{
if ( undefined != Data.New )
this.Value.FontFamily = Data.New;
else
this.Value.FontFamily = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontSize:
{
if ( undefined != Data.New )
this.Value.FontSize = Data.New;
else
this.Value.FontSize = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontSizeCS:
{
if ( undefined != Data.New )
this.Value.FontSizeCS = Data.New;
else
this.Value.FontSizeCS = undefined;
break;
}
case AscDFH.historyitem_TextPr_Color:
{
if ( undefined != Data.New )
this.Value.Color = Data.New;
else
this.Value.Color = undefined;
break;
}
case AscDFH.historyitem_TextPr_VertAlign:
{
if ( undefined != Data.New )
this.Value.VertAlign = Data.New;
else
this.Value.VertAlign = undefined;
break;
}
case AscDFH.historyitem_TextPr_HighLight:
{
if ( undefined != Data.New )
this.Value.HighLight = Data.New;
else
this.Value.HighLight = undefined;
break;
}
case AscDFH.historyitem_TextPr_RStyle:
{
if ( undefined != Data.New )
this.Value.RStyle = Data.New;
else
this.Value.RStyle = undefined;
break;
}
case AscDFH.historyitem_TextPr_Spacing:
{
if ( undefined != Data.New )
this.Value.Spacing = Data.New;
else
this.Value.Spacing = undefined;
break;
}
case AscDFH.historyitem_TextPr_DStrikeout:
{
if ( undefined != Data.New )
this.Value.DStrikeout = Data.New;
else
this.Value.DStrikeout = undefined;
break;
}
case AscDFH.historyitem_TextPr_Caps:
{
if ( undefined != Data.New )
this.Value.Caps = Data.New;
else
this.Value.Caps = undefined;
break;
}
case AscDFH.historyitem_TextPr_SmallCaps:
{
if ( undefined != Data.New )
this.Value.SmallCaps = Data.New;
else
this.Value.SmallCaps = undefined;
break;
}
case AscDFH.historyitem_TextPr_Position:
{
if ( undefined != Data.New )
this.Value.Position = Data.New;
else
this.Value.Position = undefined;
break;
}
case AscDFH.historyitem_TextPr_Value:
{
this.Value = Data.New;
break;
}
case AscDFH.historyitem_TextPr_RFonts:
{
if ( undefined != Data.New )
this.Value.RFonts = Data.New;
else
this.Value.RFonts = new CRFonts();
break;
}
case AscDFH.historyitem_TextPr_Lang:
{
if ( undefined != Data.New )
this.Value.Lang = Data.New;
else
this.Value.Lang = new CLang();
break;
}
case AscDFH.historyitem_TextPr_RFonts_Ascii:
{
if ( undefined != Data.New )
this.Value.RFonts.Ascii = Data.New;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_HAnsi:
{
if ( undefined != Data.New )
this.Value.RFonts.Ascii = Data.New;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_CS:
{
if ( undefined != Data.New )
this.Value.RFonts.Ascii = Data.New;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_EastAsia:
{
if ( undefined != Data.New )
this.Value.RFonts.Ascii = Data.New;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_Hint:
{
if ( undefined != Data.New )
this.Value.RFonts.Ascii = Data.New;
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_Bidi:
{
if ( undefined != Data.New )
this.Value.Lang.Bidi = Data.New;
else
this.Value.Lang.Bidi = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_EastAsia:
{
if ( undefined != Data.New )
this.Value.Lang.EastAsia = Data.New;
else
this.Value.Lang.EastAsia = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_Val:
{
if ( undefined != Data.New )
this.Value.Lang.Val = Data.New;
else
this.Value.Lang.Val = undefined;
break;
}
case AscDFH.historyitem_TextPr_Unifill:
{
if ( undefined != Data.New )
this.Value.Unifill = Data.New;
else
this.Value.Unifill = undefined;
break;
}
case AscDFH.historyitem_TextPr_Outline:
{
if ( undefined != Data.New )
this.Value.TextOutline = Data.New;
else
this.Value.TextOutline = undefined;
break;
}
case AscDFH.historyitem_TextPr_Fill:
{
if ( undefined != Data.New )
this.Value.TextFill = Data.New;
else
this.Value.TextFill = undefined;
break;
}
}
},
Get_ParentObject_or_DocumentPos : function()
{
if ( null != this.Parent )
return this.Parent.Get_ParentObject_or_DocumentPos();
},
Refresh_RecalcData : function(Data)
{
if ( undefined !== this.Parent && null !== this.Parent )
this.Parent.Refresh_RecalcData2();
},
//-----------------------------------------------------------------------------------
// Функции для работы с совместным редактирования
//-----------------------------------------------------------------------------------
Write_ToBinary : function(Writer)
{
// Long : Type
// String : Id
Writer.WriteLong( this.Type );
Writer.WriteString2( this.Id );
},
Write_ToBinary2 : function(Writer)
{
Writer.WriteLong( AscDFH.historyitem_type_TextPr );
// Long : Type
// String : Id
// Long : Value
Writer.WriteLong( this.Type );
Writer.WriteString2( this.Id );
this.Value.Write_ToBinary( Writer );
},
Read_FromBinary2 : function(Reader)
{
this.Type = Reader.GetLong();
this.Id = Reader.GetString2();
this.Value.Clear();
this.Value.Read_FromBinary( Reader );
},
Save_Changes : function(Data, Writer)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer.WriteLong( AscDFH.historyitem_type_TextPr );
var Type = Data.Type;
// Пишем тип
Writer.WriteLong( Type );
switch ( Type )
{
case AscDFH.historyitem_TextPr_Change:
{
// Variable : TextPr
var TextPr = new CTextPr();
TextPr[Data.Prop] = Data.New;
TextPr.Write_ToBinary( Writer );
break;
}
case AscDFH.historyitem_TextPr_Bold:
case AscDFH.historyitem_TextPr_Italic:
case AscDFH.historyitem_TextPr_Strikeout:
case AscDFH.historyitem_TextPr_Underline:
{
// Bool : IsUndefined
// Bool : Value
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteBool( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_FontFamily:
{
// Bool : IsUndefined
// String : FontName
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Writer.WriteString2( Data.New.Name );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_TextPr_FontSize:
case AscDFH.historyitem_TextPr_FontSizeCS:
{
// Bool : IsUndefined
// Double : FontSize
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Writer.WriteDouble( Data.New );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_TextPr_Color:
case AscDFH.historyitem_TextPr_Unifill:
case AscDFH.historyitem_TextPr_Outline:
case AscDFH.historyitem_TextPr_Fill :
{
// Bool : IsUndefined
// Variable : Color (CDocumentColor)
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_TextPr_VertAlign:
{
// Bool : IsUndefined
// Long : VertAlign
if ( undefined != Data.New )
{
Writer.WriteBool(false);
Writer.WriteLong(Data.New);
}
else
Writer.WriteBool(true);
break;
}
case AscDFH.historyitem_TextPr_HighLight:
{
// Bool : IsUndefined
// Если false
// Bool : IsNone
// Если false
// Variable : Color (CDocumentColor)
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_TextPr_RStyle:
{
// Bool : IsUndefined
// Если false
// String : RStyle
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteString2( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_Spacing:
case AscDFH.historyitem_TextPr_Position:
{
// Bool : IsUndefined
// Если false
// Double : Spacing
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteDouble( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_DStrikeout:
case AscDFH.historyitem_TextPr_Caps:
case AscDFH.historyitem_TextPr_SmallCaps:
{
// Bool : IsUndefined
// Если false
// Bool : value
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteBool( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_Value:
{
// CTextPr
Data.New.Write_ToBinary(Writer);
break;
}
case AscDFH.historyitem_TextPr_RFonts:
{
// Bool : undefined ?
// false -> CRFonts
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_Lang:
{
// Bool : undefined ?
// false -> CLang
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Data.New.Write_ToBinary( Writer );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_RFonts_Ascii:
case AscDFH.historyitem_TextPr_RFonts_HAnsi:
case AscDFH.historyitem_TextPr_RFonts_CS:
case AscDFH.historyitem_TextPr_RFonts_EastAsia:
{
// Bool : undefined?
// false -> String
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteString2( Data.New.Name );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_RFonts_Hint:
{
// Bool : undefined?
// false -> Long
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
Writer.WriteBool( true );
break;
}
case AscDFH.historyitem_TextPr_Lang_Bidi:
case AscDFH.historyitem_TextPr_Lang_EastAsia:
case AscDFH.historyitem_TextPr_Lang_Val:
{
// Bool : undefined ?
// false -> Long
if ( undefined != Data.New )
{
Writer.WriteBool( false );
Writer.WriteLong( Data.New );
}
else
Writer.WriteBool( true );
break;
}
}
return Writer;
},
Load_Changes : function(Reader)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var ClassType = Reader.GetLong();
if ( AscDFH.historyitem_type_TextPr != ClassType )
return;
var Type = Reader.GetLong();
switch ( Type )
{
case AscDFH.historyitem_TextPr_Change:
{
// Variable : TextPr
var TextPr = new CTextPr();
TextPr.Read_FromBinary( Reader );
this.Value.Merge( TextPr );
break;
}
case AscDFH.historyitem_TextPr_Bold:
{
// Bool : IsUndefined
// Bool : Bold
if ( true === Reader.GetBool() )
this.Value.Bold = undefined;
else
this.Value.Bold = Reader.GetBool();
break;
}
case AscDFH.historyitem_TextPr_Italic:
{
// Bool : IsUndefined
// Bool : Italic
if ( true === Reader.GetBool() )
this.Value.Italic = undefined;
else
this.Value.Italic = Reader.GetBool();
break;
}
case AscDFH.historyitem_TextPr_Strikeout:
{
// Bool : IsUndefined
// Bool : Strikeout
if ( true === Reader.GetBool() )
this.Value.Strikeout = undefined;
else
this.Value.Strikeout = Reader.GetBool();
break;
}
case AscDFH.historyitem_TextPr_Underline:
{
// Bool : IsUndefined?
// Bool : Underline
if ( true != Reader.GetBool() )
this.Value.Underline = Reader.GetBool();
else
this.Value.Underline = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontFamily:
{
// Bool : IsUndefined
// String : FontName
if ( true != Reader.GetBool() )
{
this.Value.FontFamily =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Value.FontFamily = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontSize:
{
// Bool : IsUndefined
// Double : FontSize
if ( true != Reader.GetBool() )
this.Value.FontSize = Reader.GetDouble();
else
this.Value.FontSize = undefined;
break;
}
case AscDFH.historyitem_TextPr_FontSizeCS:
{
// Bool : IsUndefined
// Double : FontSize
if ( true != Reader.GetBool() )
this.Value.FontSizeCS = Reader.GetDouble();
else
this.Value.FontSizeCS = undefined;
break;
}
case AscDFH.historyitem_TextPr_Color:
{
// Bool : IsUndefined
// Variable : Color (CDocumentColor)
if ( true != Reader.GetBool() )
{
var r = Reader.GetByte();
var g = Reader.GetByte();
var b = Reader.GetByte();
this.Value.Color = new CDocumentColor( r, g, b );
}
else
this.Value.Color = undefined;
break;
}
case AscDFH.historyitem_TextPr_Unifill:
{
if ( true != Reader.GetBool() )
{
var unifill = new AscFormat.CUniFill();
unifill.Read_FromBinary(Reader);
this.Value.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.Value.Unifill = undefined;
break;
}
case AscDFH.historyitem_TextPr_Fill:
{
if ( true != Reader.GetBool() )
{
var unifill = new AscFormat.CUniFill();
unifill.Read_FromBinary(Reader);
this.Value.TextFill = unifill;
}
else
this.Value.TextFill = undefined;
break;
}
case AscDFH.historyitem_TextPr_Outline:
{
if ( true != Reader.GetBool() )
{
var line = new AscFormat.CLn();
line.Read_FromBinary(Reader);
this.Value.TextOutline = line;
}
else
this.Value.TextOutline = undefined;
break;
}
case AscDFH.historyitem_TextPr_VertAlign:
{
// Bool : IsUndefined
// Long : VertAlign
if ( true != Reader.GetBool() )
this.Value.VertAlign = Reader.GetLong();
else
this.Value.VertAlign = undefined;
break;
}
case AscDFH.historyitem_TextPr_HighLight:
{
// Bool : IsUndefined
// Если false
// Bool : IsNull
// Если false
// Variable : Color (CDocumentColor)
if ( true != Reader.GetBool() )
{
if ( true != Reader.GetBool() )
{
this.Value.HighLight = new CDocumentColor(0,0,0);
this.Value.HighLight.Read_FromBinary(Reader);
}
else
this.Value.HighLight = highlight_None;
}
else
this.Value.HighLight = undefined;
break;
}
case AscDFH.historyitem_TextPr_RStyle:
{
// Bool : IsUndefined
// Если false
// String : RStyle
if ( true != Reader.GetBool() )
this.Value.RStyle = Reader.GetString2();
else
this.Value.RStyle = undefined;
break;
}
case AscDFH.historyitem_TextPr_Spacing:
{
// Bool : IsUndefined
// Если false
// Double : Spacing
if ( true != Reader.GetBool() )
this.Value.Spacing = Reader.GetDouble();
else
this.Value.Spacing = undefined;
break;
}
case AscDFH.historyitem_TextPr_DStrikeout:
{
// Bool : IsUndefined
// Если false
// Bool : DStrikeout
if ( true != Reader.GetBool() )
this.Value.DStrikeout = Reader.GetBool();
else
this.Value.DStrikeout = undefined;
break;
}
case AscDFH.historyitem_TextPr_Caps:
{
// Bool : IsUndefined
// Если false
// Bool : Caps
if ( true != Reader.GetBool() )
this.Value.Caps = Reader.GetBool();
else
this.Value.Caps = undefined;
break;
}
case AscDFH.historyitem_TextPr_SmallCaps:
{
// Bool : IsUndefined
// Если false
// Bool : SmallCaps
if ( true != Reader.GetBool() )
this.Value.SmallCaps = Reader.GetBool();
else
this.Value.SmallCaps = undefined;
break;
}
case AscDFH.historyitem_TextPr_Position:
{
// Bool : IsUndefined
// Если false
// Double : Position
if ( true != Reader.GetBool() )
this.Value.Position = Reader.GetDouble();
else
this.Value.Position = undefined;
break;
}
case AscDFH.historyitem_TextPr_Value:
{
// CTextPr
this.Value = new CTextPr();
this.Value.Read_FromBinary( Reader );
break;
}
case AscDFH.historyitem_TextPr_RFonts:
{
// Bool : undefined ?
// false -> CRFonts
if ( false === Reader.GetBool() )
{
this.Value.RFonts = new CRFonts();
this.Value.RFonts.Read_FromBinary( Reader );
}
else
this.Value.RFonts = new CRFonts();
break;
}
case AscDFH.historyitem_TextPr_Lang:
{
// Bool : undefined ?
// false -> Lang
if ( false === Reader.GetBool() )
{
this.Value.Lang = new CLang();
this.Value.Lang.Read_FromBinary( Reader );
}
else
this.Value.Lang = new CLang();
break;
}
case AscDFH.historyitem_TextPr_RFonts_Ascii:
{
// Bool : undefined ?
// false -> String
if ( false === Reader.GetBool() )
{
this.Value.RFonts.Ascii =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_HAnsi:
{
// Bool : undefined ?
// false -> String
if ( false === Reader.GetBool() )
{
this.Value.RFonts.HAnsi =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Value.RFonts.HAnsi = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_CS:
{
// Bool : undefined ?
// false -> String
if ( false === Reader.GetBool() )
{
this.Value.RFonts.CS =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Value.RFonts.CS = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_EastAsia:
{
// Bool : undefined ?
// false -> String
if ( false === Reader.GetBool() )
{
this.Value.RFonts.EastAsia =
{
Name : Reader.GetString2(),
Index : -1
};
}
else
this.Value.RFonts.Ascii = undefined;
break;
}
case AscDFH.historyitem_TextPr_RFonts_Hint:
{
// Bool : undefined ?
// false -> Long
if ( false === Reader.GetBool() )
this.Value.RFonts.Hint = Reader.GetLong();
else
this.Value.RFonts.Hint = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_Bidi:
{
// Bool : undefined ?
// false -> Long
if ( false === Reader.GetBool() )
this.Value.Lang.Bidi = Reader.GetLong();
else
this.Value.Lang.Bidi = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_EastAsia:
{
// Bool : undefined ?
// false -> Long
if ( false === Reader.GetBool() )
this.Value.Lang.EastAsia = Reader.GetLong();
else
this.Value.Lang.EastAsia = undefined;
break;
}
case AscDFH.historyitem_TextPr_Lang_Val:
{
// Bool : undefined ?
// false -> Long
if ( false === Reader.GetBool() )
this.Value.Lang.Val = Reader.GetLong();
else
this.Value.Lang.Val = undefined;
break;
}
}
}
};
// Класс окончание параграфа ParaEnd // Класс окончание параграфа ParaEnd
function ParaEnd() function ParaEnd()
{ {
...@@ -8003,7 +5951,6 @@ function ParagraphContent_Read_FromBinary(Reader) ...@@ -8003,7 +5951,6 @@ function ParagraphContent_Read_FromBinary(Reader)
//--------------------------------------------------------export---------------------------------------------------- //--------------------------------------------------------export----------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {}; window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].ParaNewLine = ParaNewLine; window['AscCommonWord'].ParaNewLine = ParaNewLine;
window['AscCommonWord'].ParaTextPr = ParaTextPr;
window['AscCommonWord'].ParaDrawing = ParaDrawing; window['AscCommonWord'].ParaDrawing = ParaDrawing;
window['AscCommonWord'].break_Page = break_Page; window['AscCommonWord'].break_Page = break_Page;
......
...@@ -8626,6 +8626,9 @@ CTextPr.prototype = ...@@ -8626,6 +8626,9 @@ CTextPr.prototype =
if (this.Underline !== TextPr.Underline) if (this.Underline !== TextPr.Underline)
return false; return false;
if ((undefined === this.FontFamily && undefined !== TextPr.FontFamily) || (undefined !== this.FontFamily && (undefined === TextPr.FontFamily || this.FontFamily.Name !== TextPr.FontFamily.Name)))
return false;
if (false if (false
|| (undefined === this.FontSize || (undefined === this.FontSize
&& undefined !== TextPr.FontSize) && undefined !== TextPr.FontSize)
......
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