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
34340161
Commit
34340161
authored
Nov 01, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for class Paragraph were replaced with new classes.
parent
a8f05df5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1509 additions
and
2194 deletions
+1509
-2194
common/HistoryCommon.js
common/HistoryCommon.js
+87
-59
word/Editor/DocumentChanges.js
word/Editor/DocumentChanges.js
+78
-0
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+123
-2135
word/Editor/ParagraphChanges.js
word/Editor/ParagraphChanges.js
+1218
-0
word/Editor/Table.js
word/Editor/Table.js
+3
-0
No files found.
common/HistoryCommon.js
View file @
34340161
...
@@ -1045,15 +1045,15 @@
...
@@ -1045,15 +1045,15 @@
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
=
3
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
=
3
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_TextPr
=
4
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_TextPr
=
4
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_Drawing
=
5
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_Drawing
=
5
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_DrawingObjects
=
6
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_DrawingObjects
=
6
<<
16
;
// obsolete
window
[
'
AscDFH
'
].
historyitem_type_FlowObjects
=
7
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_FlowObjects
=
7
<<
16
;
// obsolete
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
=
8
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
=
8
<<
16
;
// obsolete
window
[
'
AscDFH
'
].
historyitem_type_Table
=
9
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_Table
=
9
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_TableRow
=
10
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_TableRow
=
10
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_TableCell
=
11
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_TableCell
=
11
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_DocumentContent
=
12
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_DocumentContent
=
12
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_FlowTable
=
13
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_FlowTable
=
13
<<
16
;
// obsolete
window
[
'
AscDFH
'
].
historyitem_type_HdrFtrController
=
14
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_HdrFtrController
=
14
<<
16
;
// obsolete
window
[
'
AscDFH
'
].
historyitem_type_HdrFtr
=
15
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_HdrFtr
=
15
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_AbstractNum
=
16
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_AbstractNum
=
16
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_Comment
=
17
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_Comment
=
17
<<
16
;
...
@@ -1272,25 +1272,22 @@
...
@@ -1272,25 +1272,22 @@
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd_Value
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
18
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd_Value
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
18
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd_Color
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
19
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd_Color
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
19
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd_Unifill
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
20
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd_Unifill
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
20
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_WidowControl
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
21
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
21
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Tabs
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
22
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_WidowControl
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
22
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PStyle
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
23
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Tabs
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
23
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_DocNext
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
24
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PStyle
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
24
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_DocPrev
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
25
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Between
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
25
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Parent
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
26
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Bottom
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
26
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Between
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
27
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Left
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
27
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Bottom
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
28
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Right
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
28
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Left
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
29
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Top
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
29
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Right
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
30
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Pr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
30
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Borders_Top
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
31
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PresentationPr_Bullet
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
31
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Pr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
32
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PresentationPr_Level
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
32
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PresentationPr_Bullet
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
33
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_FramePr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
33
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PresentationPr_Level
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
34
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_SectionPr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
34
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_FramePr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
35
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PrChange
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
35
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_Shd
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
36
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PrReviewInfo
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
36
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_SectionPr
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
37
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PrChange
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
38
;
window
[
'
AscDFH
'
].
historyitem_Paragraph_PrReviewInfo
=
window
[
'
AscDFH
'
].
historyitem_type_Paragraph
|
39
;
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе ParaTextPr
// Типы изменений в классе ParaTextPr
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
...
@@ -1350,25 +1347,6 @@
...
@@ -1350,25 +1347,6 @@
window
[
'
AscDFH
'
].
historyitem_Drawing_SetSizeRelH
=
window
[
'
AscDFH
'
].
historyitem_type_Drawing
|
21
;
window
[
'
AscDFH
'
].
historyitem_Drawing_SetSizeRelH
=
window
[
'
AscDFH
'
].
historyitem_type_Drawing
|
21
;
window
[
'
AscDFH
'
].
historyitem_Drawing_SetSizeRelV
=
window
[
'
AscDFH
'
].
historyitem_type_Drawing
|
22
;
window
[
'
AscDFH
'
].
historyitem_Drawing_SetSizeRelV
=
window
[
'
AscDFH
'
].
historyitem_type_Drawing
|
22
;
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CDrawingObjects
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_DrawingObjects_AddItem
=
window
[
'
AscDFH
'
].
historyitem_type_DrawingObjects
|
1
;
window
[
'
AscDFH
'
].
historyitem_DrawingObjects_RemoveItem
=
window
[
'
AscDFH
'
].
historyitem_type_DrawingObjects
|
2
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе FlowObjects
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_FlowObjects_AddItem
=
window
[
'
AscDFH
'
].
historyitem_type_FlowObjects
|
1
;
window
[
'
AscDFH
'
].
historyitem_FlowObjects_RemoveItem
=
window
[
'
AscDFH
'
].
historyitem_type_FlowObjects
|
2
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе FlowImage
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_FlowImage_Position
=
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
|
1
;
window
[
'
AscDFH
'
].
historyitem_FlowImage_Size
=
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
|
2
;
window
[
'
AscDFH
'
].
historyitem_FlowImage_Paddings
=
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
|
3
;
window
[
'
AscDFH
'
].
historyitem_FlowImage_PageNum
=
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
|
4
;
window
[
'
AscDFH
'
].
historyitem_FlowImage_Url
=
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
|
5
;
window
[
'
AscDFH
'
].
historyitem_FlowImage_Parent
=
window
[
'
AscDFH
'
].
historyitem_type_FlowImage
|
6
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CTable
// Типы изменений в классе CTable
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_Table_DocNext
=
window
[
'
AscDFH
'
].
historyitem_type_Table
|
1
;
window
[
'
AscDFH
'
].
historyitem_Table_DocNext
=
window
[
'
AscDFH
'
].
historyitem_type_Table
|
1
;
...
@@ -1432,22 +1410,6 @@
...
@@ -1432,22 +1410,6 @@
window
[
'
AscDFH
'
].
historyitem_DocumentContent_AddItem
=
window
[
'
AscDFH
'
].
historyitem_type_DocumentContent
|
1
;
window
[
'
AscDFH
'
].
historyitem_DocumentContent_AddItem
=
window
[
'
AscDFH
'
].
historyitem_type_DocumentContent
|
1
;
window
[
'
AscDFH
'
].
historyitem_DocumentContent_RemoveItem
=
window
[
'
AscDFH
'
].
historyitem_type_DocumentContent
|
2
;
window
[
'
AscDFH
'
].
historyitem_DocumentContent_RemoveItem
=
window
[
'
AscDFH
'
].
historyitem_type_DocumentContent
|
2
;
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CFlowTable
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_FlowTable_Position
=
window
[
'
AscDFH
'
].
historyitem_type_FlowTable
|
1
;
window
[
'
AscDFH
'
].
historyitem_FlowTable_Paddings
=
window
[
'
AscDFH
'
].
historyitem_type_FlowTable
|
2
;
window
[
'
AscDFH
'
].
historyitem_FlowTable_PageNum
=
window
[
'
AscDFH
'
].
historyitem_type_FlowTable
|
3
;
window
[
'
AscDFH
'
].
historyitem_FlowTable_Parent
=
window
[
'
AscDFH
'
].
historyitem_type_FlowTable
|
4
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CHeaderFooterController
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_HdrFtrController_AddItem
=
window
[
'
AscDFH
'
].
historyitem_type_HdrFtrController
|
1
;
window
[
'
AscDFH
'
].
historyitem_HdrFtrController_RemoveItem
=
window
[
'
AscDFH
'
].
historyitem_type_HdrFtrController
|
2
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CHeaderFooter
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_HdrFtr_BoundY2
=
window
[
'
AscDFH
'
].
historyitem_type_HdrFtr
|
1
;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CAbstractNum
// Типы изменений в классе CAbstractNum
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
window
[
'
AscDFH
'
].
historyitem_AbstractNum_LvlChange
=
window
[
'
AscDFH
'
].
historyitem_type_AbstractNum
|
1
;
window
[
'
AscDFH
'
].
historyitem_AbstractNum_LvlChange
=
window
[
'
AscDFH
'
].
historyitem_type_AbstractNum
|
1
;
...
@@ -3299,4 +3261,70 @@
...
@@ -3299,4 +3261,70 @@
this
.
Old
=
Reader
.
GetString2
();
this
.
Old
=
Reader
.
GetString2
();
};
};
window
[
'
AscDFH
'
].
CChangesBaseStringProperty
=
CChangesBaseStringProperty
;
window
[
'
AscDFH
'
].
CChangesBaseStringProperty
=
CChangesBaseStringProperty
;
/**
* Базовый класс для изменения числовых (byte) свойств.
* @constructor
* @extends {AscDFH.CChangesBaseProperty}
*/
function
CChangesBaseByteProperty
(
Class
,
Old
,
New
,
Color
)
{
CChangesBaseByteProperty
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesBaseByteProperty
,
CChangesBaseProperty
);
CChangesBaseByteProperty
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// byte : New
// byte : Old
var
nFlags
=
0
;
if
(
false
!==
this
.
Color
)
nFlags
|=
1
;
if
(
undefined
===
this
.
New
)
nFlags
|=
2
;
if
(
undefined
===
this
.
Old
)
nFlags
|=
4
;
Writer
.
WriteLong
(
nFlags
);
if
(
undefined
!==
this
.
New
)
Writer
.
WriteByte
(
this
.
New
);
if
(
undefined
!==
this
.
Old
)
Writer
.
WriteByte
(
this
.
Old
);
};
CChangesBaseByteProperty
.
prototype
.
ReadFromBinary
=
function
(
Reader
)
{
// Long : Flag
// 1-bit : Подсвечивать ли данные изменения
// 2-bit : IsUndefined New
// 3-bit : IsUndefined Old
// byte : New
// byte : Old
var
nFlags
=
Reader
.
GetLong
();
if
(
nFlags
&
1
)
this
.
Color
=
true
;
else
this
.
Color
=
false
;
if
(
nFlags
&
2
)
this
.
New
=
undefined
;
else
this
.
New
=
Reader
.
GetByte
();
if
(
nFlags
&
4
)
this
.
Old
=
undefined
;
else
this
.
Old
=
Reader
.
GetByte
();
};
window
[
'
AscDFH
'
].
CChangesBaseByteProperty
=
CChangesBaseByteProperty
;
})(
window
);
})(
window
);
word/Editor/DocumentChanges.js
View file @
34340161
...
@@ -66,6 +66,24 @@ CChangesDocumentAddItem.prototype.Undo = function()
...
@@ -66,6 +66,24 @@ CChangesDocumentAddItem.prototype.Undo = function()
var
Elements
=
oDocument
.
Content
.
splice
(
this
.
Pos
,
1
);
var
Elements
=
oDocument
.
Content
.
splice
(
this
.
Pos
,
1
);
oDocument
.
private_RecalculateNumbering
(
Elements
);
oDocument
.
private_RecalculateNumbering
(
Elements
);
oDocument
.
SectionsInfo
.
Update_OnRemove
(
this
.
Pos
,
1
);
oDocument
.
SectionsInfo
.
Update_OnRemove
(
this
.
Pos
,
1
);
var
Pos
=
this
.
Pos
;
if
(
Pos
>
0
)
{
if
(
Pos
<=
oDocument
.
Content
.
length
-
1
)
{
oDocument
.
Content
[
Pos
-
1
].
Next
=
oDocument
.
Content
[
Pos
];
oDocument
.
Content
[
Pos
].
Prev
=
oDocument
.
Content
[
Pos
-
1
];
}
else
{
oDocument
.
Content
[
Pos
-
1
].
Next
=
null
;
}
}
else
if
(
Pos
<=
oDocument
.
Content
.
length
-
1
)
{
oDocument
.
Content
[
Pos
].
Prev
=
null
;
}
};
};
CChangesDocumentAddItem
.
prototype
.
Redo
=
function
()
CChangesDocumentAddItem
.
prototype
.
Redo
=
function
()
{
{
...
@@ -73,6 +91,30 @@ CChangesDocumentAddItem.prototype.Redo = function()
...
@@ -73,6 +91,30 @@ CChangesDocumentAddItem.prototype.Redo = function()
oDocument
.
Content
.
splice
(
this
.
Pos
,
0
,
this
.
Item
);
oDocument
.
Content
.
splice
(
this
.
Pos
,
0
,
this
.
Item
);
oDocument
.
private_RecalculateNumbering
([
this
.
Item
]);
oDocument
.
private_RecalculateNumbering
([
this
.
Item
]);
oDocument
.
SectionsInfo
.
Update_OnAdd
(
this
.
Pos
,
[
this
.
Item
]);
oDocument
.
SectionsInfo
.
Update_OnAdd
(
this
.
Pos
,
[
this
.
Item
]);
var
Element
=
this
.
Item
;
var
Pos
=
this
.
Pos
;
if
(
Pos
>
0
)
{
oDocument
.
Content
[
Pos
-
1
].
Next
=
Element
;
Element
.
Prev
=
oDocument
.
Content
[
Pos
-
1
];
}
else
{
Element
.
Prev
=
null
;
}
if
(
Pos
<=
oDocument
.
Content
.
length
-
1
)
{
oDocument
.
Content
[
Pos
].
Prev
=
Element
;
Element
.
Next
=
oDocument
.
Content
[
Pos
];
}
else
{
Element
.
Next
=
null
;
}
Element
.
Parent
=
oDocument
;
};
};
CChangesDocumentAddItem
.
prototype
.
WriteToBinary
=
function
(
Writer
)
CChangesDocumentAddItem
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
{
...
@@ -163,6 +205,24 @@ CChangesDocumentRemoveItem.prototype.Undo = function()
...
@@ -163,6 +205,24 @@ CChangesDocumentRemoveItem.prototype.Undo = function()
oDocument
.
Content
=
Array_start
.
concat
(
this
.
Items
,
Array_end
);
oDocument
.
Content
=
Array_start
.
concat
(
this
.
Items
,
Array_end
);
oDocument
.
SectionsInfo
.
Update_OnAdd
(
this
.
Pos
,
this
.
Items
);
oDocument
.
SectionsInfo
.
Update_OnAdd
(
this
.
Pos
,
this
.
Items
);
var
nStartIndex
=
Math
.
max
(
this
.
Pos
-
1
,
0
);
var
nEndIndex
=
Math
.
min
(
oDocument
.
Content
.
length
-
1
,
this
.
Pos
+
this
.
Items
.
length
+
1
);
for
(
var
nIndex
=
nStartIndex
;
nIndex
<=
nEndIndex
;
++
nIndex
)
{
var
oElement
=
oDocument
.
Content
[
nIndex
];
if
(
nIndex
>
0
)
oElement
.
Prev
=
oDocument
.
Content
[
nIndex
-
1
];
else
oElement
.
Prev
=
null
;
if
(
nIndex
<
oDocument
.
Content
.
length
-
1
)
oElement
.
Next
=
oDocument
.
Content
[
nIndex
+
1
];
else
oElement
.
Next
=
null
;
oElement
.
Parent
=
oDocument
;
}
};
};
CChangesDocumentRemoveItem
.
prototype
.
Redo
=
function
()
CChangesDocumentRemoveItem
.
prototype
.
Redo
=
function
()
{
{
...
@@ -170,6 +230,24 @@ CChangesDocumentRemoveItem.prototype.Redo = function()
...
@@ -170,6 +230,24 @@ CChangesDocumentRemoveItem.prototype.Redo = function()
var
Elements
=
oDocument
.
Content
.
splice
(
this
.
Pos
,
this
.
Items
.
length
);
var
Elements
=
oDocument
.
Content
.
splice
(
this
.
Pos
,
this
.
Items
.
length
);
oDocument
.
private_RecalculateNumbering
(
Elements
);
oDocument
.
private_RecalculateNumbering
(
Elements
);
oDocument
.
SectionsInfo
.
Update_OnRemove
(
this
.
Pos
,
this
.
Items
.
length
);
oDocument
.
SectionsInfo
.
Update_OnRemove
(
this
.
Pos
,
this
.
Items
.
length
);
var
Pos
=
this
.
Pos
;
if
(
Pos
>
0
)
{
if
(
Pos
<=
oDocument
.
Content
.
length
-
1
)
{
oDocument
.
Content
[
Pos
-
1
].
Next
=
oDocument
.
Content
[
Pos
];
oDocument
.
Content
[
Pos
].
Prev
=
oDocument
.
Content
[
Pos
-
1
];
}
else
{
oDocument
.
Content
[
Pos
-
1
].
Next
=
null
;
}
}
else
if
(
Pos
<=
oDocument
.
Content
.
length
-
1
)
{
oDocument
.
Content
[
Pos
].
Prev
=
null
;
}
};
};
CChangesDocumentRemoveItem
.
prototype
.
WriteToBinary
=
function
(
Writer
)
CChangesDocumentRemoveItem
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
{
...
...
word/Editor/Paragraph.js
View file @
34340161
...
@@ -9137,13 +9137,11 @@ Paragraph.prototype =
...
@@ -9137,13 +9137,11 @@ Paragraph.prototype =
Set_DocumentNext
:
function
(
Object
)
Set_DocumentNext
:
function
(
Object
)
{
{
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_Paragraph_DocNext
,
New
:
Object
,
Old
:
this
.
Next
}
);
this
.
Next
=
Object
;
this
.
Next
=
Object
;
},
},
Set_DocumentPrev
:
function
(
Object
)
Set_DocumentPrev
:
function
(
Object
)
{
{
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_Paragraph_DocPrev
,
New
:
Object
,
Old
:
this
.
Prev
}
);
this
.
Prev
=
Object
;
this
.
Prev
=
Object
;
},
},
...
@@ -9164,7 +9162,6 @@ Paragraph.prototype =
...
@@ -9164,7 +9162,6 @@ Paragraph.prototype =
Set_Parent
:
function
(
ParentObject
)
Set_Parent
:
function
(
ParentObject
)
{
{
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_Paragraph_Parent
,
New
:
ParentObject
,
Old
:
this
.
Parent
}
);
this
.
Parent
=
ParentObject
;
this
.
Parent
=
ParentObject
;
},
},
...
@@ -10409,2189 +10406,177 @@ Paragraph.prototype =
...
@@ -10409,2189 +10406,177 @@ Paragraph.prototype =
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
// Undo/Redo функции
// Undo/Redo функции
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
Undo
:
function
(
Data
)
Get_SelectionState
:
function
()
{
var
Type
=
Data
.
Type
;
switch
(
Type
)
{
case
AscDFH
.
historyitem_Paragraph_AddItem
:
{
var
StartPos
=
Data
.
Pos
;
var
EndPos
=
Data
.
EndPos
;
this
.
Content
.
splice
(
StartPos
,
EndPos
-
StartPos
+
1
);
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_RemoveItem
:
{
var
Pos
=
Data
.
Pos
;
var
Array_start
=
this
.
Content
.
slice
(
0
,
Pos
);
var
Array_end
=
this
.
Content
.
slice
(
Pos
);
this
.
Content
=
Array_start
.
concat
(
Data
.
Items
,
Array_end
);
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_Numbering
:
{
var
Old
=
Data
.
Old
;
if
(
undefined
!=
Old
)
this
.
Pr
.
NumPr
=
Old
;
else
this
.
Pr
.
NumPr
=
undefined
;
this
.
private_RefreshNumbering
(
this
.
Pr
.
NumPr
);
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Align
:
{
this
.
Pr
.
Jc
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_First
:
{
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaSpacing
();
this
.
Pr
.
Ind
.
FirstLine
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_Left
:
{
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaSpacing
();
this
.
Pr
.
Ind
.
Left
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_Right
:
{
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaSpacing
();
this
.
Pr
.
Ind
.
Right
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_ContextualSpacing
:
{
this
.
Pr
.
ContextualSpacing
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_KeepLines
:
{
this
.
Pr
.
KeepLines
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_KeepNext
:
{
this
.
Pr
.
KeepNext
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PageBreakBefore
:
{
this
.
Pr
.
PageBreakBefore
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_Line
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
Line
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
LineRule
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_Before
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
Before
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_After
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
After
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
AfterAutoSpacing
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
BeforeAutoSpacing
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Value
:
{
if
(
undefined
!=
Data
.
Old
&&
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
if
(
undefined
!=
Data
.
Old
)
this
.
Pr
.
Shd
.
Value
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Color
:
{
if
(
undefined
!=
Data
.
Old
&&
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
if
(
undefined
!=
Data
.
Old
)
this
.
Pr
.
Shd
.
Color
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Unifill
:
{
if
(
undefined
!=
Data
.
Old
&&
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
if
(
undefined
!=
Data
.
Old
)
this
.
Pr
.
Shd
.
Unifill
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd
:
{
this
.
Pr
.
Shd
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_WidowControl
:
{
this
.
Pr
.
WidowControl
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Tabs
:
{
this
.
Pr
.
Tabs
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PStyle
:
{
var
Old
=
Data
.
Old
;
if
(
undefined
!=
Old
)
this
.
Pr
.
PStyle
=
Old
;
else
this
.
Pr
.
PStyle
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_DocNext
:
{
this
.
Next
=
Data
.
Old
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_DocPrev
:
{
this
.
Prev
=
Data
.
Old
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_Parent
:
{
this
.
Parent
=
Data
.
Old
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Between
:
{
this
.
Pr
.
Brd
.
Between
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Bottom
:
{
this
.
Pr
.
Brd
.
Bottom
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Left
:
{
this
.
Pr
.
Brd
.
Left
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Right
:
{
this
.
Pr
.
Brd
.
Right
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Top
:
{
this
.
Pr
.
Brd
.
Top
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Pr
:
{
var
Old
=
Data
.
Old
;
if
(
undefined
!=
Old
)
this
.
Pr
=
Old
;
else
this
.
Pr
=
new
CParaPr
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
:
{
this
.
Pr
.
Bullet
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
:
{
this
.
Pr
.
Lvl
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_FramePr
:
{
this
.
Pr
.
FramePr
=
Data
.
Old
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_SectionPr
:
{
this
.
SectPr
=
Data
.
Old
;
this
.
LogicDocument
.
Update_SectionsInfo
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrChange
:
{
this
.
Pr
.
PrChange
=
Data
.
Old
.
PrChange
;
this
.
Pr
.
ReviewInfo
=
Data
.
Old
.
ReviewInfo
;
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrReviewInfo
:
{
this
.
Pr
.
ReviewInfo
=
Data
.
Old
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
}
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
this
.
RecalcInfo
.
Set_Type_0_Spell
(
pararecalc_0_Spell_All
);
},
Redo
:
function
(
Data
)
{
var
Type
=
Data
.
Type
;
switch
(
Type
)
{
case
AscDFH
.
historyitem_Paragraph_AddItem
:
{
var
Pos
=
Data
.
Pos
;
var
Array_start
=
this
.
Content
.
slice
(
0
,
Pos
);
var
Array_end
=
this
.
Content
.
slice
(
Pos
);
this
.
Content
=
Array_start
.
concat
(
Data
.
Items
,
Array_end
);
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_RemoveItem
:
{
var
StartPos
=
Data
.
Pos
;
var
EndPos
=
Data
.
EndPos
;
this
.
Content
.
splice
(
StartPos
,
EndPos
-
StartPos
+
1
);
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_Numbering
:
{
var
New
=
Data
.
New
;
if
(
undefined
!=
New
)
this
.
Pr
.
NumPr
=
New
;
else
this
.
Pr
.
NumPr
=
undefined
;
this
.
private_RefreshNumbering
(
this
.
Pr
.
NumPr
);
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Align
:
{
this
.
Pr
.
Jc
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_First
:
{
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaInd
();
this
.
Pr
.
Ind
.
FirstLine
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_Left
:
{
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaInd
();
this
.
Pr
.
Ind
.
Left
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_Right
:
{
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaInd
();
this
.
Pr
.
Ind
.
Right
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_ContextualSpacing
:
{
this
.
Pr
.
ContextualSpacing
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_KeepLines
:
{
this
.
Pr
.
KeepLines
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_KeepNext
:
{
this
.
Pr
.
KeepNext
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PageBreakBefore
:
{
this
.
Pr
.
PageBreakBefore
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_Line
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
Line
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
LineRule
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_Before
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
Before
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_After
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
After
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
AfterAutoSpacing
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
:
{
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
this
.
Pr
.
Spacing
.
BeforeAutoSpacing
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Value
:
{
if
(
undefined
!=
Data
.
New
&&
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
if
(
undefined
!=
Data
.
New
)
this
.
Pr
.
Shd
.
Value
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Color
:
{
if
(
undefined
!=
Data
.
New
&&
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
if
(
undefined
!=
Data
.
New
)
this
.
Pr
.
Shd
.
Color
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Unifill
:
{
if
(
undefined
!=
Data
.
New
&&
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
if
(
undefined
!=
Data
.
New
)
this
.
Pr
.
Shd
.
Unifill
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd
:
{
this
.
Pr
.
Shd
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_WidowControl
:
{
this
.
Pr
.
WidowControl
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Tabs
:
{
this
.
Pr
.
Tabs
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PStyle
:
{
var
New
=
Data
.
New
;
if
(
undefined
!=
New
)
this
.
Pr
.
PStyle
=
New
;
else
this
.
Pr
.
PStyle
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_DocNext
:
{
this
.
Next
=
Data
.
New
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_DocPrev
:
{
this
.
Prev
=
Data
.
New
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_Parent
:
{
this
.
Parent
=
Data
.
New
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Between
:
{
this
.
Pr
.
Brd
.
Between
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Bottom
:
{
this
.
Pr
.
Brd
.
Bottom
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Left
:
{
this
.
Pr
.
Brd
.
Left
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Right
:
{
this
.
Pr
.
Brd
.
Right
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Top
:
{
this
.
Pr
.
Brd
.
Top
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Pr
:
{
var
New
=
Data
.
New
;
if
(
undefined
!=
New
)
this
.
Pr
=
New
;
else
this
.
Pr
=
new
CParaPr
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
:
{
this
.
Pr
.
Bullet
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
:
{
this
.
Pr
.
Lvl
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_FramePr
:
{
this
.
Pr
.
FramePr
=
Data
.
New
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_SectionPr
:
{
this
.
SectPr
=
Data
.
New
;
this
.
LogicDocument
.
Update_SectionsInfo
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrChange
:
{
this
.
Pr
.
PrChange
=
Data
.
New
.
PrChange
;
this
.
Pr
.
ReviewInfo
=
Data
.
New
.
ReviewInfo
;
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrReviewInfo
:
{
this
.
Pr
.
ReviewInfo
=
Data
.
New
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
}
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
this
.
RecalcInfo
.
Set_Type_0_Spell
(
pararecalc_0_Spell_All
);
},
Get_SelectionState
:
function
()
{
var
ParaState
=
{};
ParaState
.
CurPos
=
{
X
:
this
.
CurPos
.
X
,
Y
:
this
.
CurPos
.
Y
,
Line
:
this
.
CurPos
.
Line
,
ContentPos
:
this
.
Get_ParaContentPos
(
false
,
false
),
RealX
:
this
.
CurPos
.
RealX
,
RealY
:
this
.
CurPos
.
RealY
,
PagesPos
:
this
.
CurPos
.
PagesPos
};
ParaState
.
Selection
=
{
Start
:
this
.
Selection
.
Start
,
Use
:
this
.
Selection
.
Use
,
StartPos
:
0
,
EndPos
:
0
,
Flag
:
this
.
Selection
.
Flag
};
if
(
true
===
this
.
Selection
.
Use
)
{
ParaState
.
Selection
.
StartPos
=
this
.
Get_ParaContentPos
(
true
,
true
);
ParaState
.
Selection
.
EndPos
=
this
.
Get_ParaContentPos
(
true
,
false
);
}
return
[
ParaState
];
},
Set_SelectionState
:
function
(
State
,
StateIndex
)
{
if
(
State
.
length
<=
0
)
return
;
var
ParaState
=
State
[
StateIndex
];
this
.
CurPos
.
X
=
ParaState
.
CurPos
.
X
;
this
.
CurPos
.
Y
=
ParaState
.
CurPos
.
Y
;
this
.
CurPos
.
Line
=
ParaState
.
CurPos
.
Line
;
this
.
CurPos
.
RealX
=
ParaState
.
CurPos
.
RealX
;
this
.
CurPos
.
RealY
=
ParaState
.
CurPos
.
RealY
;
this
.
CurPos
.
PagesPos
=
ParaState
.
CurPos
.
PagesPos
;
this
.
Set_ParaContentPos
(
ParaState
.
CurPos
.
ContentPos
,
true
,
-
1
,
-
1
);
this
.
Selection_Remove
();
this
.
Selection
.
Start
=
ParaState
.
Selection
.
Start
;
this
.
Selection
.
Use
=
ParaState
.
Selection
.
Use
;
this
.
Selection
.
Flag
=
ParaState
.
Selection
.
Flag
;
if
(
true
===
this
.
Selection
.
Use
)
this
.
Set_SelectionContentPos
(
ParaState
.
Selection
.
StartPos
,
ParaState
.
Selection
.
EndPos
);
},
Get_ParentObject_or_DocumentPos
:
function
()
{
this
.
Parent
.
Update_ContentIndexing
();
return
this
.
Parent
.
Get_ParentObject_or_DocumentPos
(
this
.
Index
);
},
Refresh_RecalcData
:
function
(
Data
)
{
var
Type
=
Data
.
Type
;
var
bNeedRecalc
=
false
;
var
CurPage
=
0
;
switch
(
Type
)
{
case
AscDFH
.
historyitem_Paragraph_AddItem
:
case
AscDFH
.
historyitem_Paragraph_RemoveItem
:
{
for
(
CurPage
=
this
.
Pages
.
length
-
1
;
CurPage
>
0
;
CurPage
--
)
{
if
(
Data
.
Pos
>
this
.
Lines
[
this
.
Pages
[
CurPage
].
StartLine
].
Get_StartPos
()
)
break
;
}
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
bNeedRecalc
=
true
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_Numbering
:
case
AscDFH
.
historyitem_Paragraph_PStyle
:
case
AscDFH
.
historyitem_Paragraph_Pr
:
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
:
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
:
{
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
bNeedRecalc
=
true
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_Align
:
case
AscDFH
.
historyitem_Paragraph_Ind_First
:
case
AscDFH
.
historyitem_Paragraph_Ind_Left
:
case
AscDFH
.
historyitem_Paragraph_Ind_Right
:
case
AscDFH
.
historyitem_Paragraph_ContextualSpacing
:
case
AscDFH
.
historyitem_Paragraph_KeepLines
:
case
AscDFH
.
historyitem_Paragraph_KeepNext
:
case
AscDFH
.
historyitem_Paragraph_PageBreakBefore
:
case
AscDFH
.
historyitem_Paragraph_Spacing_Line
:
case
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
:
case
AscDFH
.
historyitem_Paragraph_Spacing_Before
:
case
AscDFH
.
historyitem_Paragraph_Spacing_After
:
case
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
:
case
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
:
case
AscDFH
.
historyitem_Paragraph_WidowControl
:
case
AscDFH
.
historyitem_Paragraph_Tabs
:
case
AscDFH
.
historyitem_Paragraph_Parent
:
case
AscDFH
.
historyitem_Paragraph_Borders_Between
:
case
AscDFH
.
historyitem_Paragraph_Borders_Bottom
:
case
AscDFH
.
historyitem_Paragraph_Borders_Left
:
case
AscDFH
.
historyitem_Paragraph_Borders_Right
:
case
AscDFH
.
historyitem_Paragraph_Borders_Top
:
case
AscDFH
.
historyitem_Paragraph_FramePr
:
{
bNeedRecalc
=
true
;
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Value
:
case
AscDFH
.
historyitem_Paragraph_Shd_Color
:
case
AscDFH
.
historyitem_Paragraph_Shd_Unifill
:
case
AscDFH
.
historyitem_Paragraph_Shd
:
{
if
(
this
.
Parent
)
{
var
oDrawingShape
=
this
.
Parent
.
Is_DrawingShape
(
true
);
if
(
oDrawingShape
)
{
if
(
oDrawingShape
.
chekBodyPrTransform
(
oDrawingShape
.
getBodyPr
())
||
oDrawingShape
.
checkContentWordArt
(
oDrawingShape
.
getDocContent
()))
{
bNeedRecalc
=
true
;
}
}
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_DocNext
:
case
AscDFH
.
historyitem_Paragraph_DocPrev
:
{
// Пересчитывать этот элемент не надо при таких изменениях
break
;
}
}
if
(
true
===
bNeedRecalc
)
{
var
Prev
=
this
.
Get_DocumentPrev
();
if
(
0
===
CurPage
&&
null
!=
Prev
&&
type_Paragraph
===
Prev
.
GetType
()
&&
true
===
Prev
.
Get_CompiledPr2
(
false
).
ParaPr
.
KeepNext
)
Prev
.
Refresh_RecalcData2
(
Prev
.
Pages
.
length
-
1
);
// Сообщаем родительскому классу, что изменения произошли в элементе с номером this.Index и на странице this.PageNum
return
this
.
Refresh_RecalcData2
(
CurPage
);
}
},
Refresh_RecalcData2
:
function
(
CurPage
)
{
if
(
!
CurPage
)
CurPage
=
0
;
// Если Index < 0, значит данный элемент еще не был добавлен в родительский класс
if
(
this
.
Index
>=
0
)
this
.
Parent
.
Refresh_RecalcData2
(
this
.
Index
,
this
.
private_GetRelativePageIndex
(
CurPage
));
},
//-----------------------------------------------------------------------------------
// Функции для совместного редактирования
//-----------------------------------------------------------------------------------
Save_Changes
:
function
(
Data
,
Writer
)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_Paragraph
);
var
Type
=
Data
.
Type
;
// Пишем тип
Writer
.
WriteLong
(
Type
);
switch
(
Type
)
{
case
AscDFH
.
historyitem_Paragraph_AddItem
:
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id элемента
// }
var
bArray
=
Data
.
UseArray
;
var
Count
=
Data
.
Items
.
length
;
Writer
.
WriteLong
(
Count
);
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
if
(
true
===
bArray
)
Writer
.
WriteLong
(
Data
.
PosArray
[
Index
]
);
else
Writer
.
WriteLong
(
Data
.
Pos
+
Index
);
Writer
.
WriteString2
(
Data
.
Items
[
Index
].
Get_Id
()
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_RemoveItem
:
{
// Long : Количество удаляемых элементов
// Array of Long : позиции удаляемых элементов
var
bArray
=
Data
.
UseArray
;
var
Count
=
Data
.
Items
.
length
;
var
StartPos
=
Writer
.
GetCurPosition
();
Writer
.
Skip
(
4
);
var
RealCount
=
Count
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
if
(
true
===
bArray
)
{
if
(
false
===
Data
.
PosArray
[
Index
]
)
RealCount
--
;
else
Writer
.
WriteLong
(
Data
.
PosArray
[
Index
]
);
}
else
Writer
.
WriteLong
(
Data
.
Pos
);
}
var
EndPos
=
Writer
.
GetCurPosition
();
Writer
.
Seek
(
StartPos
);
Writer
.
WriteLong
(
RealCount
);
Writer
.
Seek
(
EndPos
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Numbering
:
{
// Bool : IsUndefined
// Если false
// Variable : NumPr (CNumPr)
if
(
undefined
===
Data
.
New
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_First
:
case
AscDFH
.
historyitem_Paragraph_Ind_Left
:
case
AscDFH
.
historyitem_Paragraph_Ind_Right
:
case
AscDFH
.
historyitem_Paragraph_Spacing_Line
:
case
AscDFH
.
historyitem_Paragraph_Spacing_Before
:
case
AscDFH
.
historyitem_Paragraph_Spacing_After
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
Data
.
New
)
{
Writer
.
WriteBool
(
true
);
}
else
{
Writer
.
WriteBool
(
false
);
Writer
.
WriteDouble
(
Data
.
New
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_Align
:
case
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
:
{
// Bool : IsUndefined
// Если false
// Long : Value
if
(
undefined
===
Data
.
New
)
{
Writer
.
WriteBool
(
true
);
}
else
{
Writer
.
WriteBool
(
false
);
Writer
.
WriteLong
(
Data
.
New
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_ContextualSpacing
:
case
AscDFH
.
historyitem_Paragraph_KeepLines
:
case
AscDFH
.
historyitem_Paragraph_KeepNext
:
case
AscDFH
.
historyitem_Paragraph_PageBreakBefore
:
case
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
:
case
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
:
case
AscDFH
.
historyitem_Paragraph_WidowControl
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
undefined
===
Data
.
New
)
{
Writer
.
WriteBool
(
true
);
}
else
{
Writer
.
WriteBool
(
false
);
Writer
.
WriteBool
(
Data
.
New
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Value
:
{
// Bool : IsUndefined
// Если false
// Byte : Value
var
New
=
Data
.
New
;
if
(
undefined
!=
New
)
{
Writer
.
WriteBool
(
false
);
Writer
.
WriteByte
(
Data
.
New
);
}
else
Writer
.
WriteBool
(
true
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Color
:
case
AscDFH
.
historyitem_Paragraph_Shd_Unifill
:
{
// Bool : IsUndefined
// Если false
// Variable : Color (CDocumentColor)
var
New
=
Data
.
New
;
if
(
undefined
!=
New
)
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
else
Writer
.
WriteBool
(
true
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd
:
{
// Bool : IsUndefined
// Если false
// Variable : Shd (CDocumentShd)
var
New
=
Data
.
New
;
if
(
undefined
!=
New
)
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
else
Writer
.
WriteBool
(
true
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Tabs
:
{
// Bool : IsUndefined
// Есди false
// Variable : CParaTabs
if
(
undefined
!=
Data
.
New
)
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
else
Writer
.
WriteBool
(
true
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PStyle
:
{
// Bool : Удаляем ли
// Если false
// String : StyleId
if
(
undefined
!=
Data
.
New
)
{
Writer
.
WriteBool
(
false
);
Writer
.
WriteString2
(
Data
.
New
);
}
else
Writer
.
WriteBool
(
true
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_DocNext
:
case
AscDFH
.
historyitem_Paragraph_DocPrev
:
case
AscDFH
.
historyitem_Paragraph_Parent
:
{
// String : Id элемента
// if ( null != Data.New )
// Writer.WriteString2( Data.New.Get_Id() );
// else
// Writer.WriteString2( "" );
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Between
:
case
AscDFH
.
historyitem_Paragraph_Borders_Bottom
:
case
AscDFH
.
historyitem_Paragraph_Borders_Left
:
case
AscDFH
.
historyitem_Paragraph_Borders_Right
:
case
AscDFH
.
historyitem_Paragraph_Borders_Top
:
{
// Bool : IsUndefined
// если false
// Variable : Border (CDocumentBorder)
if
(
undefined
!=
Data
.
New
)
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
else
Writer
.
WriteBool
(
true
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Pr
:
{
// Bool : удаляем ли
if
(
undefined
===
Data
.
New
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
:
{
if
(
Data
.
New
)
{
Writer
.
WriteBool
(
true
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
else
{
Writer
.
WriteBool
(
false
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
:
{
// Long : Level
Writer
.
WriteLong
(
Data
.
New
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_FramePr
:
{
// Bool : IsUndefined
// false ->
// Variable : CFramePr
if
(
undefined
===
Data
.
New
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_SectionPr
:
{
// Bool : IsUndefined
// false ->
// String2 : SectPr.Id
if
(
undefined
===
Data
.
New
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Writer
.
WriteString2
(
Data
.
New
.
Get_Id
()
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrChange
:
{
// Bool : is undefined ?
// false -> PrChange
// Bool : is undefined ?
// false -> ReviewInfo
if
(
undefined
===
Data
.
New
.
PrChange
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
PrChange
.
Write_ToBinary
(
Writer
);
}
if
(
undefined
===
Data
.
New
.
ReviewInfo
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
ReviewInfo
.
Write_ToBinary
(
Writer
);
}
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrReviewInfo
:
{
// Bool : is undefined ?
// false -> ReviewInfo
if
(
undefined
===
Data
.
New
)
Writer
.
WriteBool
(
true
);
else
{
Writer
.
WriteBool
(
false
);
Data
.
New
.
Write_ToBinary
(
Writer
);
}
break
;
}
}
return
Writer
;
},
Load_Changes
:
function
(
Reader
,
Reader2
,
oColor
)
{
// Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл.
// Long : тип класса
// Long : тип изменений
var
ClassType
=
Reader
.
GetLong
();
if
(
AscDFH
.
historyitem_type_Paragraph
!=
ClassType
)
return
;
var
Type
=
Reader
.
GetLong
();
var
bPrChanged
=
false
;
switch
(
Type
)
{
case
AscDFH
.
historyitem_Paragraph_AddItem
:
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id Элемента
// }
var
Count
=
Reader
.
GetLong
();
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
Pos
=
this
.
m_oContentChanges
.
Check
(
AscCommon
.
contentchanges_Add
,
Reader
.
GetLong
()
);
var
Element
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
()
);
if
(
null
!=
Element
)
{
if
(
para_Comment
===
Element
.
Type
)
{
var
Comment
=
g_oTableId
.
Get_ById
(
Element
.
CommentId
);
// При копировании не всегда сразу заполняется правильно CommentId
if
(
null
!=
Comment
&&
Comment
instanceof
CComment
)
{
if
(
true
===
Element
.
Start
)
Comment
.
Set_StartId
(
this
.
Get_Id
());
else
Comment
.
Set_EndId
(
this
.
Get_Id
());
}
}
if
(
Element
.
Set_Paragraph
)
Element
.
Set_Paragraph
(
this
);
this
.
Content
.
splice
(
Pos
,
0
,
Element
);
AscCommon
.
CollaborativeEditing
.
Update_DocumentPositionsOnAdd
(
this
,
Pos
);
if
(
Element
.
Recalc_RunsCompiledPr
)
Element
.
Recalc_RunsCompiledPr
();
}
}
this
.
private_ResetSelection
();
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_RemoveItem
:
{
// Long : Количество удаляемых элементов
// Array of Long : позиции удаляемых элементов
var
Count
=
Reader
.
GetLong
();
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
ChangesPos
=
this
.
m_oContentChanges
.
Check
(
AscCommon
.
contentchanges_Remove
,
Reader
.
GetLong
());
// действие совпало, не делаем его
if
(
false
===
ChangesPos
)
continue
;
this
.
Content
.
splice
(
ChangesPos
,
1
);
AscCommon
.
CollaborativeEditing
.
Update_DocumentPositionsOnRemove
(
this
,
ChangesPos
,
1
);
}
this
.
private_ResetSelection
();
this
.
private_UpdateTrackRevisions
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_Numbering
:
{
// Bool : IsUndefined
// Если false
// Variable : NumPr (CNumPr)
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
.
NumPr
=
undefined
;
else
{
this
.
Pr
.
NumPr
=
new
CNumPr
();
this
.
Pr
.
NumPr
.
Read_FromBinary
(
Reader
);
}
this
.
private_RefreshNumbering
(
this
.
Pr
.
NumPr
);
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Align
:
{
// Bool : IsUndefined
// Если false
// Long : Value
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
.
Jc
=
undefined
;
else
this
.
Pr
.
Jc
=
Reader
.
GetLong
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_First
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaInd
();
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
.
Ind
.
FirstLine
=
undefined
;
else
this
.
Pr
.
Ind
.
FirstLine
=
Reader
.
GetDouble
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_Left
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaInd
();
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
.
Ind
.
Left
=
undefined
;
else
this
.
Pr
.
Ind
.
Left
=
Reader
.
GetDouble
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Ind_Right
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
this
.
Pr
.
Ind
)
this
.
Pr
.
Ind
=
new
CParaInd
();
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
.
Ind
.
Right
=
undefined
;
else
this
.
Pr
.
Ind
.
Right
=
Reader
.
GetDouble
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_ContextualSpacing
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
.
ContextualSpacing
=
undefined
;
else
this
.
Pr
.
ContextualSpacing
=
Reader
.
GetBool
();
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_KeepLines
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
KeepLines
=
Reader
.
GetBool
();
else
this
.
Pr
.
KeepLines
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_KeepNext
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
KeepNext
=
Reader
.
GetBool
();
else
this
.
Pr
.
KeepNext
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PageBreakBefore
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
PageBreakBefore
=
Reader
.
GetBool
();
else
this
.
Pr
.
PageBreakBefore
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_Line
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
Spacing
.
Line
=
Reader
.
GetDouble
();
else
this
.
Pr
.
Spacing
.
Line
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
:
{
// Bool : IsUndefined
// Если false
// Long : Value
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
Spacing
.
LineRule
=
Reader
.
GetLong
();
else
this
.
Pr
.
Spacing
.
LineRule
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_Before
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
Spacing
.
Before
=
Reader
.
GetDouble
();
else
this
.
Pr
.
Spacing
.
Before
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_After
:
{
// Bool : IsUndefined
// Если false
// Double : Value
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
Spacing
.
After
=
Reader
.
GetDouble
();
else
this
.
Pr
.
Spacing
.
After
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
Spacing
.
AfterAutoSpacing
=
Reader
.
GetBool
();
else
this
.
Pr
.
Spacing
.
AfterAutoSpacing
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
:
{
// Bool : IsUndefined
// Если false
// Bool : Value
if
(
undefined
===
this
.
Pr
.
Spacing
)
this
.
Pr
.
Spacing
=
new
CParaSpacing
();
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
Spacing
.
BeforeAutoSpacing
=
Reader
.
GetBool
();
else
this
.
Pr
.
Spacing
.
BeforeAutoSpacing
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Value
:
{
// Bool : IsUndefined
// Если false
// Byte : Value
if
(
false
===
Reader
.
GetBool
()
)
{
if
(
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
this
.
Pr
.
Shd
.
Value
=
Reader
.
GetByte
();
}
else
if
(
undefined
!=
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
.
Value
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Color
:
{
// Bool : IsUndefined
// Если false
// Variable : Color (CDocumentColor)
if
(
false
===
Reader
.
GetBool
()
)
{
if
(
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
this
.
Pr
.
Shd
.
Color
=
new
CDocumentColor
(
0
,
0
,
0
);
this
.
Pr
.
Shd
.
Color
.
Read_FromBinary
(
Reader
);
}
else
if
(
undefined
!=
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
.
Color
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd_Unifill
:
{
if
(
false
===
Reader
.
GetBool
()
)
{
if
(
undefined
===
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
=
new
CDocumentShd
();
this
.
Pr
.
Shd
.
Unifill
=
new
AscFormat
.
CUniFill
();
this
.
Pr
.
Shd
.
Unifill
.
Read_FromBinary
(
Reader
);
}
else
if
(
undefined
!=
this
.
Pr
.
Shd
)
this
.
Pr
.
Shd
.
Unifill
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Shd
:
{
// Bool : IsUndefined
// Если false
// Byte : Value
if
(
false
===
Reader
.
GetBool
()
)
{
this
.
Pr
.
Shd
=
new
CDocumentShd
();
this
.
Pr
.
Shd
.
Read_FromBinary
(
Reader
);
}
else
this
.
Pr
.
Shd
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_WidowControl
:
{
{
// Bool : IsUndefined
var
ParaState
=
{};
ParaState
.
CurPos
=
// Если false
// Bool : Value
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
WidowControl
=
Reader
.
GetBool
();
else
this
.
Pr
.
WidowControl
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Tabs
:
{
{
// Bool : IsUndefined
X
:
this
.
CurPos
.
X
,
// Есди false
Y
:
this
.
CurPos
.
Y
,
// Variable : CParaTabs
Line
:
this
.
CurPos
.
Line
,
ContentPos
:
this
.
Get_ParaContentPos
(
false
,
false
),
RealX
:
this
.
CurPos
.
RealX
,
RealY
:
this
.
CurPos
.
RealY
,
PagesPos
:
this
.
CurPos
.
PagesPos
};
if
(
false
===
Reader
.
GetBool
()
)
ParaState
.
Selection
=
{
{
this
.
Pr
.
Tabs
=
new
CParaTabs
();
Start
:
this
.
Selection
.
Start
,
this
.
Pr
.
Tabs
.
Read_FromBinary
(
Reader
);
Use
:
this
.
Selection
.
Use
,
}
StartPos
:
0
,
else
EndPos
:
0
,
this
.
Pr
.
Tabs
=
undefined
;
Flag
:
this
.
Selection
.
Flag
};
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PStyle
:
if
(
true
===
this
.
Selection
.
Use
)
{
{
// Bool : Удаляем ли
ParaState
.
Selection
.
StartPos
=
this
.
Get_ParaContentPos
(
true
,
true
);
ParaState
.
Selection
.
EndPos
=
this
.
Get_ParaContentPos
(
true
,
false
);
// Если false
// String : StyleId
if
(
false
===
Reader
.
GetBool
()
)
this
.
Pr
.
PStyle
=
Reader
.
GetString2
();
else
this
.
Pr
.
PStyle
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
}
case
AscDFH
.
historyitem_Paragraph_DocNext
:
return
[
ParaState
];
{
},
// String : Id элемента
//this.Next = g_oTableId.Get_ById( Reader.GetString2() );
break
;
Set_SelectionState
:
function
(
State
,
StateIndex
)
}
case
AscDFH
.
historyitem_Paragraph_DocPrev
:
{
{
// String : Id элемента
if
(
State
.
length
<=
0
)
return
;
//this.Prev = g_oTableId.Get_ById( Reader.GetString2() );
break
;
var
ParaState
=
State
[
StateIndex
];
}
case
AscDFH
.
historyitem_Paragraph_Parent
:
{
// String : Id элемента
//this.Parent = g_oTableId.Get_ById( Reader.GetString2() );
this
.
CurPos
.
X
=
ParaState
.
CurPos
.
X
;
this
.
CurPos
.
Y
=
ParaState
.
CurPos
.
Y
;
this
.
CurPos
.
Line
=
ParaState
.
CurPos
.
Line
;
this
.
CurPos
.
RealX
=
ParaState
.
CurPos
.
RealX
;
this
.
CurPos
.
RealY
=
ParaState
.
CurPos
.
RealY
;
this
.
CurPos
.
PagesPos
=
ParaState
.
CurPos
.
PagesPos
;
break
;
this
.
Set_ParaContentPos
(
ParaState
.
CurPos
.
ContentPos
,
true
,
-
1
,
-
1
);
}
case
AscDFH
.
historyitem_Paragraph_Borders_Between
:
this
.
Selection_Remove
();
{
// Bool : IsUndefined
// если false
// Variable : Border (CDocumentBorder)
if
(
false
===
Reader
.
GetBool
()
)
this
.
Selection
.
Start
=
ParaState
.
Selection
.
Start
;
{
this
.
Selection
.
Use
=
ParaState
.
Selection
.
Use
;
this
.
Pr
.
Brd
.
Between
=
new
CDocumentBorder
();
this
.
Selection
.
Flag
=
ParaState
.
Selection
.
Flag
;
this
.
Pr
.
Brd
.
Between
.
Read_FromBinary
(
Reader
);
}
else
this
.
Pr
.
Brd
.
Between
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
if
(
true
===
this
.
Selection
.
Use
)
bPrChanged
=
true
;
this
.
Set_SelectionContentPos
(
ParaState
.
Selection
.
StartPos
,
ParaState
.
Selection
.
EndPos
);
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
},
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Bottom
:
Get_ParentObject_or_DocumentPos
:
function
()
{
{
// Bool : IsUndefined
this
.
Parent
.
Update_ContentIndexing
();
// если false
return
this
.
Parent
.
Get_ParentObject_or_DocumentPos
(
this
.
Index
);
// Variable : Border (CDocumentBorder)
},
if
(
false
===
Reader
.
GetBool
()
)
Refresh_RecalcData
:
function
(
Data
)
{
{
this
.
Pr
.
Brd
.
Bottom
=
new
CDocumentBorder
();
var
Type
=
Data
.
Type
;
this
.
Pr
.
Brd
.
Bottom
.
Read_FromBinary
(
Reader
);
}
else
this
.
Pr
.
Brd
.
Bottom
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
var
bNeedRecalc
=
false
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Left
:
var
CurPage
=
0
;
{
// Bool : IsUndefined
// если false
// Variable : Border (CDocumentBorder)
if
(
false
===
Reader
.
GetBool
()
)
switch
(
Type
)
{
{
this
.
Pr
.
Brd
.
Left
=
new
CDocumentBorder
();
case
AscDFH
.
historyitem_Paragraph_AddItem
:
this
.
Pr
.
Brd
.
Left
.
Read_FromBinary
(
Reader
);
case
AscDFH
.
historyitem_Paragraph_RemoveItem
:
}
else
this
.
Pr
.
Brd
.
Left
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_Borders_Right
:
{
{
// Bool : IsUndefined
for
(
CurPage
=
this
.
Pages
.
length
-
1
;
CurPage
>
0
;
CurPage
--
)
// если false
// Variable : Border (CDocumentBorder)
if
(
false
===
Reader
.
GetBool
()
)
{
{
this
.
Pr
.
Brd
.
Right
=
new
CDocumentBorder
();
if
(
Data
.
Pos
>
this
.
Lines
[
this
.
Pages
[
CurPage
].
StartLine
].
Get_StartPos
()
)
this
.
Pr
.
Brd
.
Right
.
Read_FromBinary
(
Reader
);
}
else
this
.
Pr
.
Brd
.
Right
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
break
;
}
}
case
AscDFH
.
historyitem_Paragraph_Borders_Top
:
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
{
bNeedRecalc
=
true
;
// Bool : IsUndefined
// если false
// Variable : Border (CDocumentBorder)
if
(
false
===
Reader
.
GetBool
()
)
{
this
.
Pr
.
Brd
.
Top
=
new
CDocumentBorder
();
this
.
Pr
.
Brd
.
Top
.
Read_FromBinary
(
Reader
);
}
else
this
.
Pr
.
Brd
.
Top
=
undefined
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
bPrChanged
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
break
;
}
}
case
AscDFH
.
historyitem_Paragraph_Numbering
:
case
AscDFH
.
historyitem_Paragraph_PStyle
:
case
AscDFH
.
historyitem_Paragraph_Pr
:
case
AscDFH
.
historyitem_Paragraph_Pr
:
{
// Bool : IsUndefined
if
(
true
===
Reader
.
GetBool
()
)
this
.
Pr
=
new
CParaPr
();
else
{
this
.
Pr
=
new
CParaPr
();
this
.
Pr
.
Read_FromBinary
(
Reader
);
}
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
:
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
:
{
// Variable : Bullet
if
(
Reader
.
GetBool
())
{
this
.
Pr
.
Bullet
=
new
AscFormat
.
CBullet
();
this
.
Pr
.
Bullet
.
Read_FromBinary
(
Reader
);
}
else
{
this
.
Pr
.
Bullet
=
undefined
;
}
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
}
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
:
case
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
:
{
{
// Long : Level
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
this
.
Pr
.
Lvl
=
Reader
.
GetLong
();
bNeedRecalc
=
true
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
Recalc_RunsCompiledPr
();
this
.
Recalc_RunsCompiledPr
();
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
break
;
}
}
case
AscDFH
.
historyitem_Paragraph_Align
:
case
AscDFH
.
historyitem_Paragraph_Ind_First
:
case
AscDFH
.
historyitem_Paragraph_Ind_Left
:
case
AscDFH
.
historyitem_Paragraph_Ind_Right
:
case
AscDFH
.
historyitem_Paragraph_ContextualSpacing
:
case
AscDFH
.
historyitem_Paragraph_KeepLines
:
case
AscDFH
.
historyitem_Paragraph_KeepNext
:
case
AscDFH
.
historyitem_Paragraph_PageBreakBefore
:
case
AscDFH
.
historyitem_Paragraph_Spacing_Line
:
case
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
:
case
AscDFH
.
historyitem_Paragraph_Spacing_Before
:
case
AscDFH
.
historyitem_Paragraph_Spacing_After
:
case
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
:
case
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
:
case
AscDFH
.
historyitem_Paragraph_WidowControl
:
case
AscDFH
.
historyitem_Paragraph_Tabs
:
case
AscDFH
.
historyitem_Paragraph_Borders_Between
:
case
AscDFH
.
historyitem_Paragraph_Borders_Bottom
:
case
AscDFH
.
historyitem_Paragraph_Borders_Left
:
case
AscDFH
.
historyitem_Paragraph_Borders_Right
:
case
AscDFH
.
historyitem_Paragraph_Borders_Top
:
case
AscDFH
.
historyitem_Paragraph_FramePr
:
case
AscDFH
.
historyitem_Paragraph_FramePr
:
{
{
// Bool : IsUndefined
bNeedRecalc
=
true
;
// false ->
// Variable : CFramePr
if
(
false
===
Reader
.
GetBool
()
)
{
this
.
Pr
.
FramePr
=
new
CFramePr
();
this
.
Pr
.
FramePr
.
Read_FromBinary
(
Reader
);
}
else
{
this
.
Pr
.
FramePr
=
undefined
;
}
this
.
CompiledPr
.
NeedRecalc
=
true
;
this
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
break
;
break
;
}
}
case
AscDFH
.
historyitem_Paragraph_Shd_Value
:
case
AscDFH
.
historyitem_Paragraph_SectionPr
:
case
AscDFH
.
historyitem_Paragraph_Shd_Color
:
case
AscDFH
.
historyitem_Paragraph_Shd_Unifill
:
case
AscDFH
.
historyitem_Paragraph_Shd
:
{
{
// Bool : IsUndefined
if
(
this
.
Parent
)
// false ->
// String2 : SectPr.Id
this
.
SectPr
=
(
true
===
Reader
.
GetBool
()
?
undefined
:
g_oTableId
.
Get_ById
(
Reader
.
GetString2
()
)
);
this
.
LogicDocument
.
Update_SectionsInfo
();
break
;
}
case
AscDFH
.
historyitem_Paragraph_PrChange
:
{
{
// Bool : is undefined ?
var
oDrawingShape
=
this
.
Parent
.
Is_DrawingShape
(
true
);
// false -> PrChange
if
(
oDrawingShape
)
// Bool : is undefined ?
// false -> ReviewInfo
if
(
false
===
Reader
.
GetBool
())
{
{
this
.
Pr
.
PrChange
=
new
CParaPr
();
if
(
oDrawingShape
.
chekBodyPrTransform
(
oDrawingShape
.
getBodyPr
())
||
oDrawingShape
.
checkContentWordArt
(
oDrawingShape
.
getDocContent
()))
this
.
Pr
.
PrChange
.
Read_FromBinary
(
Reader
);
}
else
{
{
this
.
Pr
.
PrChange
=
undefined
;
bNeedRecalc
=
true
;
}
}
if
(
false
===
Reader
.
GetBool
())
{
this
.
Pr
.
ReviewInfo
=
new
CReviewInfo
();
this
.
Pr
.
ReviewInfo
.
Read_FromBinary
(
Reader
);
}
}
else
{
this
.
Pr
.
ReviewInfo
=
undefined
;
}
}
this
.
private_UpdateTrackRevisions
();
break
;
break
;
}
}
case
AscDFH
.
historyitem_Paragraph_PrReviewInfo
:
{
// Bool : is undefined ?
// false -> ReviewInfo
if
(
false
===
Reader
.
GetBool
())
{
this
.
Pr
.
ReviewInfo
=
new
CReviewInfo
();
this
.
Pr
.
ReviewInfo
.
Read_FromBinary
(
Reader
);
}
}
else
if
(
true
===
bNeedRecalc
)
{
{
this
.
Pr
.
ReviewInfo
=
undefined
;
var
Prev
=
this
.
Get_DocumentPrev
();
}
if
(
0
===
CurPage
&&
null
!=
Prev
&&
type_Paragraph
===
Prev
.
GetType
()
&&
true
===
Prev
.
Get_CompiledPr2
(
false
).
ParaPr
.
KeepNext
)
Prev
.
Refresh_RecalcData2
(
Prev
.
Pages
.
length
-
1
);
break
;
// Сообщаем родительскому классу, что изменения произошли в элементе с номером this.Index и на странице this.PageNum
}
return
this
.
Refresh_RecalcData2
(
CurPage
);
}
}
},
this
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
Refresh_RecalcData2
:
function
(
CurPage
)
this
.
RecalcInfo
.
Set_Type_0_Spell
(
pararecalc_0_Spell_All
);
{
if
(
!
CurPage
)
CurPage
=
0
;
if
(
bPrChanged
&&
oColor
)
// Если Index < 0, значит данный элемент еще не был добавлен в родительский класс
this
.
private_AddCollPrChange
(
oColor
);
if
(
this
.
Index
>=
0
)
this
.
Parent
.
Refresh_RecalcData2
(
this
.
Index
,
this
.
private_GetRelativePageIndex
(
CurPage
));
},
},
//-----------------------------------------------------------------------------------
// Функции для совместного редактирования
//-----------------------------------------------------------------------------------
Write_ToBinary2
:
function
(
Writer
)
Write_ToBinary2
:
function
(
Writer
)
{
{
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_Paragraph
);
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_Paragraph
);
...
@@ -12646,6 +10631,9 @@ Paragraph.prototype =
...
@@ -12646,6 +10631,9 @@ Paragraph.prototype =
this
.
Pr
.
Read_FromBinary
(
Reader
);
this
.
Pr
.
Read_FromBinary
(
Reader
);
this
.
TextPr
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
()
);
this
.
TextPr
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
()
);
this
.
Next
=
null
;
this
.
Prev
=
null
;
this
.
Content
=
[];
this
.
Content
=
[];
var
Count
=
Reader
.
GetLong
();
var
Count
=
Reader
.
GetLong
();
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
...
...
word/Editor/ParagraphChanges.js
0 → 100644
View file @
34340161
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* 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: 27.10.2016
* Time: 18:01
*/
function
private_ParagraphChangesOnLoadPr
(
oColor
)
{
this
.
Redo
();
if
(
oColor
)
this
.
Class
.
private_AddCollPrChange
(
oColor
);
}
function
private_ParagraphChangesOnSetValue
(
oParagraph
)
{
oParagraph
.
RecalcInfo
.
Set_Type_0
(
pararecalc_0_All
);
oParagraph
.
RecalcInfo
.
Set_Type_0_Spell
(
pararecalc_0_Spell_All
);
}
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function
CChangesParagraphAddItem
(
Class
,
Pos
,
Items
,
EndPos
)
{
CChangesParagraphAddItem
.
superclass
.
constructor
.
call
(
this
,
Class
);
this
.
Pos
=
Pos
;
this
.
Items
=
Items
;
this
.
EndPos
=
EndPos
;
this
.
UseArray
=
false
;
this
.
PosArray
=
[];
}
AscCommon
.
extendClass
(
CChangesParagraphAddItem
,
AscDFH
.
CChangesBase
);
CChangesParagraphAddItem
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_AddItem
;
CChangesParagraphAddItem
.
prototype
.
Undo
=
function
()
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Content
.
splice
(
this
.
Pos
,
this
.
EndPos
-
this
.
Pos
+
1
);
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphAddItem
.
prototype
.
Redo
=
function
()
{
var
oParagraph
=
this
.
Class
;
var
Array_start
=
this
.
Content
.
slice
(
0
,
this
.
Pos
);
var
Array_end
=
this
.
Content
.
slice
(
this
.
Pos
);
oParagraph
.
Content
=
Array_start
.
concat
(
this
.
Items
,
Array_end
);
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphAddItem
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id элемента
// }
var
bArray
=
this
.
UseArray
;
var
nCount
=
this
.
Items
.
length
;
Writer
.
WriteLong
(
nCount
);
for
(
var
nIndex
=
0
;
nIndex
<
nCount
;
++
nIndex
)
{
if
(
true
===
bArray
)
Writer
.
WriteLong
(
this
.
PosArray
[
nIndex
]);
else
Writer
.
WriteLong
(
this
.
Pos
+
nIndex
);
Writer
.
WriteString2
(
this
.
Items
[
nIndex
].
Get_Id
());
}
};
CChangesParagraphAddItem
.
prototype
.
ReadFromBinary
=
function
(
Reader
)
{
// Long : Количество элементов
// Array of :
// {
// Long : Позиция
// Variable : Id Элемента
// }
this
.
UseArray
=
true
;
this
.
Items
=
[];
this
.
PosArray
=
[];
var
nCount
=
Reader
.
GetLong
();
for
(
var
nIndex
=
0
;
nIndex
<
nCount
;
++
nIndex
)
{
this
.
PosArray
[
nIndex
]
=
Reader
.
GetLong
();
this
.
Items
[
nIndex
]
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
());
}
};
CChangesParagraphAddItem
.
prototype
.
Load
=
function
(
Color
)
{
var
oParagraph
=
this
.
Class
;
for
(
var
nIndex
=
0
,
nCount
=
this
.
Items
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
var
Pos
=
this
.
m_oContentChanges
.
Check
(
AscCommon
.
contentchanges_Add
,
this
.
PosArray
[
nIndex
]);
var
Element
=
this
.
Items
[
nIndex
];
if
(
null
!=
Element
)
{
if
(
para_Comment
===
Element
.
Type
)
{
var
Comment
=
g_oTableId
.
Get_ById
(
Element
.
CommentId
);
// При копировании не всегда сразу заполняется правильно CommentId
if
(
null
!=
Comment
&&
Comment
instanceof
CComment
)
{
if
(
true
===
Element
.
Start
)
Comment
.
Set_StartId
(
oParagraph
.
Get_Id
());
else
Comment
.
Set_EndId
(
oParagraph
.
Get_Id
());
}
}
if
(
Element
.
Set_Paragraph
)
Element
.
Set_Paragraph
(
oParagraph
);
oParagraph
.
Content
.
splice
(
Pos
,
0
,
Element
);
AscCommon
.
CollaborativeEditing
.
Update_DocumentPositionsOnAdd
(
oParagraph
,
Pos
);
if
(
Element
.
Recalc_RunsCompiledPr
)
Element
.
Recalc_RunsCompiledPr
();
}
}
oParagraph
.
private_ResetSelection
();
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function
CChangesParagraphRemoveItem
(
Class
,
Pos
,
Items
,
EndPos
)
{
CChangesParagraphRemoveItem
.
superclass
.
constructor
.
call
(
this
,
Class
);
this
.
Pos
=
Pos
;
this
.
Items
=
Items
;
this
.
EndPos
=
EndPos
;
this
.
UseArray
=
false
;
this
.
PosArray
=
[];
}
AscCommon
.
extendClass
(
CChangesParagraphRemoveItem
,
AscDFH
.
CChangesBase
);
CChangesParagraphRemoveItem
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_RemoveItem
;
CChangesParagraphRemoveItem
.
prototype
.
Undo
=
function
()
{
var
oParagraph
=
this
.
Class
;
var
Array_start
=
this
.
Content
.
slice
(
0
,
this
.
Pos
);
var
Array_end
=
this
.
Content
.
slice
(
this
.
Pos
);
oParagraph
.
Content
=
Array_start
.
concat
(
this
.
Items
,
Array_end
);
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphRemoveItem
.
prototype
.
Redo
=
function
()
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Content
.
splice
(
this
.
Pos
,
this
.
EndPos
-
this
.
Pos
+
1
);
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphRemoveItem
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Количество удаляемых элементов
// Array of
// {
// Long : позиции удаляемых элементов
// String : id удаляемых элементов
// }
var
bArray
=
this
.
UseArray
;
var
nCount
=
this
.
Items
.
length
;
var
nStartPos
=
Writer
.
GetCurPosition
();
Writer
.
Skip
(
4
);
var
nRealCount
=
nCount
;
for
(
var
nIndex
=
0
;
nIndex
<
nCount
;
++
nIndex
)
{
if
(
true
===
bArray
)
{
if
(
false
===
this
.
PosArray
[
nIndex
])
{
nRealCount
--
;
}
else
{
Writer
.
WriteLong
(
this
.
PosArray
[
nIndex
]);
Writer
.
WriteString2
(
this
.
Items
[
nIndex
]);
}
}
else
{
Writer
.
WriteLong
(
this
.
Pos
);
Writer
.
WriteString2
(
this
.
Items
[
nIndex
]);
}
}
var
nEndPos
=
Writer
.
GetCurPosition
();
Writer
.
Seek
(
nStartPos
);
Writer
.
WriteLong
(
nRealCount
);
Writer
.
Seek
(
nEndPos
);
};
CChangesParagraphRemoveItem
.
prototype
.
ReadFromBinary
=
function
(
Reader
)
{
// Long : Количество удаляемых элементов
// Array of
// {
// Long : позиции удаляемых элементов
// String : id удаляемых элементов
// }
this
.
UseArray
=
true
;
this
.
Items
=
[];
this
.
PosArray
=
[];
var
nCount
=
Reader
.
GetLong
();
for
(
var
nIndex
=
0
;
nIndex
<
nCount
;
++
nIndex
)
{
this
.
PosArray
[
nIndex
]
=
Reader
.
GetLong
();
this
.
Items
[
nIndex
]
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
());
}
};
CChangesParagraphRemoveItem
.
prototype
.
Load
=
function
(
Color
)
{
var
oParagraph
=
this
.
Class
;
for
(
var
nIndex
=
0
,
nCount
=
this
.
Items
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
var
ChangesPos
=
this
.
m_oContentChanges
.
Check
(
AscCommon
.
contentchanges_Remove
,
this
.
PosArray
[
nIndex
]);
if
(
false
===
ChangesPos
)
continue
;
oParagraph
.
Content
.
splice
(
ChangesPos
,
1
);
AscCommon
.
CollaborativeEditing
.
Update_DocumentPositionsOnRemove
(
oParagraph
,
ChangesPos
,
1
);
}
oParagraph
.
private_ResetSelection
();
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphNumbering
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphNumbering
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphNumbering
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphNumbering
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Numbering
;
CChangesParagraphNumbering
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CNumPr
();
};
CChangesParagraphNumbering
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
NumPr
=
Value
;
oParagraph
.
private_RefreshNumbering
(
oParagraph
.
Pr
.
NumPr
);
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphNumbering
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function
CChangesParagraphAlign
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphAlign
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphAlign
,
AscDFH
.
CChangesBaseLongProperty
);
CChangesParagraphAlign
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Align
;
CChangesParagraphAlign
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Jc
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphAlign
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function
CChangesParagraphIndFirst
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphIndFirst
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphIndFirst
,
AscDFH
.
CChangesBaseDoubleProperty
);
CChangesParagraphIndFirst
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Ind_First
;
CChangesParagraphIndFirst
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Ind
)
oParagraph
.
Pr
.
Ind
=
new
CParaInd
();
oParagraph
.
Pr
.
Ind
.
FirstLine
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphIndFirst
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function
CChangesParagraphIndLeft
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphIndLeft
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphIndLeft
,
AscDFH
.
CChangesBaseDoubleProperty
);
CChangesParagraphIndLeft
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Ind_Left
;
CChangesParagraphIndLeft
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Ind
)
oParagraph
.
Pr
.
Ind
=
new
CParaInd
();
oParagraph
.
Pr
.
Ind
.
Left
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphIndLeft
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function
CChangesParagraphIndRight
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphIndRight
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphIndRight
,
AscDFH
.
CChangesBaseDoubleProperty
);
CChangesParagraphIndRight
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Ind_Right
;
CChangesParagraphIndRight
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Ind
)
oParagraph
.
Pr
.
Ind
=
new
CParaInd
();
oParagraph
.
Pr
.
Ind
.
Right
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphIndRight
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphContextualSpacing
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphContextualSpacing
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphContextualSpacing
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphContextualSpacing
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_ContextualSpacing
;
CChangesParagraphContextualSpacing
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
ContextualSpacing
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphContextualSpacing
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphKeepLines
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphKeepLines
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphKeepLines
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphKeepLines
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_KeepLines
;
CChangesParagraphKeepLines
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
KeepLines
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphKeepLines
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphKeepNext
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphKeepNext
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphKeepNext
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphKeepNext
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_KeepNext
;
CChangesParagraphKeepNext
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
KeepNext
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphKeepNext
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphPageBreakBefore
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphPageBreakBefore
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphPageBreakBefore
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphPageBreakBefore
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_PageBreakBefore
;
CChangesParagraphPageBreakBefore
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
PageBreakBefore
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphPageBreakBefore
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function
CChangesParagraphSpacingLine
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphSpacingLine
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphSpacingLine
,
AscDFH
.
CChangesBaseDoubleProperty
);
CChangesParagraphSpacingLine
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Spacing_Line
;
CChangesParagraphSpacingLine
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Spacing
)
oParagraph
.
Pr
.
Spacing
=
new
CParaSpacing
();
oParagraph
.
Pr
.
Spacing
.
Line
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSpacingLine
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function
CChangesParagraphSpacingLineRule
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphSpacingLineRule
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphSpacingLineRule
,
AscDFH
.
CChangesBaseLongProperty
);
CChangesParagraphSpacingLineRule
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Spacing_LineRule
;
CChangesParagraphSpacingLineRule
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Spacing
)
oParagraph
.
Pr
.
Spacing
=
new
CParaSpacing
();
oParagraph
.
Pr
.
Spacing
.
LineRule
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSpacingLineRule
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function
CChangesParagraphSpacingBefore
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphSpacingBefore
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphSpacingBefore
,
AscDFH
.
CChangesBaseDoubleProperty
);
CChangesParagraphSpacingBefore
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Spacing_Before
;
CChangesParagraphSpacingBefore
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Spacing
)
oParagraph
.
Pr
.
Spacing
=
new
CParaSpacing
();
oParagraph
.
Pr
.
Spacing
.
Before
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSpacingBefore
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseDoubleProperty}
*/
function
CChangesParagraphSpacingAfter
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphSpacingAfter
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphSpacingAfter
,
AscDFH
.
CChangesBaseDoubleProperty
);
CChangesParagraphSpacingAfter
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Spacing_After
;
CChangesParagraphSpacingAfter
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Spacing
)
oParagraph
.
Pr
.
Spacing
=
new
CParaSpacing
();
oParagraph
.
Pr
.
Spacing
.
After
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSpacingAfter
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphSpacingAfterAutoSpacing
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphSpacingAfterAutoSpacing
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphSpacingAfterAutoSpacing
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphSpacingAfterAutoSpacing
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Spacing_AfterAutoSpacing
;
CChangesParagraphSpacingAfterAutoSpacing
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Spacing
)
oParagraph
.
Pr
.
Spacing
=
new
CParaSpacing
();
oParagraph
.
Pr
.
Spacing
.
AfterAutoSpacing
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSpacingAfterAutoSpacing
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphSpacingBeforeAutoSpacing
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphSpacingBeforeAutoSpacing
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphSpacingBeforeAutoSpacing
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphSpacingBeforeAutoSpacing
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Spacing_BeforeAutoSpacing
;
CChangesParagraphSpacingBeforeAutoSpacing
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Spacing
)
oParagraph
.
Pr
.
Spacing
=
new
CParaSpacing
();
oParagraph
.
Pr
.
Spacing
.
BeforeAutoSpacing
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSpacingBeforeAutoSpacing
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseByteProperty}
*/
function
CChangesParagraphShdValue
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphShdValue
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphShdValue
,
AscDFH
.
CChangesBaseByteProperty
);
CChangesParagraphShdValue
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Shd_Value
;
CChangesParagraphShdValue
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Shd
)
oParagraph
.
Pr
.
Shd
=
new
CDocumentShd
();
oParagraph
.
Pr
.
Shd
.
Value
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphShdValue
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphShdColor
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphShdColor
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphShdColor
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphShdColor
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Shd_Color
;
CChangesParagraphShdColor
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentColor
(
0
,
0
,
0
);
};
CChangesParagraphShdColor
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Shd
)
oParagraph
.
Pr
.
Shd
=
new
CDocumentShd
();
oParagraph
.
Pr
.
Shd
.
Color
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphShdColor
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphShdUnifill
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphShdUnifill
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphShdUnifill
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphShdUnifill
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Shd_Unifill
;
CChangesParagraphShdUnifill
.
prototype
.
private_CreateObject
=
function
()
{
return
new
AscFormat
.
CUniFill
();
};
CChangesParagraphShdUnifill
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
if
(
undefined
===
oParagraph
.
Pr
.
Shd
)
oParagraph
.
Pr
.
Shd
=
new
CDocumentShd
();
oParagraph
.
Pr
.
Shd
.
Unifill
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphShdUnifill
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphShd
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphShd
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphShd
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphShd
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Shd
;
CChangesParagraphShd
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentShd
();
};
CChangesParagraphShd
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Shd
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphShd
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseBoolProperty}
*/
function
CChangesParagraphWidowControl
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphWidowControl
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphWidowControl
,
AscDFH
.
CChangesBaseBoolProperty
);
CChangesParagraphWidowControl
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_WidowControl
;
CChangesParagraphWidowControl
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
WidowControl
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphWidowControl
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphTabs
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphTabs
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphTabs
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphTabs
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Tabs
;
CChangesParagraphTabs
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CParaTabs
();
};
CChangesParagraphTabs
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Tabs
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphTabs
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseStringProperty}
*/
function
CChangesParagraphPStyle
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphPStyle
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphPStyle
,
AscDFH
.
CChangesBaseStringProperty
);
CChangesParagraphPStyle
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_PStyle
;
CChangesParagraphPStyle
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
PStyle
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphPStyle
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphBordersBetween
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphBordersBetween
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphBordersBetween
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphBordersBetween
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Borders_Between
;
CChangesParagraphBordersBetween
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentBorder
();
};
CChangesParagraphBordersBetween
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Brd
.
Between
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphBordersBetween
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphBordersBottom
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphBordersBottom
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphBordersBottom
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphBordersBottom
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Borders_Bottom
;
CChangesParagraphBordersBottom
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentBorder
();
};
CChangesParagraphBordersBottom
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Brd
.
Bottom
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphBordersBottom
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphBordersLeft
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphBordersLeft
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphBordersLeft
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphBordersLeft
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Borders_Left
;
CChangesParagraphBordersLeft
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentBorder
();
};
CChangesParagraphBordersLeft
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Brd
.
Left
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphBordersLeft
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphBordersRight
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphBordersRight
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphBordersRight
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphBordersRight
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Borders_Right
;
CChangesParagraphBordersRight
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentBorder
();
};
CChangesParagraphBordersRight
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Brd
.
Right
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphBordersRight
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphBordersTop
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphBordersTop
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphBordersTop
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphBordersTop
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Borders_Top
;
CChangesParagraphBordersTop
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CDocumentBorder
();
};
CChangesParagraphBordersTop
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Brd
.
Top
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphBordersTop
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphPr
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphPr
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphPr
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphPr
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_Pr
;
CChangesParagraphPr
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CParaPr
();
};
CChangesParagraphPr
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphPr
.
prototype
.
private_IsCreateEmptyObject
=
function
()
{
return
true
;
};
CChangesParagraphPr
.
prototype
.
Load
=
private_ParagraphChangesOnLoadPr
;
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphPresentationPrBullet
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphPresentationPrBullet
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphPresentationPrLevel
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphPresentationPrBullet
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_PresentationPr_Bullet
;
CChangesParagraphPresentationPrBullet
.
prototype
.
private_CreateObject
=
function
()
{
return
new
AscFormat
.
CBullet
();
};
CChangesParagraphPresentationPrBullet
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Bullet
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
Recalc_RunsCompiledPr
();
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseLongProperty}
*/
function
CChangesParagraphPresentationPrLevel
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphPresentationPrLevel
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphPresentationPrLevel
,
AscDFH
.
CChangesBaseLongProperty
);
CChangesParagraphPresentationPrLevel
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_PresentationPr_Level
;
CChangesParagraphPresentationPrLevel
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
Lvl
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
Recalc_RunsCompiledPr
();
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphFramePr
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphFramePr
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphFramePr
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphFramePr
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_FramePr
;
CChangesParagraphFramePr
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CFramePr
();
};
CChangesParagraphFramePr
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
FramePr
=
Value
;
oParagraph
.
CompiledPr
.
NeedRecalc
=
true
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function
CChangesParagraphSectPr
(
Class
,
Old
,
New
)
{
CChangesParagraphSectPr
.
superclass
.
constructor
.
call
(
this
,
Class
);
this
.
Old
=
Old
;
this
.
New
=
New
;
}
AscCommon
.
extendClass
(
CChangesParagraphSectPr
,
AscDFH
.
CChangesBase
);
CChangesParagraphSectPr
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_SectionPr
;
CChangesParagraphSectPr
.
prototype
.
Undo
=
function
()
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
SectPr
=
this
.
Old
;
oParagraph
.
LogicDocument
.
Update_SectionsInfo
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSectPr
.
prototype
.
Redo
=
function
()
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
SectPr
=
this
.
New
;
oParagraph
.
LogicDocument
.
Update_SectionsInfo
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphSectPr
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
// 1-bit : IsUndefined New
// 2-bit : IsUndefined Old
// String : Id of New
// String : Id of Old
var
nFlags
=
0
;
if
(
undefined
===
this
.
New
)
nFlags
|=
1
;
if
(
undefined
===
this
.
Old
)
nFlags
|=
2
;
Writer
.
WriteLong
(
nFlags
);
if
(
undefined
!==
this
.
New
)
Writer
.
WriteString2
(
this
.
New
.
Get_Id
());
if
(
undefined
!==
this
.
Old
)
Writer
.
WriteString2
(
this
.
Old
.
Get_Id
());
};
CChangesParagraphSectPr
.
prototype
.
ReadFromBinary
=
function
(
Reader
)
{
// Long : Flag
// 1-bit : IsUndefined New
// 2-bit : IsUndefined Old
// String : Id of New
// String : Id of Old
var
nFlags
=
Reader
.
GetLong
();
if
(
nFlags
&
1
)
this
.
New
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
());
else
this
.
New
=
undefined
;
if
(
nFlags
&
2
)
this
.
Old
=
g_oTableId
.
Get_ById
(
Reader
.
GetString2
());
else
this
.
Old
=
undefined
;
};
/**
* @constructor
* @extends {AscDFH.CChangesBase}
*/
function
CChangesParagraphPrChange
(
Class
,
Old
,
New
)
{
CChangesParagraphPrChange
.
superclass
.
constructor
.
call
(
this
,
Class
);
this
.
Old
=
Old
;
this
.
New
=
New
;
}
AscCommon
.
extendClass
(
CChangesParagraphPrChange
,
AscDFH
.
CChangesBase
);
CChangesParagraphPrChange
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_PrChange
;
CChangesParagraphPrChange
.
prototype
.
Undo
=
function
()
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
PrChange
=
this
.
Old
.
PrChange
;
oParagraph
.
Pr
.
ReviewInfo
=
this
.
Old
.
ReviewInfo
;
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphPrChange
.
prototype
.
Redo
=
function
()
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
PrChange
=
this
.
New
.
PrChange
;
oParagraph
.
Pr
.
ReviewInfo
=
this
.
New
.
ReviewInfo
;
oParagraph
.
private_UpdateTrackRevisions
();
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
CChangesParagraphPrChange
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flags
// 1-bit : is New.PrChange undefined ?
// 2-bit : is New.ReviewInfo undefined ?
// 3-bit : is Old.PrChange undefined ?
// 4-bit : is Old.ReviewInfo undefined ?
// Variable(CParaPr) : New.PrChange (1bit = 0)
// Variable(CReviewInfo) : New.ReviewInfo (2bit = 0)
// Variable(CParaPr) : Old.PrChange (3bit = 0)
// Variable(CReviewInfo) : Old.ReviewInfo (4bit = 0)
var
nFlags
=
0
;
if
(
undefined
===
this
.
New
.
PrChange
)
nFlags
|=
1
;
if
(
undefined
===
this
.
New
.
ReviewInfo
)
nFlags
|=
2
;
if
(
undefined
===
this
.
Old
.
PrChange
)
nFlags
|=
4
;
if
(
undefined
===
this
.
Old
.
ReviewInfo
)
nFlags
|=
8
;
Writer
.
WriteLong
(
nFlags
);
if
(
undefined
!==
this
.
New
.
PrChange
)
this
.
New
.
PrChange
.
Write_ToBinary
(
Writer
);
if
(
undefined
!==
this
.
New
.
ReviewInfo
)
this
.
New
.
ReviewInfo
.
Write_ToBinary
(
Writer
);
if
(
undefined
!==
this
.
Old
.
PrChange
)
this
.
Old
.
PrChange
.
Write_ToBinary
(
Writer
);
if
(
undefined
!==
this
.
Old
.
ReviewInfo
)
this
.
Old
.
ReviewInfo
.
Write_ToBinary
(
Writer
);
};
CChangesParagraphPrChange
.
prototype
.
ReadFromBinary
=
function
(
Reader
)
{
// Long : Flags
// 1-bit : is New.PrChange undefined ?
// 2-bit : is New.ReviewInfo undefined ?
// 3-bit : is Old.PrChange undefined ?
// 4-bit : is Old.ReviewInfo undefined ?
// Variable(CParaPr) : New.PrChange (1bit = 0)
// Variable(CReviewInfo) : New.ReviewInfo (2bit = 0)
// Variable(CParaPr) : Old.PrChange (3bit = 0)
// Variable(CReviewInfo) : Old.ReviewInfo (4bit = 0)
var
nFlags
=
Reader
.
GetLong
();
if
(
nFlags
&
1
)
{
this
.
New
.
PrChange
=
undefined
;
}
else
{
this
.
New
.
PrChange
=
new
CParaPr
();
this
.
New
.
PrChange
.
Read_FromBinary
(
Reader
);
}
if
(
nFlags
&
2
)
{
this
.
New
.
ReviewInfo
=
undefined
;
}
else
{
this
.
New
.
ReviewInfo
=
new
CReviewInfo
();
this
.
New
.
ReviewInfo
.
Read_FromBinary
(
Reader
);
}
if
(
nFlags
&
4
)
{
this
.
Old
.
PrChange
=
undefined
;
}
else
{
this
.
Old
.
PrChange
=
new
CParaPr
();
this
.
Old
.
PrChange
.
Read_FromBinary
(
Reader
);
}
if
(
nFlags
&
8
)
{
this
.
Old
.
ReviewInfo
=
undefined
;
}
else
{
this
.
Old
.
ReviewInfo
=
new
CReviewInfo
();
this
.
Old
.
ReviewInfo
.
Read_FromBinary
(
Reader
);
}
};
/**
* @constructor
* @extends {AscDFH.CChangesBaseObjectProperty}
*/
function
CChangesParagraphPrReviewInfo
(
Class
,
Old
,
New
,
Color
)
{
CChangesParagraphPrReviewInfo
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesParagraphPrReviewInfo
,
AscDFH
.
CChangesBaseObjectProperty
);
CChangesParagraphPrReviewInfo
.
prototype
.
Type
=
AscDFH
.
historyitem_Paragraph_PrReviewInfo
;
CChangesParagraphPrReviewInfo
.
prototype
.
private_CreateObject
=
function
()
{
return
new
CReviewInfo
();
};
CChangesParagraphPrReviewInfo
.
prototype
.
private_SetValue
=
function
(
Value
)
{
var
oParagraph
=
this
.
Class
;
oParagraph
.
Pr
.
ReviewInfo
=
Value
;
oParagraph
.
private_UpdateTrackRevisionOnChangeParaPr
(
false
);
private_ParagraphChangesOnSetValue
(
this
.
Class
);
};
\ No newline at end of file
word/Editor/Table.js
View file @
34340161
...
@@ -5361,6 +5361,9 @@ CTable.prototype =
...
@@ -5361,6 +5361,9 @@ CTable.prototype =
// Long : количество строк
// Long : количество строк
// Array of Strings : массив Id строк
// Array of Strings : массив Id строк
this
.
Prev
=
null
;
this
.
Next
=
null
;
Reader
.
GetLong
();
Reader
.
GetLong
();
this
.
Id
=
Reader
.
GetString2
();
this
.
Id
=
Reader
.
GetString2
();
...
...
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