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
Expand all
Hide 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
This diff is collapsed.
Click to expand it.
word/Editor/DocumentChanges.js
View file @
34340161
...
...
@@ -66,6 +66,24 @@ CChangesDocumentAddItem.prototype.Undo = function()
var
Elements
=
oDocument
.
Content
.
splice
(
this
.
Pos
,
1
);
oDocument
.
private_RecalculateNumbering
(
Elements
);
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
()
{
...
...
@@ -73,6 +91,30 @@ CChangesDocumentAddItem.prototype.Redo = function()
oDocument
.
Content
.
splice
(
this
.
Pos
,
0
,
this
.
Item
);
oDocument
.
private_RecalculateNumbering
([
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
)
{
...
...
@@ -163,6 +205,24 @@ CChangesDocumentRemoveItem.prototype.Undo = function()
oDocument
.
Content
=
Array_start
.
concat
(
this
.
Items
,
Array_end
);
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
()
{
...
...
@@ -170,6 +230,24 @@ CChangesDocumentRemoveItem.prototype.Redo = function()
var
Elements
=
oDocument
.
Content
.
splice
(
this
.
Pos
,
this
.
Items
.
length
);
oDocument
.
private_RecalculateNumbering
(
Elements
);
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
)
{
...
...
word/Editor/Paragraph.js
View file @
34340161
This diff is collapsed.
Click to expand it.
word/Editor/ParagraphChanges.js
0 → 100644
View file @
34340161
This diff is collapsed.
Click to expand it.
word/Editor/Table.js
View file @
34340161
...
...
@@ -5361,6 +5361,9 @@ CTable.prototype =
// Long : количество строк
// Array of Strings : массив Id строк
this
.
Prev
=
null
;
this
.
Next
=
null
;
Reader
.
GetLong
();
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