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
343e8893
Commit
343e8893
authored
Feb 27, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem with tables after undo in collaboration mode.
parent
46199119
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
12 deletions
+38
-12
common/CollaborativeEditingBase.js
common/CollaborativeEditingBase.js
+38
-12
No files found.
common/CollaborativeEditingBase.js
View file @
343e8893
...
...
@@ -946,22 +946,23 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
var
mapParagraphs
=
{};
var
mapDrawings
=
{};
var
mapRuns
=
{};
var
mapTables
=
{};
for
(
var
nIndex
=
0
,
nCount
=
arrReverseChanges
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
var
oChange
=
arrReverseChanges
[
nIndex
];
var
oClass
=
oChange
.
GetClass
();
if
(
oClass
instanceof
AscCommonWord
.
CDocument
||
oClass
instanceof
AscCommonWord
.
CDocumentContent
)
mapDocumentContents
[
oClass
.
Get_Id
()]
=
oClass
;
else
if
(
oClass
instanceof
AscCommonWord
.
Paragraph
)
mapParagraphs
[
oClass
.
Get_Id
()]
=
oClass
;
else
if
(
oClass
.
IsParagraphContentElement
&&
true
===
oClass
.
IsParagraphContentElement
()
&&
true
===
oChange
.
IsContentChange
()
&&
oClass
.
Get_Paragraph
())
mapParagraphs
[
oClass
.
Get_Paragraph
().
Get_Id
()]
=
oClass
.
Get_Paragraph
();
else
if
(
oClass
instanceof
AscCommonWord
.
ParaDrawing
){
mapDrawings
[
oClass
.
Get_Id
()]
=
oClass
;
}
else
if
(
oClass
instanceof
AscCommonWord
.
ParaRun
){
mapRuns
[
oClass
.
Get_Id
()]
=
oClass
;
}
if
(
oClass
instanceof
AscCommonWord
.
CDocument
||
oClass
instanceof
AscCommonWord
.
CDocumentContent
)
mapDocumentContents
[
oClass
.
Get_Id
()]
=
oClass
;
else
if
(
oClass
instanceof
AscCommonWord
.
Paragraph
)
mapParagraphs
[
oClass
.
Get_Id
()]
=
oClass
;
else
if
(
oClass
.
IsParagraphContentElement
&&
true
===
oClass
.
IsParagraphContentElement
()
&&
true
===
oChange
.
IsContentChange
()
&&
oClass
.
Get_Paragraph
())
mapParagraphs
[
oClass
.
Get_Paragraph
().
Get_Id
()]
=
oClass
.
Get_Paragraph
();
else
if
(
oClass
instanceof
AscCommonWord
.
ParaDrawing
)
mapDrawings
[
oClass
.
Get_Id
()]
=
oClass
;
else
if
(
oClass
instanceof
AscCommonWord
.
ParaRun
)
mapRuns
[
oClass
.
Get_Id
()]
=
oClass
;
else
if
(
oClass
instanceof
AscCommonWord
.
CTable
)
mapTables
[
oClass
.
Get_Id
()]
=
oClass
;
}
// Создаем точку в истории. Делаем действия через обычные функции (с отключенным пересчетом), которые пишут в
...
...
@@ -1003,10 +1004,35 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
}
}
for
(
var
sId
in
mapTables
)
{
var
oTable
=
mapTables
[
sId
];
for
(
var
nCurRow
=
oTable
.
Content
.
length
-
1
;
nCurRow
>=
0
;
--
nCurRow
)
{
var
oRow
=
oTable
.
Get_Row
(
nCurRow
);
if
(
oRow
.
Get_CellsCount
()
<=
0
)
oTable
.
Internal_Remove_Row
(
nCurRow
);
}
if
(
oTable
.
Parent
instanceof
AscCommonWord
.
CDocument
||
oTable
.
Parent
instanceof
AscCommonWord
.
CDocumentContent
)
mapDocumentContents
[
oTable
.
Parent
.
Get_Id
()]
=
oTable
.
Parent
;
}
for
(
var
sId
in
mapDocumentContents
)
{
var
oDocumentContent
=
mapDocumentContents
[
sId
];
var
nContentLen
=
oDocumentContent
.
Content
.
length
;
for
(
var
nIndex
=
nContentLen
-
1
;
nIndex
>=
0
;
--
nIndex
)
{
var
oElement
=
oDocumentContent
.
Content
[
nIndex
];
if
((
AscCommonWord
.
type_Paragraph
===
oElement
.
GetType
()
||
AscCommonWord
.
type_Table
===
oElement
.
GetType
())
&&
oElement
.
Content
.
length
<=
0
)
{
oDocumentContent
.
Remove_FromContent
(
nIndex
,
1
);
console
.
log
(
"
Deleted
"
+
(
AscCommonWord
.
type_Table
===
oElement
.
GetType
()
?
"
Table
"
:
"
Paragraph
"
));
}
}
nContentLen
=
oDocumentContent
.
Content
.
length
;
if
(
nContentLen
<=
0
||
AscCommonWord
.
type_Paragraph
!==
oDocumentContent
.
Content
[
nContentLen
-
1
].
GetType
())
{
var
oNewParagraph
=
new
AscCommonWord
.
Paragraph
(
oLogicDocument
.
Get_DrawingDocument
(),
oDocumentContent
,
0
,
0
,
0
,
0
,
0
,
false
);
...
...
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