Commit ca596ded authored by Ilya Kirillov's avatar Ilya Kirillov

Class CRevisionsChange was moved to a separated file. Added a base class for...

Class CRevisionsChange was moved to a separated file. Added a base class for an elements of document content.
parent 418c03fa
...@@ -132,10 +132,13 @@ ...@@ -132,10 +132,13 @@
"../cell/model/DrawingObjects/Format/GroupPrototype.js", "../cell/model/DrawingObjects/Format/GroupPrototype.js",
"../cell/model/DrawingObjects/Format/ChartSpacePrototype.js", "../cell/model/DrawingObjects/Format/ChartSpacePrototype.js",
"../word/Editor/DocumentContentElementBase.js",
"../word/Editor/StructuredDocumentTags/BlockLevel.js",
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js", "../word/Editor/StylesChanges.js",
"../word/Editor/RevisionsChange.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
......
...@@ -131,8 +131,11 @@ ...@@ -131,8 +131,11 @@
"../slide/Editor/Format/SlideMaster.js", "../slide/Editor/Format/SlideMaster.js",
"../slide/Editor/Format/Layout.js", "../slide/Editor/Format/Layout.js",
"../slide/Editor/Format/Comments.js", "../slide/Editor/Format/Comments.js",
"../word/Editor/DocumentContentElementBase.js",
"../word/Editor/StructuredDocumentTags/BlockLevel.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js", "../word/Editor/StylesChanges.js",
"../word/Editor/RevisionsChange.js",
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
"../word/Editor/NumberingChanges.js", "../word/Editor/NumberingChanges.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
......
...@@ -106,10 +106,13 @@ ...@@ -106,10 +106,13 @@
"../word/Editor/GraphicObjects/GraphicObjects.js", "../word/Editor/GraphicObjects/GraphicObjects.js",
"../word/Editor/GraphicObjects/GraphicPage.js", "../word/Editor/GraphicObjects/GraphicPage.js",
"../word/Editor/GraphicObjects/WrapManager.js", "../word/Editor/GraphicObjects/WrapManager.js",
"../word/Editor/DocumentContentElementBase.js",
"../word/Editor/StructuredDocumentTags/BlockLevel.js",
"../word/Editor/Comments.js", "../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js", "../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js", "../word/Editor/StylesChanges.js",
"../word/Editor/RevisionsChange.js",
"../word/Editor/FlowObjects.js", "../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js", "../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js", "../word/Editor/ParagraphContentBase.js",
......
...@@ -2448,7 +2448,7 @@ CDocument.prototype.Recalculate_PageColumn = function() ...@@ -2448,7 +2448,7 @@ CDocument.prototype.Recalculate_PageColumn = function()
}; };
if (type_Table === Element.GetType()) if (type_Table === Element.GetType())
this.private_RecalculateFlowTable(RecalcInfo) this.private_RecalculateFlowTable(RecalcInfo);
else if (type_Paragraph === Element.Get_Type()) else if (type_Paragraph === Element.Get_Type())
this.private_RecalculateFlowParagraph(RecalcInfo); this.private_RecalculateFlowParagraph(RecalcInfo);
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* 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: 05.04.2017
* Time: 11:42
*/
/**
* Базовый класс для элементов содержимого документа (Paragraph, CTable, CBlockLevelSdt)
* @constructor
*/
function CDocumentContentElementBase()
{
}
\ No newline at end of file
This diff is collapsed.
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* 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: 05.04.2017
* Time: 14:41
*/
/**
* Класс для отображения изменения сделанного в режиме рецензирования
* @constructor
*/
function CRevisionsChange()
{
this.Type = c_oAscRevisionsChangeType.Unknown;
this.X = 0;
this.Y = 0;
this.Value = "";
this.UserName = "";
this.UserId = "";
this.DateTime = "";
this.UserColor = new AscCommon.CColor(0, 0, 0, 255);
this.Paragraph = null;
this.StartPos = null;
this.EndPos = null;
this._X = 0;
this._Y = 0;
this._PageNum = 0;
this._PosChanged = false;
}
CRevisionsChange.prototype.get_UserId = function(){return this.UserId;};
CRevisionsChange.prototype.put_UserId = function(UserId)
{
this.UserId = UserId;
this.private_UpdateUserColor();
};
CRevisionsChange.prototype.get_UserName = function(){return this.UserName;};
CRevisionsChange.prototype.put_UserName = function(UserName)
{
this.UserName = UserName;
this.private_UpdateUserColor();
};
CRevisionsChange.prototype.get_DateTime = function(){return this.DateTime};
CRevisionsChange.prototype.put_DateTime = function(DateTime){this.DateTime = DateTime};
CRevisionsChange.prototype.get_UserColor = function(){return this.UserColor;};
CRevisionsChange.prototype.get_StartPos = function(){return this.StartPos};
CRevisionsChange.prototype.put_StartPos = function(StartPos){this.StartPos = StartPos;};
CRevisionsChange.prototype.get_EndPos = function(){return this.EndPos};
CRevisionsChange.prototype.put_EndPos = function(EndPos){this.EndPos = EndPos;};
CRevisionsChange.prototype.get_Type = function(){return this.Type;};
CRevisionsChange.prototype.get_X = function(){return this.X;};
CRevisionsChange.prototype.get_Y = function(){return this.Y;};
CRevisionsChange.prototype.get_Value = function(){return this.Value;};
CRevisionsChange.prototype.put_Type = function(Type){this.Type = Type;};
CRevisionsChange.prototype.put_XY = function(X, Y){this.X = X; this.Y = Y;};
CRevisionsChange.prototype.put_Value = function(Value){this.Value = Value;};
CRevisionsChange.prototype.put_Paragraph = function(Para){this.Paragraph = Para;};
CRevisionsChange.prototype.get_Paragraph = function(){return this.Paragraph;};
CRevisionsChange.prototype.get_LockUserId = function()
{
if (this.Paragraph)
{
var Lock = this.Paragraph.Get_Lock();
var LockType = Lock.Get_Type();
if (locktype_Mine !== LockType && locktype_None !== LockType)
return Lock.Get_UserId();
}
return null;
};
CRevisionsChange.prototype.put_InternalPos = function(x, y, pageNum)
{
if (this._PageNum !== pageNum
|| Math.abs(this._X - x) > 0.001
|| Math.abs(this._Y - y) > 0.001)
{
this._X = x;
this._Y = y;
this._PageNum = pageNum;
this._PosChanged = true;
}
else
{
this._PosChanged = false;
}
};
CRevisionsChange.prototype.get_InternalPosX = function()
{
return this._X;
};
CRevisionsChange.prototype.get_InternalPosY = function()
{
return this._Y;
};
CRevisionsChange.prototype.get_InternalPosPageNum = function()
{
return this._PageNum;
};
CRevisionsChange.prototype.ComparePrevPosition = function()
{
if (true === this._PosChanged)
return false;
return true;
};
CRevisionsChange.prototype.private_UpdateUserColor = function()
{
this.UserColor = AscCommon.getUserColorById(this.UserId, this.UserName, true, false);
};
//--------------------------------------------------------export--------------------------------------------------------
CRevisionsChange.prototype['get_UserId'] = CRevisionsChange.prototype.get_UserId;
CRevisionsChange.prototype['put_UserId'] = CRevisionsChange.prototype.put_UserId;
CRevisionsChange.prototype['get_UserName'] = CRevisionsChange.prototype.get_UserName;
CRevisionsChange.prototype['put_UserName'] = CRevisionsChange.prototype.put_UserName;
CRevisionsChange.prototype['get_DateTime'] = CRevisionsChange.prototype.get_DateTime;
CRevisionsChange.prototype['put_DateTime'] = CRevisionsChange.prototype.put_DateTime;
CRevisionsChange.prototype['get_UserColor'] = CRevisionsChange.prototype.get_UserColor;
CRevisionsChange.prototype['get_StartPos'] = CRevisionsChange.prototype.get_StartPos;
CRevisionsChange.prototype['put_StartPos'] = CRevisionsChange.prototype.put_StartPos;
CRevisionsChange.prototype['get_EndPos'] = CRevisionsChange.prototype.get_EndPos;
CRevisionsChange.prototype['put_EndPos'] = CRevisionsChange.prototype.put_EndPos;
CRevisionsChange.prototype['get_Type'] = CRevisionsChange.prototype.get_Type;
CRevisionsChange.prototype['get_X'] = CRevisionsChange.prototype.get_X;
CRevisionsChange.prototype['get_Y'] = CRevisionsChange.prototype.get_Y;
CRevisionsChange.prototype['get_Value'] = CRevisionsChange.prototype.get_Value;
CRevisionsChange.prototype['put_Type'] = CRevisionsChange.prototype.put_Type;
CRevisionsChange.prototype['put_XY'] = CRevisionsChange.prototype.put_XY;
CRevisionsChange.prototype['put_Value'] = CRevisionsChange.prototype.put_Value;
CRevisionsChange.prototype['get_LockUserId'] = CRevisionsChange.prototype.get_LockUserId;
\ No newline at end of file
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* 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: 04.04.2017
* Time: 17:00
*/
/**
*
* @param oLogicDocument
* @constructor
* @extends {CDocumentContentElementBase}
*/
function CBlockLevelSdt(oLogicDocument)
{
CDocumentContentElementBase.call(this);
this.LogicDocument = oLogicDocument;
this.Content = new CDocumentContent(this, oLogicDocument.Get_DrawingDocument(), 0, 0, 0, 0, true, false, false);
this.Index = -1;
this.X = 0;
this.Y = 0;
this.XLimit = 0;
this.YLimit = 0;
this.PageNum = 0;
this.ColumnNum = 0;
this.ColumnsCount = 0;
}
CBlockLevelSdt.prototype = Object.create(CDocumentContentElementBase.prototype);
CBlockLevelSdt.prototype.constructor = CBlockLevelSdt;
CBlockLevelSdt.prototype.Is_Inline = function()
{
return true;
};
CBlockLevelSdt.prototype.Set_DocumentIndex = function(nIndex)
{
this.Index = nIndex;
};
CBlockLevelSdt.prototype.Reset = function(X, Y, XLimit, YLimit, PageAbs, ColumnAbs, ColumnsCount)
{
this.Content.Reset(X, Y, XLimit, YLimit);
this.Content.Set_StartPage(0);
this.X = X;
this.Y = Y;
this.XLimit = XLimit;
this.YLimit = YLimit;
this.PageNum = PageAbs;
this.ColumnNum = ColumnAbs ? ColumnAbs : 0;
this.ColumnsCount = ColumnsCount ? ColumnsCount : 1;
};
CBlockLevelSdt.prototype.Recalculate_Page = function(CurPage)
{
var RecalcResult = this.Content.Recalculate_Page(CurPage, true);
return RecalcResult;
};
CBlockLevelSdt.prototype.Get_PageBounds = function(CurPage)
{
return this.Content.Get_PageBounds(CurPage);
};
CBlockLevelSdt.prototype.Is_EmptyPage = function(CurPage)
{
// TODO: Реализовать
return false;
};
CBlockLevelSdt.prototype.Reset_RecalculateCache = function()
{
this.Content.Reset_RecalculateCache();
};
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