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
670bcdb7
Commit
670bcdb7
authored
Oct 02, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added function for setting outlineLvl property to paragraph.
parent
e65e2de6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
3 deletions
+73
-3
common/HistoryCommon.js
common/HistoryCommon.js
+1
-0
word/Editor/DocumentContentBase.js
word/Editor/DocumentContentBase.js
+13
-1
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+3
-0
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+14
-0
word/Editor/ParagraphChanges.js
word/Editor/ParagraphChanges.js
+29
-2
word/Editor/Table.js
word/Editor/Table.js
+13
-0
No files found.
common/HistoryCommon.js
View file @
670bcdb7
...
...
@@ -1315,6 +1315,7 @@
window
[
'
AscDFH
'
].
historyitem_Paragraph_SectionPr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
34
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PrChange
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
35
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PrReviewInfo
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
36
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_OutlineLvl
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
37
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе ParaTextPr
//------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/DocumentContentBase.js
View file @
670bcdb7
...
...
@@ -880,4 +880,16 @@ CDocumentContentBase.prototype.FindNextFillingForm = function(isNext, isCurrent,
CDocumentContentBase
.
prototype
.
IsSelectedSingleElement
=
function
()
{
return
(
true
===
this
.
Selection
.
Use
&&
docpostype_Content
===
this
.
Get_DocPosType
()
&&
this
.
Selection
.
Flag
===
selectionflag_Common
&&
this
.
Selection
.
StartPos
===
this
.
Selection
.
EndPos
)
};
\ No newline at end of file
};
CDocumentContentBase
.
prototype
.
GetOutlineParagraphs
=
function
(
arrOutline
)
{
if
(
!
arrOutline
)
arrOutline
=
[];
for
(
var
nIndex
=
0
,
nCount
=
this
.
Content
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
this
.
Content
[
nIndex
].
GetOutlineParagraphs
(
arrOutline
);
}
return
arrOutline
;
};
word/Editor/DocumentContentElementBase.js
View file @
670bcdb7
...
...
@@ -693,6 +693,9 @@ CDocumentContentElementBase.prototype.Get_Index = function()
return
this
.
Index
;
};
CDocumentContentElementBase
.
prototype
.
GetOutlineParagraphs
=
function
(
arrOutline
)
{
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/Paragraph.js
View file @
670bcdb7
...
...
@@ -8817,6 +8817,14 @@ Paragraph.prototype.Set_Bullet = function(Bullet)
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
true
);
};
Paragraph
.
prototype
.
SetOutlineLvl
=
function
(
nLvl
)
{
this
.
private_AddPrChange
();
History
.
Add
(
new
CChangesParagraphOutlineLvl
(
this
,
this
.
Pr
.
OutlineLvl
,
nLvl
));
this
.
Pr
.
OutlineLvl
=
nLvl
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
true
);
};
/**
* Проверяем начинается ли текущий параграф с новой страницы.
*/
...
...
@@ -12351,6 +12359,12 @@ Paragraph.prototype.GetComplexFieldsByPos = function(oParaPos, bReturnFieldPos)
this
.
Set_ParaContentPos
(
oCurrentPos
,
false
,
-
1
,
-
1
,
false
);
return
arrComplexFields
;
};
Paragraph
.
prototype
.
GetOutlineParagraphs
=
function
(
arrOutline
)
{
var
ParaPr
=
this
.
Get_CompiledPr2
(
false
);
if
(
undefined
!==
ParaPr
.
OutlineLvl
)
arrOutline
.
push
({
Paragraph
:
this
,
Lvl
:
ParaPr
.
OutlineLvl
});
};
var
pararecalc_0_All
=
0
;
var
pararecalc_0_None
=
1
;
...
...
word/Editor/ParagraphChanges.js
View file @
670bcdb7
...
...
@@ -73,6 +73,7 @@ AscDFH.changesFactory[AscDFH.historyitem_Paragraph_FramePr] =
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Paragraph_SectionPr
]
=
CChangesParagraphSectPr
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Paragraph_PrChange
]
=
CChangesParagraphPrChange
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Paragraph_PrReviewInfo
]
=
CChangesParagraphPrReviewInfo
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Paragraph_OutlineLvl
]
=
CChangesParagraphOutlineLvl
;
function
private_ParagraphChangesOnLoadPr
(
oColor
)
{
...
...
@@ -246,7 +247,8 @@ AscDFH.changesRelationMap[AscDFH.historyitem_Paragraph_Pr]
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
,
AscDFH
.
historyitem_Paragraph_FramePr
,
AscDFH
.
historyitem_Paragraph_PrChange
,
AscDFH
.
historyitem_Paragraph_PrReviewInfo
AscDFH
.
historyitem_Paragraph_PrReviewInfo
,
AscDFH
.
historyitem_Paragraph_OutlineLvl
];
AscDFH
.
changesRelationMap
[
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
]
=
[
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
,
...
...
@@ -273,6 +275,9 @@ AscDFH.changesRelationMap[AscDFH.historyitem_Paragraph_PrReviewInfo]
AscDFH
.
historyitem_Paragraph_PrChange
,
AscDFH
.
historyitem_Paragraph_PrReviewInfo
];
AscDFH
.
changesRelationMap
[
AscDFH
.
historyitem_Paragraph_OutlineLvl
]
=
[
AscDFH
.
historyitem_Paragraph_OutlineLvl
];
// Общая функция Merge для изменений, которые зависят только от себя и AscDFH.historyitem_Paragraph_Pr
function
private_ParagraphChangesOnMergePr
(
oChange
)
...
...
@@ -1759,4 +1764,26 @@ CChangesParagraphPrReviewInfo.prototype.Merge = function(oChange)
return
false
;
return
true
;
};
\ No newline at end of file
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function
CChangesParagraphOutlineLvl
(
Class
,
Old
,
New
,
Color
)
{
AscDFH
.
CChangesBaseLongProperty
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
CChangesParagraphOutlineLvl
.
prototype
=
Object
.
create
(
AscDFH
.
CChangesBaseLongProperty
.
prototype
);
CChangesParagraphOutlineLvl
.
prototype
.
constructor
=
CChangesParagraphOutlineLvl
;
CChangesParagraphOutlineLvl
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_OutlineLvl
;
CChangesParagraphOutlineLvl
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
OutlineLvl
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphOutlineLvl
.
prototype
.
Merge
=
private_ParagraphChangesOnMergePr
;
CChangesParagraphOutlineLvl
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
\ No newline at end of file
word/Editor/Table.js
View file @
670bcdb7
...
...
@@ -12094,6 +12094,19 @@ CTable.prototype.GetAllContentControls = function(arrContentControls)
}
}
};
CTable
.
prototype
.
GetOutlineParagraphs
=
function
(
arrOutline
)
{
for
(
var
nCurRow
=
0
,
nRowsCount
=
this
.
Content
.
length
;
nCurRow
<
nRowsCount
;
++
nCurRow
)
{
var
oRow
=
this
.
Content
[
nCurRow
];
for
(
var
nCurCell
=
0
,
nCellsCount
=
oRow
.
Get_CellsCount
();
nCurCell
<
nCellsCount
;
++
nCurCell
)
{
var
oCell
=
oRow
.
Get_Cell
(
nCurCell
);
if
(
oCell
)
oCell
.
Content
.
GetOutlineParagraphs
(
arrOutline
);
}
}
};
//----------------------------------------------------------------------------------------------------------------------
// Класс CTableLook
//----------------------------------------------------------------------------------------------------------------------
...
...
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