Commit d6f942d2 authored by Ilya Kirillov's avatar Ilya Kirillov

Added new class CSdtPr for storing properties of a CBlockLevelSdt class.

parent ce9b48af
......@@ -134,6 +134,8 @@
"../word/Editor/DocumentContentElementBase.js",
"../word/Editor/StructuredDocumentTags/BlockLevel.js",
"../word/Editor/StructuredDocumentTags/SdtPr.js",
"../word/Editor/StructuredDocumentTags/SdtPrChanges.js",
"../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js",
......
......@@ -136,6 +136,8 @@
"../slide/Editor/Format/Notes.js",
"../word/Editor/DocumentContentElementBase.js",
"../word/Editor/StructuredDocumentTags/BlockLevel.js",
"../word/Editor/StructuredDocumentTags/SdtPr.js",
"../word/Editor/StructuredDocumentTags/SdtPrChanges.js",
"../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/RevisionsChange.js",
......
......@@ -108,6 +108,8 @@
"../word/Editor/GraphicObjects/WrapManager.js",
"../word/Editor/DocumentContentElementBase.js",
"../word/Editor/StructuredDocumentTags/BlockLevel.js",
"../word/Editor/StructuredDocumentTags/SdtPr.js",
"../word/Editor/StructuredDocumentTags/SdtPrChanges.js",
"../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js",
......
......@@ -1103,6 +1103,7 @@
window['AscDFH'].historyitem_type_FootEndNote = 57 << 16;
window['AscDFH'].historyitem_type_Presentation = 58 << 16;
window['AscDFH'].historyitem_type_BlockLevelSdt = 59 << 16;
window['AscDFH'].historyitem_type_SdtPr = 60 << 16;
window['AscDFH'].historyitem_type_CommonShape = 1000 << 16; // Этот класс добавлен для элементов, у которых нет конкретного класса
......@@ -1649,6 +1650,14 @@
window['AscDFH'].historyitem_Footnotes_SetFootnotePrNumRestart = window['AscDFH'].historyitem_type_Footnotes | 7;
window['AscDFH'].historyitem_Footnotes_SetFootnotePrNumFormat = window['AscDFH'].historyitem_type_Footnotes | 8;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CSdtPr
//------------------------------------------------------------------------------------------------------------------
window['AscDFH'].historyitem_SdtPr_Alias = window['AscDFH'].historyitem_type_SdtPr | 1;
window['AscDFH'].historyitem_SdtPr_Id = window['AscDFH'].historyitem_type_SdtPr | 2;
window['AscDFH'].historyitem_SdtPr_Tag = window['AscDFH'].historyitem_type_SdtPr | 3;
window['AscDFH'].historyitem_SdtPr_Label = window['AscDFH'].historyitem_type_SdtPr | 4;
window['AscDFH'].historyitem_SdtPr_Lock = window['AscDFH'].historyitem_type_SdtPr | 5;
//------------------------------------------------------------------------------------------------------------------
// Графические классы общего назначение (без привязки к конкретному классу)
//------------------------------------------------------------------------------------------------------------------
window['AscDFH'].historyitem_AutoShapes_SetDrawingBaseCoors = window['AscDFH'].historyitem_type_CommonShape | 101;
......
......@@ -15162,6 +15162,10 @@ CDocument.prototype.GetAllContentControls = function()
}
return arrContentControls;
};
CDocument.prototype.SelectContentControl = function(oContentControl)
{
};
function CDocumentSelectionState()
{
......
......@@ -51,6 +51,7 @@ function CBlockLevelSdt(oLogicDocument, oParent)
this.LogicDocument = oLogicDocument;
this.Content = new CDocumentContent(this, oLogicDocument ? oLogicDocument.Get_DrawingDocument() : null, 0, 0, 0, 0, true, false, false);
this.Pr = new CSdtPr();
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add(this, this.Id);
......@@ -760,6 +761,9 @@ CBlockLevelSdt.prototype.Refresh_RecalcData2 = function(CurPage)
{
this.Parent.Refresh_RecalcData2(this.Index, CurPage);
};
CBlockLevelSdt.prototype.Refresh_RecalcData = function(Data)
{
};
CBlockLevelSdt.prototype.Check_AutoFit = function()
{
return this.Parent.Check_AutoFit();
......@@ -838,6 +842,52 @@ CBlockLevelSdt.prototype.GetDocumentPositionFromObject = function(PosArray)
return PosArray;
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt.prototype.SetAlias = function(sAlias)
{
History.Add(new CChangesSdtPrAlias(this, this.Pr.Alias, sAlias));
this.Pr.Alias = sAlias;
};
CBlockLevelSdt.prototype.GetAlias = function()
{
return (undefined !== this.Pr.Alias ? this.Pr.Alias : "");
};
CBlockLevelSdt.prototype.SetContentControlId = function(Id)
{
History.Add(new CChangesSdtPrId(this, this.Pr.Id, Id));
this.Pr.Id = Id;
};
CBlockLevelSdt.prototype.GetContentControlId = function()
{
return this.Pr.Id;
};
CBlockLevelSdt.prototype.SetTag = function(sTag)
{
History.Add(new CChangesSdtPrTag(this, this.Pr.Tag, sTag));
this.Pr.Tag = sTag;
};
CBlockLevelSdt.prototype.GetTag = function()
{
return (undefined !== this.Pr.Tag ? this.Pr.Tag : "");
};
CBlockLevelSdt.prototype.SetLabel = function(sLabel)
{
History.Add(new CChangesSdtPrLabel(this, this.Pr.Label, sLabel));
this.Pr.Label = sLabel;
};
CBlockLevelSdt.prototype.GetLabel = function()
{
return (undefined !== this.Pr.Label ? this.Pr.Label : "");
};
CBlockLevelSdt.prototype.SetContentControlLock = function(nLockType)
{
History.Add(new CChangesSdtPrLock(this, this.Pr.Lock, nLockType));
this.Pr.Lock = nLockType;
};
CBlockLevelSdt.prototype.GetContentControlLock = function()
{
return (undefined !== this.Pr.Lock ? this.Pr.Lock : sdtlock_Unlocked);
};
//--------------------------------------------------------export--------------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].CBlockLevelSdt = CBlockLevelSdt;
......
/*
* (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: 03.05.2017
* Time: 12:12
*/
var sdtlock_Unlocked = 0x00;
var sdtlock_ContentLocked = 0x01;
var sdtlock_SdtContentLocked = 0x02;
var sdtlock_SdtLocked = 0x03;
function CSdtPr()
{
this.Alias = undefined;
this.Id = undefined;
this.Tag = undefined;
this.Label = undefined;
this.Lock = undefined;
}
CSdtPr.prototype.Copy = function()
{
var oPr = new CSdtPr();
oPr.Alias = this.Alias;
oPr.Id = this.Id;
oPr.Tag = this.Tag;
oPr.Label = this.Label;
oPr.Lock = this.Lock;
return oPr;
};
CSdtPr.prototype.Write_ToBinary = function(Writer)
{
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
var Flags = 0;
if (undefined !== this.Alias)
{
Writer.WriteString2(this.Alias);
Flags |= 1;
}
if (undefined !== this.Id)
{
Writer.WriteLong(this.Id);
Flags |= 2;
}
if (undefined !== this.Tag)
{
Writer.WriteString2(this.Tag);
Flags |= 4;
}
if (undefined !== this.Label)
{
Writer.WriteString2(this.Tag);
Flags |= 8;
}
if (undefined !== this.Lock)
{
Writer.WriteLong(this.Lock);
Flags |= 16;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos );
Writer.WriteLong( Flags );
Writer.Seek( EndPos );
};
CSdtPr.prototype.Read_FromBinary = function(Reader)
{
var Flags = Reader.GetLong();
if (Flags & 1)
this.Alias = Reader.GetString2();
if (Flags & 2)
this.Id = Reader.GetLong();
if (Flags & 4)
this.Tag = Reader.GetString2();
if (Flags & 8)
this.Tag = Reader.GetString2();
if (Flags & 16)
this.Lock = Reader.GetLong();
};
//--------------------------------------------------------export--------------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].CSdtPr = CSdtPr;
window['AscCommonWord'].sdtlock_Unlocked = sdtlock_Unlocked;
window['AscCommonWord'].sdtlock_ContentLocked = sdtlock_ContentLocked;
window['AscCommonWord'].sdtlock_SdtContentLocked = sdtlock_SdtContentLocked;
window['AscCommonWord'].sdtlock_SdtLocked = sdtlock_SdtLocked;
/*
* (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: 03.05.2017
* Time: 14:58
*/
AscDFH.changesFactory[AscDFH.historyitem_SdtPr_Alias] = CChangesSdtPrAlias;
AscDFH.changesFactory[AscDFH.historyitem_SdtPr_Id] = CChangesSdtPrId;
AscDFH.changesFactory[AscDFH.historyitem_SdtPr_Tag] = CChangesSdtPrTag;
AscDFH.changesFactory[AscDFH.historyitem_SdtPr_Label] = CChangesSdtPrLabel;
AscDFH.changesFactory[AscDFH.historyitem_SdtPr_Lock] = CChangesSdtPrLock;
//----------------------------------------------------------------------------------------------------------------------
// Карта зависимости изменений
//----------------------------------------------------------------------------------------------------------------------
AscDFH.changesRelationMap[AscDFH.historyitem_SdtPr_Alias] = [
AscDFH.historyitem_SdtPr_Alias
];
AscDFH.changesRelationMap[AscDFH.historyitem_SdtPr_Id] = [
AscDFH.historyitem_SdtPr_Id
];
AscDFH.changesRelationMap[AscDFH.historyitem_SdtPr_Tag] = [
AscDFH.historyitem_SdtPr_Tag
];
AscDFH.changesRelationMap[AscDFH.historyitem_SdtPr_Label] = [
AscDFH.historyitem_SdtPr_Label
];
AscDFH.changesRelationMap[AscDFH.historyitem_SdtPr_Lock] = [
AscDFH.historyitem_SdtPr_Lock
];
//----------------------------------------------------------------------------------------------------------------------
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringProperty}
*/
function CChangesSdtPrAlias(Class, Old, New)
{
AscDFH.CChangesBaseStringProperty.call(this, Class, Old, New);
}
CChangesSdtPrAlias.prototype = Object.create(AscDFH.CChangesBaseStringProperty.prototype);
CChangesSdtPrAlias.prototype.constructor = CChangesSdtPrAlias;
CChangesSdtPrAlias.prototype.Type = AscDFH.historyitem_SdtPr_Alias;
CChangesSdtPrAlias.prototype.private_SetValue = function(Value)
{
this.Class.Pr.Alias = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesSdtPrId(Class, Old, New)
{
AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New);
}
CChangesSdtPrId.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);
CChangesSdtPrId.prototype.constructor = CChangesSdtPrId;
CChangesSdtPrId.prototype.Type = AscDFH.historyitem_SdtPr_Id;
CChangesSdtPrId.prototype.private_SetValue = function(Value)
{
this.Class.Pr.Id = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringProperty}
*/
function CChangesSdtPrTag(Class, Old, New)
{
AscDFH.CChangesBaseStringProperty.call(this, Class, Old, New);
}
CChangesSdtPrTag.prototype = Object.create(AscDFH.CChangesBaseStringProperty.prototype);
CChangesSdtPrTag.prototype.constructor = CChangesSdtPrTag;
CChangesSdtPrTag.prototype.Type = AscDFH.historyitem_SdtPr_Tag;
CChangesSdtPrTag.prototype.private_SetValue = function(Value)
{
this.Class.Pr.Tag = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringProperty}
*/
function CChangesSdtPrLabel(Class, Old, New)
{
AscDFH.CChangesBaseStringProperty.call(this, Class, Old, New);
}
CChangesSdtPrLabel.prototype = Object.create(AscDFH.CChangesBaseStringProperty.prototype);
CChangesSdtPrLabel.prototype.constructor = CChangesSdtPrLabel;
CChangesSdtPrLabel.prototype.Type = AscDFH.historyitem_SdtPr_Label;
CChangesSdtPrLabel.prototype.private_SetValue = function(Value)
{
this.Class.Pr.Label = Value;
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function CChangesSdtPrLock(Class, Old, New)
{
AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New);
}
CChangesSdtPrLock.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);
CChangesSdtPrLock.prototype.constructor = CChangesSdtPrLock;
CChangesSdtPrLock.prototype.Type = AscDFH.historyitem_SdtPr_Lock;
CChangesSdtPrLock.prototype.private_SetValue = function(Value)
{
this.Class.Pr.Lock = Value;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment