Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
80ebb0ff
Commit
80ebb0ff
authored
Apr 18, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавлены недостающие константы для истории. Начал делать работу с нумерацией в билдере.
parent
f8268725
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
7 deletions
+76
-7
common/Drawings/Format/Constants.js
common/Drawings/Format/Constants.js
+4
-2
word/apiBuilder.js
word/apiBuilder.js
+72
-5
No files found.
common/Drawings/Format/Constants.js
View file @
80ebb0ff
...
...
@@ -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
;
// Меняем ориентацию страницы
...
...
word/apiBuilder.js
View file @
80ebb0ff
...
...
@@ -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
* @me
thod
* @me
mberof Api
* @returns {ApiDocument}
*/
Api
.
prototype
.
GetDocument
=
function
()
...
...
@@ -213,7 +225,7 @@
};
/**
* Create new paragraph
* @me
thod
* @me
mberof Api
* @returns {ApiParagraph}
*/
Api
.
prototype
.
CreateParagraph
=
function
()
...
...
@@ -222,7 +234,7 @@
};
/**
* Create new table
* @me
thod
* @me
mberof 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
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment