Commit 6de3a0f6 authored by Ilya Kirillov's avatar Ilya Kirillov Committed by Alexander.Trofimov

Добавлены недостающие константы для истории. Начал делать работу с нумерацией в билдере.

parent dc1ea6ef
...@@ -1191,8 +1191,10 @@ var historyitem_Style_UnhideWhenUsed = 109; // Изменяем UnhideWhenUsed ...@@ -1191,8 +1191,10 @@ var historyitem_Style_UnhideWhenUsed = 109; // Изменяем UnhideWhenUsed
var historyitem_Style_Link = 110; // Изменяем Link var historyitem_Style_Link = 110; // Изменяем Link
// Типы изменений в классе CStyles // Типы изменений в классе CStyles
var historyitem_Styles_Add = 1; // Добавляем стиль var historyitem_Styles_Add = 1; // Добавляем стиль
var historyitem_Styles_Remove = 2; // Удаляем стиль var historyitem_Styles_Remove = 2; // Удаляем стиль
var historyitem_Styles_ChangeDefaultTextPr = 3; // Изменяем настройки текста по умолчанию
var historyitem_Styles_ChangeDefaultParaPr = 4; // Изменяем настройки параграфа по умолчанию
// Тип изменений в классе CSectionPr // Тип изменений в классе CSectionPr
var historyitem_Section_PageSize_Orient = 1; // Меняем ориентацию страницы var historyitem_Section_PageSize_Orient = 1; // Меняем ориентацию страницы
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
{ {
/** /**
* @global * @global
* @class
* @name Api
*/ */
var Api = window["asc_docs_api"]; var Api = window["asc_docs_api"];
...@@ -113,6 +115,16 @@ ...@@ -113,6 +115,16 @@
this.Num = Num; this.Num = Num;
} }
/**
* Class representing a reference to a specified level of the numbering.
* @constructor
*/
function ApiNumPrLvl(NumPr, Lvl)
{
this.Num = NumPr;
this.Lvl = Math.max(0, Math.min(8, Lvl));
}
/** /**
* Twentieths of a point (equivalent to 1/1440th of an inch). * Twentieths of a point (equivalent to 1/1440th of an inch).
* @typedef {number} twips * @typedef {number} twips
...@@ -179,7 +191,7 @@ ...@@ -179,7 +191,7 @@
/** /**
* Get main document * Get main document
* @method * @memberof Api
* @returns {ApiDocument} * @returns {ApiDocument}
*/ */
Api.prototype.GetDocument = function() Api.prototype.GetDocument = function()
...@@ -188,7 +200,7 @@ ...@@ -188,7 +200,7 @@
}; };
/** /**
* Create new paragraph * Create new paragraph
* @method * @memberof Api
* @returns {ApiParagraph} * @returns {ApiParagraph}
*/ */
Api.prototype.CreateParagraph = function() Api.prototype.CreateParagraph = function()
...@@ -197,7 +209,7 @@ ...@@ -197,7 +209,7 @@
}; };
/** /**
* Create new table * Create new table
* @method * @memberof Api
* @param {number} nCols * @param {number} nCols
* @param {number} nRows * @param {number} nRows
* @returns {ApiTable} * @returns {ApiTable}
...@@ -723,9 +735,27 @@ ...@@ -723,9 +735,27 @@
*/ */
ApiParagraph.prototype.SetNumPr = function(oNumPr, nLvl) ApiParagraph.prototype.SetNumPr = function(oNumPr, nLvl)
{ {
this.GetParaPr().SetTabs(oNumPr, nLvl); this.GetParaPr().SetNumPr(oNumPr, nLvl);
};
/**
* Get a numbering defenition and numbering level.
* @returns {?ApiNumPrLvl}
*/
ApiParagraph.prototype.GetNumPr = function()
{
var oNumPr = this.Paragraph.Numbering_Get();
if (!oNumPr)
return null;
var oLogicDocument = private_GetLogicDocument();
var oGlobalNumbering = oLogicDocument.Get_Numbering();
var oNumbering = oGlobalNumbering.Get_AbstractNum(oNumPr.NumId);
if (!oNumbering)
return null;
return new ApiNumPrLvl(oNumbering, oNumPr.Lvl);
}; };
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
// //
// ApiRun // ApiRun
...@@ -1987,6 +2017,37 @@ ...@@ -1987,6 +2017,37 @@
// //
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
//
// ApiNumPr
//
//------------------------------------------------------------------------------------------------------------------
/**
* Get a numbering defenition.
* @returns {ApiNumPr}
*/
ApiNumPrLvl.prototype.GetNumbering = function()
{
return new ApiNumPr(this.Num);
};
/**
* Get level index.
* @returns {number}
*/
ApiNumPrLvl.prototype.GetLevel = function()
{
return this.Lvl;
};
/**
* Set level index.
* @param {number} nLevel - Index of the level in the current numbering. This value MUST BE from 0 to 8.
*/
ApiNumPrLvl.prototype.SetLevel = function(nLevel)
{
this.Lvl = Math.max(0, Math.min(8, nLevel));
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Export // Export
...@@ -2037,6 +2098,7 @@ ...@@ -2037,6 +2098,7 @@
ApiParagraph.prototype["SetWidowControl"] = ApiParagraph.prototype.SetWidowControl; ApiParagraph.prototype["SetWidowControl"] = ApiParagraph.prototype.SetWidowControl;
ApiParagraph.prototype["SetTabs"] = ApiParagraph.prototype.SetTabs; ApiParagraph.prototype["SetTabs"] = ApiParagraph.prototype.SetTabs;
ApiParagraph.prototype["SetNumPr"] = ApiParagraph.prototype.SetNumPr; ApiParagraph.prototype["SetNumPr"] = ApiParagraph.prototype.SetNumPr;
ApiParagraph.prototype["GetNumPr"] = ApiParagraph.prototype.GetNumPr;
ApiRun.prototype["GetTextPr"] = ApiRun.prototype.GetTextPr; ApiRun.prototype["GetTextPr"] = ApiRun.prototype.GetTextPr;
...@@ -2076,6 +2138,7 @@ ...@@ -2076,6 +2138,7 @@
ApiTable.prototype["MergeCells"] = ApiTable.prototype.MergeCells; ApiTable.prototype["MergeCells"] = ApiTable.prototype.MergeCells;
ApiTable.prototype["SetStyle"] = ApiTable.prototype.SetStyle; ApiTable.prototype["SetStyle"] = ApiTable.prototype.SetStyle;
ApiTable.prototype["SetWidth"] = ApiTable.prototype.SetWidth; ApiTable.prototype["SetWidth"] = ApiTable.prototype.SetWidth;
ApiTable.prototype["SetJc"] = ApiTable.prototype.SetJc;
ApiTable.prototype["SetTableLook"] = ApiTable.prototype.SetTableLook; ApiTable.prototype["SetTableLook"] = ApiTable.prototype.SetTableLook;
ApiTable.prototype["SetTableBorderTop"] = ApiTable.prototype.SetTableBorderTop; ApiTable.prototype["SetTableBorderTop"] = ApiTable.prototype.SetTableBorderTop;
ApiTable.prototype["SetTableBorderBottom"] = ApiTable.prototype.SetTableBorderBottom; ApiTable.prototype["SetTableBorderBottom"] = ApiTable.prototype.SetTableBorderBottom;
...@@ -2138,6 +2201,10 @@ ...@@ -2138,6 +2201,10 @@
ApiParaPr.prototype["SetTabs"] = ApiParaPr.prototype.SetTabs; ApiParaPr.prototype["SetTabs"] = ApiParaPr.prototype.SetTabs;
ApiParaPr.prototype["SetNumPr"] = ApiParaPr.prototype.SetNumPr; ApiParaPr.prototype["SetNumPr"] = ApiParaPr.prototype.SetNumPr;
ApiNumPrLvl.prototype["GetNumbering"] = ApiNumPrLvl.prototype.GetNumbering;
ApiNumPrLvl.prototype["GetLevel"] = ApiNumPrLvl.prototype.GetLevel;
ApiNumPrLvl.prototype["SetLevel"] = ApiNumPrLvl.prototype.SetLevel;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Private area // Private area
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
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