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
a6f2fa32
Commit
a6f2fa32
authored
Dec 06, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send reverted changes to other users. Fixed an issue with copy of some content changes.
parent
7de0aa79
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
24 deletions
+40
-24
word/Editor/CollaborativeEditing.js
word/Editor/CollaborativeEditing.js
+21
-5
word/Editor/DocumentChanges.js
word/Editor/DocumentChanges.js
+2
-2
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+1
-1
word/Editor/DocumentContentChanges.js
word/Editor/DocumentContentChanges.js
+2
-2
word/Editor/Table.js
word/Editor/Table.js
+5
-5
word/Editor/Table/TableChanges.js
word/Editor/Table/TableChanges.js
+4
-4
word/Editor/Table/TableRow.js
word/Editor/Table/TableRow.js
+1
-1
word/Editor/Table/TableRowChanges.js
word/Editor/Table/TableRowChanges.js
+4
-4
No files found.
word/Editor/CollaborativeEditing.js
View file @
a6f2fa32
...
...
@@ -660,7 +660,6 @@ CWordCollaborativeEditing.prototype.Undo = function()
// Формируем новую пачку действий, которые будут откатывать нужные нам действия.
// На первом шаге мы заданнуюю пачку изменений коммутируем с последними измениями. Смотрим на то какой набор
// изменений у нас получается.
// Объектная модель у нас простая: класс, в котором возможно есть массив элементов(тоже классов), у которого воможно
...
...
@@ -710,10 +709,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
arrReverseChanges
.
splice
(
0
,
0
,
oReverseChange
);
}
// Накатываем изменения в данном клиенте
var
oLogicDocument
=
this
.
m_oLogicDocument
;
oLogicDocument
.
DrawingDocument
.
EndTrackTable
(
null
,
true
);
...
...
@@ -730,6 +726,26 @@ CWordCollaborativeEditing.prototype.Undo = function()
oLogicDocument
.
Document_UpdateSelectionState
();
oLogicDocument
.
Document_UpdateInterfaceState
();
oLogicDocument
.
Document_UpdateRulersState
();
var
oBinaryWriter
=
History
.
BinaryWriter
;
var
aSendingChanges
=
[];
for
(
var
nIndex
=
0
,
nCount
=
arrReverseChanges
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
var
oReverseChange
=
arrReverseChanges
[
nIndex
];
var
oChangeClass
=
oReverseChange
.
GetClass
();
var
nBinaryPos
=
oBinaryWriter
.
GetCurPosition
();
oBinaryWriter
.
WriteString2
(
oChangeClass
.
Get_Id
());
oBinaryWriter
.
WriteLong
(
oReverseChange
.
Type
);
oReverseChange
.
WriteToBinary
(
oBinaryWriter
);
var
nBinaryLen
=
oBinaryWriter
.
GetCurPosition
()
-
nBinaryPos
;
var
oChange
=
new
AscCommon
.
CCollaborativeChanges
();
oChange
.
Set_FromUndoRedo
(
oChangeClass
,
oReverseChange
,
{
Pos
:
nBinaryPos
,
Len
:
nBinaryLen
});
aSendingChanges
.
push
(
oChange
.
m_pData
);
}
editor
.
CoAuthoringApi
.
saveChanges
(
aSendingChanges
,
0
,
null
);
};
CWordCollaborativeEditing
.
prototype
.
CanUndo
=
function
()
{
...
...
word/Editor/DocumentChanges.js
View file @
a6f2fa32
...
...
@@ -65,9 +65,9 @@ AscDFH.changesRelationMap[AscDFH.historyitem_Document_MathSettings] = [AscD
* @constructor
* @extends {AscDFH.CChangesBaseContentChange}
*/
function
CChangesDocumentAddItem
(
Class
,
Pos
,
Item
)
function
CChangesDocumentAddItem
(
Class
,
Pos
,
Item
s
)
{
CChangesDocumentAddItem
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
[
Item
]
,
true
);
CChangesDocumentAddItem
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
Items
,
true
);
}
AscCommon
.
extendClass
(
CChangesDocumentAddItem
,
AscDFH
.
CChangesBaseContentChange
);
CChangesDocumentAddItem
.
prototype
.
Type
=
AscDFH
.
historyitem_Document_AddItem
;
...
...
word/Editor/DocumentContent.js
View file @
a6f2fa32
...
...
@@ -8332,7 +8332,7 @@ CDocumentContent.prototype.Internal_Content_Add = function(Position, NewOb
NextObj
=
null
;
this
.
private_RecalculateNumbering
([
NewObject
]);
History
.
Add
(
new
CChangesDocumentContentAddItem
(
this
,
Position
,
NewObject
));
History
.
Add
(
new
CChangesDocumentContentAddItem
(
this
,
Position
,
[
NewObject
]
));
this
.
Content
.
splice
(
Position
,
0
,
NewObject
);
NewObject
.
Set_Parent
(
this
);
NewObject
.
Set_DocumentNext
(
NextObj
);
...
...
word/Editor/DocumentContentChanges.js
View file @
a6f2fa32
...
...
@@ -57,9 +57,9 @@ AscDFH.changesRelationMap[AscDFH.historyitem_DocumentContent_RemoveItem] = [
* @constructor
* @extends {AscDFH.CChangesBaseContentChange}
*/
function
CChangesDocumentContentAddItem
(
Class
,
Pos
,
Item
)
function
CChangesDocumentContentAddItem
(
Class
,
Pos
,
Item
s
)
{
CChangesDocumentContentAddItem
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
[
Item
]
,
true
);
CChangesDocumentContentAddItem
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
Items
,
true
);
}
AscCommon
.
extendClass
(
CChangesDocumentContentAddItem
,
AscDFH
.
CChangesBaseContentChange
);
CChangesDocumentContentAddItem
.
prototype
.
Type
=
AscDFH
.
historyitem_DocumentContent_AddItem
;
...
...
word/Editor/Table.js
View file @
a6f2fa32
...
...
@@ -2513,7 +2513,7 @@ CTable.prototype =
for
(
var
Index
=
0
;
Index
<
Rows
;
Index
++
)
{
Table
.
Content
[
Index
]
=
this
.
Content
[
Index
].
Copy
(
Table
);
History
.
Add
(
new
CChangesTableAddRow
(
Table
,
Index
,
Table
.
Content
[
Index
]));
History
.
Add
(
new
CChangesTableAddRow
(
Table
,
Index
,
[
Table
.
Content
[
Index
]
]));
}
Table
.
Internal_ReIndexing
(
0
);
...
...
@@ -6770,7 +6770,7 @@ CTable.prototype =
// Добавляем ячейку
Row
.
Content
[
CurCell
]
=
CellInfo
.
Cell
.
Copy
(
Row
);
History
.
Add
(
new
CChangesTableRowAddCell
(
Row
,
CurCell
,
Row
.
Content
[
CurCell
]));
History
.
Add
(
new
CChangesTableRowAddCell
(
Row
,
CurCell
,
[
Row
.
Content
[
CurCell
]
]));
CurCell
++
;
var
VMerge
=
CellInfo
.
Cell
.
Get_VMerge
();
...
...
@@ -6798,7 +6798,7 @@ CTable.prototype =
// Добавляем строку в новую таблицу
Table
.
Content
[
CurRow2
]
=
Row
;
History
.
Add
(
new
CChangesTableAddRow
(
Table
,
CurRow2
,
Table
.
Content
[
CurRow2
]));
History
.
Add
(
new
CChangesTableAddRow
(
Table
,
CurRow2
,
[
Table
.
Content
[
CurRow2
]
]));
CurRow2
++
;
}
...
...
@@ -10193,7 +10193,7 @@ CTable.prototype =
this
.
Content
[
Index
].
PreDelete
();
History
.
Add
(
new
CChangesTableRemoveRow
(
this
,
Index
,
this
.
Content
[
Index
]));
History
.
Add
(
new
CChangesTableRemoveRow
(
this
,
Index
,
[
this
.
Content
[
Index
]
]));
this
.
Rows
--
;
this
.
Content
.
splice
(
Index
,
1
);
...
...
@@ -10215,7 +10215,7 @@ CTable.prototype =
var
NewRow
=
(
undefined
===
_NewRow
?
new
CTableRow
(
this
,
CellsCount
)
:
_NewRow
);
History
.
Add
(
new
CChangesTableAddRow
(
this
,
Index
,
NewRow
));
History
.
Add
(
new
CChangesTableAddRow
(
this
,
Index
,
[
NewRow
]
));
this
.
Content
.
splice
(
Index
,
0
,
NewRow
);
this
.
TableRowsBottom
.
splice
(
Index
,
0
,
{}
);
...
...
word/Editor/Table/TableChanges.js
View file @
a6f2fa32
...
...
@@ -593,9 +593,9 @@ CChangesTableInline.prototype.private_SetValue = function(Value)
* @constructor
* @extends {AscDFH.CChangesBaseContentChange}
*/
function
CChangesTableAddRow
(
Class
,
Pos
,
Row
)
function
CChangesTableAddRow
(
Class
,
Pos
,
Row
s
)
{
CChangesTableAddRow
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
[
Row
]
,
true
);
CChangesTableAddRow
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
Rows
,
true
);
}
AscCommon
.
extendClass
(
CChangesTableAddRow
,
AscDFH
.
CChangesBaseContentChange
);
CChangesTableAddRow
.
prototype
.
Type
=
AscDFH
.
historyitem_Table_AddRow
;
...
...
@@ -666,9 +666,9 @@ CChangesTableAddRow.prototype.CreateReverseChange = function()
* @constructor
* @extends {AscDFH.CChangesBaseContentChange}
*/
function
CChangesTableRemoveRow
(
Class
,
Pos
,
Row
)
function
CChangesTableRemoveRow
(
Class
,
Pos
,
Row
s
)
{
CChangesTableRemoveRow
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
[
Row
]
,
false
);
CChangesTableRemoveRow
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
Rows
,
false
);
}
AscCommon
.
extendClass
(
CChangesTableRemoveRow
,
AscDFH
.
CChangesBaseContentChange
);
CChangesTableRemoveRow
.
prototype
.
Type
=
AscDFH
.
historyitem_Table_RemoveRow
;
...
...
word/Editor/Table/TableRow.js
View file @
a6f2fa32
...
...
@@ -580,7 +580,7 @@ CTableRow.prototype =
Remove_Cell
:
function
(
Index
)
{
History
.
Add
(
new
CChangesTableRowRemoveCell
(
this
,
Index
,
this
.
Content
[
Index
]));
History
.
Add
(
new
CChangesTableRowRemoveCell
(
this
,
Index
,
[
this
.
Content
[
Index
]
]));
this
.
Content
.
splice
(
Index
,
1
);
this
.
CellsInfo
.
splice
(
Index
,
1
);
...
...
word/Editor/Table/TableRowChanges.js
View file @
a6f2fa32
...
...
@@ -410,9 +410,9 @@ CChangesTableRowHeight.prototype.Merge = private_TableRowChangesOnMergePr;
* @constructor
* @extends {AscDFH.CChangesBaseContentChange}
*/
function
CChangesTableRowAddCell
(
Class
,
Pos
,
Cell
)
function
CChangesTableRowAddCell
(
Class
,
Pos
,
Cell
s
)
{
CChangesTableRowAddCell
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
[
Cell
]
,
true
);
CChangesTableRowAddCell
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
Cells
,
true
);
}
AscCommon
.
extendClass
(
CChangesTableRowAddCell
,
AscDFH
.
CChangesBaseContentChange
);
CChangesTableRowAddCell
.
prototype
.
Type
=
AscDFH
.
historyitem_TableRow_AddCell
;
...
...
@@ -477,9 +477,9 @@ CChangesTableRowAddCell.prototype.CreateReverseChange = function()
* @constructor
* @extends {AscDFH.CChangesBaseContentChange}
*/
function
CChangesTableRowRemoveCell
(
Class
,
Pos
,
Cell
)
function
CChangesTableRowRemoveCell
(
Class
,
Pos
,
Cell
s
)
{
CChangesTableRowRemoveCell
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
[
Cell
]
,
false
);
CChangesTableRowRemoveCell
.
superclass
.
constructor
.
call
(
this
,
Class
,
Pos
,
Cells
,
false
);
}
AscCommon
.
extendClass
(
CChangesTableRowRemoveCell
,
AscDFH
.
CChangesBaseContentChange
);
CChangesTableRowRemoveCell
.
prototype
.
Type
=
AscDFH
.
historyitem_TableRow_RemoveCell
;
...
...
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