Commit 80ebb0ff authored by Ilya Kirillov's avatar Ilya Kirillov

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

parent f8268725
......@@ -1214,8 +1214,10 @@ var historyitem_Style_UnhideWhenUsed = 109; // Изменяем UnhideWhenUsed
var historyitem_Style_Link = 110; // Изменяем Link
// Типы изменений в классе CStyles
var historyitem_Styles_Add = 1; // Добавляем стиль
var historyitem_Styles_Remove = 2; // Удаляем стиль
var historyitem_Styles_Add = 1; // Добавляем стиль
var historyitem_Styles_Remove = 2; // Удаляем стиль
var historyitem_Styles_ChangeDefaultTextPr = 3; // Изменяем настройки текста по умолчанию
var historyitem_Styles_ChangeDefaultParaPr = 4; // Изменяем настройки параграфа по умолчанию
// Тип изменений в классе CSectionPr
var historyitem_Section_PageSize_Orient = 1; // Меняем ориентацию страницы
......
......@@ -34,6 +34,8 @@
{
/**
* @global
* @class
* @name Api
*/
var Api = window["asc_docs_api"];
......@@ -138,6 +140,16 @@
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).
* @typedef {number} twips
......@@ -204,7 +216,7 @@
/**
* Get main document
* @method
* @memberof Api
* @returns {ApiDocument}
*/
Api.prototype.GetDocument = function()
......@@ -213,7 +225,7 @@
};
/**
* Create new paragraph
* @method
* @memberof Api
* @returns {ApiParagraph}
*/
Api.prototype.CreateParagraph = function()
......@@ -222,7 +234,7 @@
};
/**
* Create new table
* @method
* @memberof Api
* @param {number} nCols
* @param {number} nRows
* @returns {ApiTable}
......@@ -748,9 +760,27 @@
*/
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
......@@ -2012,6 +2042,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
......@@ -2062,6 +2123,7 @@
ApiParagraph.prototype["SetWidowControl"] = ApiParagraph.prototype.SetWidowControl;
ApiParagraph.prototype["SetTabs"] = ApiParagraph.prototype.SetTabs;
ApiParagraph.prototype["SetNumPr"] = ApiParagraph.prototype.SetNumPr;
ApiParagraph.prototype["GetNumPr"] = ApiParagraph.prototype.GetNumPr;
ApiRun.prototype["GetTextPr"] = ApiRun.prototype.GetTextPr;
......@@ -2101,6 +2163,7 @@
ApiTable.prototype["MergeCells"] = ApiTable.prototype.MergeCells;
ApiTable.prototype["SetStyle"] = ApiTable.prototype.SetStyle;
ApiTable.prototype["SetWidth"] = ApiTable.prototype.SetWidth;
ApiTable.prototype["SetJc"] = ApiTable.prototype.SetJc;
ApiTable.prototype["SetTableLook"] = ApiTable.prototype.SetTableLook;
ApiTable.prototype["SetTableBorderTop"] = ApiTable.prototype.SetTableBorderTop;
ApiTable.prototype["SetTableBorderBottom"] = ApiTable.prototype.SetTableBorderBottom;
......@@ -2163,6 +2226,10 @@
ApiParaPr.prototype["SetTabs"] = ApiParaPr.prototype.SetTabs;
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
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
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