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
62c99686
Commit
62c99686
authored
Feb 10, 2017
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
method IsChangesClass was removed from CChangesBase;
parent
ba9de9ae
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
135 additions
and
226 deletions
+135
-226
cell/model/History.js
cell/model/History.js
+21
-52
cell/model/UndoRedo.js
cell/model/UndoRedo.js
+5
-14
cell/view/DrawingObjectsController.js
cell/view/DrawingObjectsController.js
+5
-17
common/CollaborativeEditingBase.js
common/CollaborativeEditingBase.js
+18
-0
common/Drawings/DrawingsChanges.js
common/Drawings/DrawingsChanges.js
+31
-0
common/Drawings/Format/OleObject.js
common/Drawings/Format/OleObject.js
+4
-0
common/HistoryCommon.js
common/HistoryCommon.js
+4
-5
common/editorscommon.js
common/editorscommon.js
+5
-16
slide/Editor/CollaborativeEditing.js
slide/Editor/CollaborativeEditing.js
+14
-9
slide/Editor/Format/Presentation.js
slide/Editor/Format/Presentation.js
+5
-5
slide/Editor/Format/Slide.js
slide/Editor/Format/Slide.js
+4
-4
word/Editor/CollaborativeEditing.js
word/Editor/CollaborativeEditing.js
+5
-8
word/Editor/History.js
word/Editor/History.js
+14
-82
word/Math/base.js
word/Math/base.js
+0
-14
No files found.
cell/model/History.js
View file @
62c99686
...
...
@@ -229,20 +229,15 @@ CHistory.prototype.Undo = function()
if
(
!
Item
.
Class
.
Re
ad_FromBinary2
&&
!
Item
.
Class
.
IsChangesClass
)
if
(
!
Item
.
Class
.
Re
freshRecalcData
)
Item
.
Class
.
Undo
(
Item
.
Type
,
Item
.
Data
,
Item
.
SheetId
);
else
{
if
(
Item
.
Class
&&
Item
.
Class
.
IsChangesClass
&&
Item
.
Class
.
IsChangesClass
()
)
if
(
Item
.
Class
)
{
Item
.
Class
.
Undo
();
Item
.
Class
.
RefreshRecalcData
();
}
else
{
Item
.
Class
.
Undo
(
Item
.
Type
);
Item
.
Class
.
Refresh_RecalcData
&&
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Type
);
}
}
this
.
_addRedoObjectParam
(
oRedoObjectParam
,
Item
);
...
...
@@ -299,39 +294,30 @@ CHistory.prototype.RedoAdd = function(oRedoObjectParam, Class, Type, sheetid, ra
}
// ToDo Убрать это!!!
if
(
Class
&&
!
Class
.
Load_Changes
&&
!
Class
.
Load
)
{
if
(
Class
&&
!
Class
.
Load
)
{
Class
.
Redo
(
Type
,
Data
,
sheetid
);
}
else
{
if
(
Class
&&
Data
&&
!
Data
.
isDrawingCollaborativeData
)
Class
.
Redo
(
Data
);
if
(
Class
&&
Data
&&
!
Data
.
isDrawingCollaborativeData
){
Class
.
Redo
(
Data
);
}
else
{
if
(
!
Class
){
if
(
Data
.
isDrawingCollaborativeData
){
Data
.
oBinaryReader
.
Seek2
(
Data
.
nPos
);
var
nReaderPos
=
Data
.
oBinaryReader
.
GetCurPos
();
var
nChangesType
=
Data
.
oBinaryReader
.
GetLong
();
var
changedObject
=
AscCommon
.
g_oTableId
.
Get_ById
(
Data
.
sChangedObjectId
);
if
(
changedObject
){
var
fChangesClass
=
AscDFH
.
changesFactory
[
nChangesType
];
if
(
fChangesClass
)
{
var
oChange
=
new
fChangesClass
(
changedObject
);
oChange
.
ReadFromBinary
(
Data
.
oBinaryReader
);
oChange
.
Load
(
new
CDocumentColor
(
255
,
255
,
255
));
}
else
{
Data
.
oBinaryReader
.
Seek2
(
nReaderPos
);
changedObject
.
Load_Changes
(
Data
.
oBinaryReader
,
null
,
new
CDocumentColor
(
255
,
255
,
255
));
}
}
}
Data
.
oBinaryReader
.
Seek2
(
Data
.
nPos
);
var
nChangesType
=
Data
.
oBinaryReader
.
GetLong
();
var
changedObject
=
AscCommon
.
g_oTableId
.
Get_ById
(
Data
.
sChangedObjectId
);
if
(
changedObject
){
var
fChangesClass
=
AscDFH
.
changesFactory
[
nChangesType
];
if
(
fChangesClass
){
var
oChange
=
new
fChangesClass
(
changedObject
);
oChange
.
ReadFromBinary
(
Data
.
oBinaryReader
);
oChange
.
Load
(
new
CDocumentColor
(
255
,
255
,
255
));
}
}
}
}
}
}
...
...
@@ -354,29 +340,12 @@ CHistory.prototype.RedoExecute = function(Point, oRedoObjectParam)
for
(
var
Index
=
0
;
Index
<
Point
.
Items
.
length
;
Index
++
)
{
var
Item
=
Point
.
Items
[
Index
];
if
(
!
Item
.
Class
.
Re
ad_FromBinary2
&&
!
Item
.
Class
.
IsChangesClass
)
if
(
!
Item
.
Class
.
Re
freshRecalcData
)
Item
.
Class
.
Redo
(
Item
.
Type
,
Item
.
Data
,
Item
.
SheetId
);
else
{
if
(
!
Item
.
Data
||
!
Item
.
Data
.
isDrawingCollaborativeData
)
{
if
(
Item
.
Class
&&
Item
.
Class
.
IsChangesClass
&&
Item
.
Class
.
IsChangesClass
())
{
Item
.
Class
.
Redo
();
Item
.
Class
.
RefreshRecalcData
();
}
else
{
Item
.
Class
.
Redo
(
Item
.
Type
);
Item
.
Class
.
Refresh_RecalcData
&&
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Type
);
}
}
else
{
Item
.
Data
.
oBinaryReader
.
Seek
(
Item
.
Data
.
nPos
);
Item
.
Class
.
Load_Changes
(
Item
.
Data
.
oBinaryReader
,
null
,
new
CDocumentColor
(
255
,
255
,
255
));
}
Item
.
Class
.
Redo
();
Item
.
Class
.
RefreshRecalcData
();
}
this
.
_addRedoObjectParam
(
oRedoObjectParam
,
Item
);
}
...
...
cell/model/UndoRedo.js
View file @
62c99686
...
...
@@ -92,7 +92,7 @@ UndoRedoItemSerializable.prototype = {
SerializeInner
:
function
(
oBinaryWriter
,
collaborativeEditing
)
{
//nClassType
if
(
!
this
.
oClass
.
Save_Changes
&&
!
this
.
oClass
.
WriteToBinary
)
if
(
!
this
.
oClass
.
WriteToBinary
)
{
oBinaryWriter
.
WriteBool
(
true
);
var
nClassType
=
this
.
oClass
.
getClassType
();
...
...
@@ -140,19 +140,10 @@ UndoRedoItemSerializable.prototype = {
{
oBinaryWriter
.
WriteBool
(
false
);
var
Class
;
if
(
this
.
oClass
&&
this
.
oClass
.
IsChangesClass
&&
this
.
oClass
.
IsChangesClass
())
{
Class
=
this
.
oClass
.
GetClass
();
oBinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
oBinaryWriter
.
WriteLong
(
this
.
oClass
.
Type
);
this
.
oClass
.
WriteToBinary
(
oBinaryWriter
);
}
else
{
oBinaryWriter
.
WriteString2
(
this
.
oClass
.
Get_Id
());
this
.
oClass
.
Save_Changes
(
this
.
nActionType
,
oBinaryWriter
);
}
Class
=
this
.
oClass
.
GetClass
();
oBinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
oBinaryWriter
.
WriteLong
(
this
.
oClass
.
Type
);
this
.
oClass
.
WriteToBinary
(
oBinaryWriter
);
}
},
SerializeDataObject
:
function
(
oBinaryWriter
,
oData
,
nSheetId
,
collaborativeEditing
)
...
...
cell/view/DrawingObjectsController.js
View file @
62c99686
...
...
@@ -59,24 +59,12 @@ AscCommon.CContentChangesElement.prototype.Refresh_BinaryData = function()
var
Binary_Writer
=
History
.
BinaryWriter
;
var
Binary_Pos
=
Binary_Writer
.
GetCurPosition
();
if
(
this
.
m_pData
.
Data
&&
this
.
m_pData
.
Data
.
IsChangesClass
&&
this
.
m_pData
.
Data
.
IsChangesClass
())
{
this
.
m_pData
.
Data
.
UseArray
=
true
;
this
.
m_pData
.
Data
.
PosArray
=
this
.
m_aPositions
;
Binary_Writer
.
WriteString2
(
this
.
m_pData
.
Class
.
Get_Id
());
Binary_Writer
.
WriteLong
(
this
.
m_pData
.
Data
.
Type
);
this
.
m_pData
.
Data
.
WriteToBinary
(
Binary_Writer
);
}
else
{
this
.
m_pData
.
Data
.
UseArray
=
true
;
this
.
m_pData
.
Data
.
PosArray
=
this
.
m_aPositions
;
Binary_Writer
.
WriteString2
(
this
.
m_pData
.
Class
.
Get_Id
());
this
.
m_pData
.
Class
.
Save_Changes
(
this
.
m_pData
.
Data
,
Binary_Writer
);
}
this
.
m_pData
.
Data
.
UseArray
=
true
;
this
.
m_pData
.
Data
.
PosArray
=
this
.
m_aPositions
;
Binary_Writer
.
WriteString2
(
this
.
m_pData
.
Class
.
Get_Id
());
Binary_Writer
.
WriteLong
(
this
.
m_pData
.
Data
.
Type
);
this
.
m_pData
.
Data
.
WriteToBinary
(
Binary_Writer
);
var
Binary_Len
=
Binary_Writer
.
GetCurPosition
()
-
Binary_Pos
;
this
.
m_pData
.
Binary
.
Pos
=
Binary_Pos
;
...
...
common/CollaborativeEditingBase.js
View file @
62c99686
...
...
@@ -588,6 +588,24 @@ CCollaborativeEditingBase.prototype.Refresh_DCChanges = function()
this
.
Clear_DCChanges
();
};
//-----------------------------------------------------------------------------------
// Функции для работы с массивами PosExtChangesX, PosExtChangesY
//-----------------------------------------------------------------------------------
CCollaborativeEditingBase
.
prototype
.
AddPosExtChanges
=
function
(
Item
,
ChangeObject
){
};
CCollaborativeEditingBase
.
prototype
.
RefreshPosExtChanges
=
function
(){
};
CCollaborativeEditingBase
.
prototype
.
RewritePosExtChanges
=
function
(
changesArr
,
scale
,
Binary_Writer
)
{
};
CCollaborativeEditingBase
.
prototype
.
RefreshPosExtChanges
=
function
()
{
};
//-----------------------------------------------------------------------------------
// Функции для работы с отметками изменений
//-----------------------------------------------------------------------------------
...
...
common/Drawings/DrawingsChanges.js
View file @
62c99686
...
...
@@ -6,6 +6,21 @@
window
[
'
AscDFH
'
].
drawingsConstructorsMap
=
drawingConstructorsMap
;
window
[
'
AscDFH
'
].
drawingContentChanges
=
drawingContentChanges
;
var
oPosExtMap
=
{};
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetOffX
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetOffY
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetExtX
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetExtY
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetChOffX
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetChOffY
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetChExtX
]
=
true
;
oPosExtMap
[
AscDFH
.
historyitem_Xfrm_SetChExtY
]
=
true
;
var
oPosExtHor
=
{};
oPosExtHor
[
AscDFH
.
historyitem_Xfrm_SetOffX
]
=
true
;
oPosExtHor
[
AscDFH
.
historyitem_Xfrm_SetExtX
]
=
true
;
oPosExtHor
[
AscDFH
.
historyitem_Xfrm_SetChOffX
]
=
true
;
oPosExtHor
[
AscDFH
.
historyitem_Xfrm_SetChExtX
]
=
true
;
function
private_SetValue
(
Value
)
{
if
(
!
this
.
Class
)
{
return
;
...
...
@@ -96,6 +111,12 @@
this
.
Type
=
reader
.
GetLong
();
CChangesDrawingsDouble
.
superclass
.
ReadFromBinary
.
call
(
this
,
reader
);
};
CChangesDrawingsDouble
.
prototype
.
IsPosExtChange
=
function
()
{
return
!!
oPosExtMap
[
this
.
Type
];
};
CChangesDrawingsDouble
.
prototype
.
IsHorizontal
=
function
()
{
return
!!
oPosExtHor
[
this
.
Type
];
};
window
[
'
AscDFH
'
].
CChangesDrawingsDouble
=
CChangesDrawingsDouble
;
...
...
@@ -354,6 +375,16 @@
};
function
CChangesDrawingsContentPresentation
(
Class
,
Type
,
Pos
,
Items
,
isAdd
){
CChangesDrawingsContentPresentation
.
superclass
.
constructor
.
call
(
this
,
Class
,
Type
,
Pos
,
Items
,
isAdd
);
}
AscCommon
.
extendClass
(
CChangesDrawingsContentPresentation
,
CChangesDrawingsContent
);
CChangesDrawingsContentPresentation
.
prototype
.
IsContentChange
=
function
(){
return
true
;
};
window
[
'
AscDFH
'
].
CChangesDrawingsContentPresentation
=
CChangesDrawingsContentPresentation
;
function
CChangesDrawingsContentNoId
(
Class
,
Type
,
Pos
,
Items
,
isAdd
){
CChangesDrawingsContentNoId
.
superclass
.
constructor
.
call
(
this
,
Class
,
Type
,
Pos
,
Items
,
isAdd
);
}
...
...
common/Drawings/Format/OleObject.js
View file @
62c99686
...
...
@@ -101,6 +101,10 @@ function (window, undefined) {
this
.
m_nPixHeight
=
nPixHeight
;
};
COleObject
.
prototype
.
canRotate
=
function
()
{
return
false
;
};
COleObject
.
prototype
.
copy
=
function
()
{
var
copy
=
new
COleObject
();
...
...
common/HistoryCommon.js
View file @
62c99686
...
...
@@ -2919,11 +2919,6 @@
// В большинстве случаев загрузка чужого изменения работает как простое Redo
this
.
Redo
();
};
CChangesBase
.
prototype
.
IsChangesClass
=
function
()
{
// TODO: Эта функция добавлена пока все изменения не переделаны на классы
return
true
;
};
CChangesBase
.
prototype
.
GetClass
=
function
()
{
return
this
.
Class
;
...
...
@@ -2945,6 +2940,10 @@
{
return
true
;
};
CChangesBase
.
prototype
.
IsPosExtChange
=
function
(
oChange
)
{
return
false
;
};
window
[
'
AscDFH
'
].
CChangesBase
=
CChangesBase
;
/**
* Базовый класс для изменений, которые меняют содержимое родительского класса.*
...
...
common/editorscommon.js
View file @
62c99686
...
...
@@ -2120,23 +2120,12 @@ CContentChangesElement.prototype.Refresh_BinaryData = function()
var
Binary_Writer
=
AscCommon
.
History
.
BinaryWriter
;
var
Binary_Pos
=
Binary_Writer
.
GetCurPosition
();
if
(
this
.
m_pData
.
Data
&&
this
.
m_pData
.
Data
.
IsChangesClass
&&
this
.
m_pData
.
Data
.
IsChangesClass
())
{
this
.
m_pData
.
Data
.
UseArray
=
true
;
this
.
m_pData
.
Data
.
PosArray
=
this
.
m_aPositions
;
Binary_Writer
.
WriteString2
(
this
.
m_pData
.
Class
.
Get_Id
());
Binary_Writer
.
WriteLong
(
this
.
m_pData
.
Data
.
Type
);
this
.
m_pData
.
Data
.
WriteToBinary
(
Binary_Writer
);
}
else
{
this
.
m_pData
.
Data
.
UseArray
=
true
;
this
.
m_pData
.
Data
.
PosArray
=
this
.
m_aPositions
;
this
.
m_pData
.
Data
.
UseArray
=
true
;
this
.
m_pData
.
Data
.
PosArray
=
this
.
m_aPositions
;
Binary_Writer
.
WriteString2
(
this
.
m_pData
.
Class
.
Get_Id
());
this
.
m_pData
.
Class
.
Save_Changes
(
this
.
m_pData
.
Data
,
Binary_Writer
);
}
Binary_Writer
.
WriteString2
(
this
.
m_pData
.
Class
.
Get_Id
());
Binary_Writer
.
WriteLong
(
this
.
m_pData
.
Data
.
Type
);
this
.
m_pData
.
Data
.
WriteToBinary
(
Binary_Writer
);
var
Binary_Len
=
Binary_Writer
.
GetCurPosition
()
-
Binary_Pos
;
...
...
slide/Editor/CollaborativeEditing.js
View file @
62c99686
...
...
@@ -62,7 +62,6 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn
// Пересчитываем позиции
this
.
Refresh_DCChanges
();
this
.
RefreshPosExtChanges
();
// Генерируем свои изменения
var
StartPoint
=
(
null
===
AscCommon
.
History
.
SavedIndex
?
0
:
AscCommon
.
History
.
SavedIndex
+
1
);
var
LastPoint
=
-
1
;
...
...
@@ -455,9 +454,9 @@ CCollaborativeEditing.prototype.OnCallback_AskLock = function(result)
editor
.
isChartEditor
=
false
;
};
CCollaborativeEditing
.
prototype
.
AddPosExtChanges
=
function
(
Item
,
bHor
)
CCollaborativeEditing
.
prototype
.
AddPosExtChanges
=
function
(
Item
,
ChangeObject
)
{
if
(
bHor
)
if
(
ChangeObject
.
IsHorizontal
()
)
{
this
.
PosExtChangesX
.
push
(
Item
);
}
...
...
@@ -468,16 +467,22 @@ CCollaborativeEditing.prototype.AddPosExtChanges = function(Item, bHor)
};
CCollaborativeEditing
.
prototype
.
Rewrite
Changes
=
function
(
changesArr
,
scale
,
Binary_Writer
)
CCollaborativeEditing
.
prototype
.
Rewrite
PosExtChanges
=
function
(
changesArr
,
scale
)
{
for
(
var
i
=
0
;
i
<
changesArr
.
length
;
++
i
)
{
var
changes
=
changesArr
[
i
];
var
data
=
changes
.
Data
;
data
.
newPr
*=
scale
;
var
Binary_Pos
=
Binary_Writer
.
GetCurPosition
();
changes
.
Class
.
Save_Changes
(
data
,
Binary_Writer
);
data
.
New
*=
scale
;
data
.
Old
*=
scale
;
var
Binary_Writer
=
AscCommon
.
History
.
BinaryWriter
;
var
Binary_Pos
=
Binary_Writer
.
GetCurPosition
();
Binary_Writer
.
WriteString2
(
changes
.
Class
.
Get_Id
());
Binary_Writer
.
WriteLong
(
changes
.
Data
.
Type
);
changes
.
Data
.
WriteToBinary
(
Binary_Writer
);
var
Binary_Len
=
Binary_Writer
.
GetCurPosition
()
-
Binary_Pos
;
changes
.
Binary
.
Pos
=
Binary_Pos
;
changes
.
Binary
.
Len
=
Binary_Len
;
}
...
...
@@ -487,8 +492,8 @@ CCollaborativeEditing.prototype.RefreshPosExtChanges = function()
{
if
(
this
.
ScaleX
!=
null
&&
this
.
ScaleY
!=
null
)
{
this
.
Rewrite
Changes
(
this
.
PosExtChangesX
,
this
.
ScaleX
,
AscCommon
.
History
.
BinaryWriter
);
this
.
Rewrite
Changes
(
this
.
PosExtChangesY
,
this
.
ScaleY
,
AscCommon
.
History
.
BinaryWriter
);
this
.
Rewrite
PosExtChanges
(
this
.
PosExtChangesX
,
this
.
ScaleX
);
this
.
Rewrite
PosExtChanges
(
this
.
PosExtChangesY
,
this
.
ScaleY
);
}
this
.
PosExtChangesX
.
length
=
0
;
this
.
PosExtChangesY
.
length
=
0
;
...
...
slide/Editor/Format/Presentation.js
View file @
62c99686
...
...
@@ -380,8 +380,8 @@ AscDFH.changesFactory[AscDFH.historyitem_Presentation_AddSlideMaster] = AscDFH.C
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_ChangeTheme
]
=
AscDFH
.
CChangesDrawingChangeTheme
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_SlideSize
]
=
AscDFH
.
CChangesDrawingsObjectNoId
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_ChangeColorScheme
]
=
AscDFH
.
CChangesDrawingChangeTheme
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_RemoveSlide
]
=
AscDFH
.
CChangesDrawingsContent
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_AddSlide
]
=
AscDFH
.
CChangesDrawingsContent
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_RemoveSlide
]
=
AscDFH
.
CChangesDrawingsContent
Presentation
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_Presentation_AddSlide
]
=
AscDFH
.
CChangesDrawingsContent
Presentation
;
AscDFH
.
drawingsChangesMap
[
AscDFH
.
historyitem_Presentation_SetShowPr
]
=
function
(
oClass
,
value
){
oClass
.
showPr
=
value
;};
...
...
@@ -393,7 +393,7 @@ AscDFH.drawingContentChanges[AscDFH.historyitem_Presentation_RemoveSlide] = func
AscDFH
.
drawingContentChanges
[
AscDFH
.
historyitem_Presentation_AddSlideMaster
]
=
function
(
oClass
){
return
oClass
.
slideMasters
;};
AscDFH
.
drawingsConstructorsMap
[
AscDFH
.
historyitem_Presentation_SetShowPr
]
=
CShowPr
;
AscDFH
.
drawingsConstructorsMap
[
AscDFH
.
historyitem_Presentation_SlideSize
]
=
AscFormat
.
CDrawingBaseCoordsWritable
AscDFH
.
drawingsConstructorsMap
[
AscDFH
.
historyitem_Presentation_SlideSize
]
=
AscFormat
.
CDrawingBaseCoordsWritable
;
function
CPresentation
(
DrawingDocument
)
{
...
...
@@ -4776,7 +4776,7 @@ CPresentation.prototype =
{
if
(
AscFormat
.
isRealNumber
(
pos
)
&&
pos
>
-
1
&&
pos
<
this
.
Slides
.
length
)
{
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
(
this
,
AscDFH
.
historyitem_Presentation_RemoveSlide
,
pos
,
[
this
.
Slides
[
pos
]],
false
));
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
Presentation
(
this
,
AscDFH
.
historyitem_Presentation_RemoveSlide
,
pos
,
[
this
.
Slides
[
pos
]],
false
));
this
.
Slides
[
pos
].
removeAllCommentsToInterface
();
return
this
.
Slides
.
splice
(
pos
,
1
)[
0
];
}
...
...
@@ -4785,7 +4785,7 @@ CPresentation.prototype =
insertSlide
:
function
(
pos
,
slide
)
{
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
(
this
,
AscDFH
.
historyitem_Presentation_AddSlide
,
pos
,
[
slide
],
true
));
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
Presentation
(
this
,
AscDFH
.
historyitem_Presentation_AddSlide
,
pos
,
[
slide
],
true
));
this
.
Slides
.
splice
(
pos
,
0
,
slide
);
},
...
...
slide/Editor/Format/Slide.js
View file @
62c99686
...
...
@@ -47,8 +47,8 @@ AscDFH.changesFactory[AscDFH.historyitem_SlideSetNum ] = AscDFH.CC
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideSetTiming
]
=
AscDFH
.
CChangesDrawingsObjectNoId
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideSetSize
]
=
AscDFH
.
CChangesDrawingsObjectNoId
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideSetBg
]
=
AscDFH
.
CChangesDrawingsObjectNoId
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideAddToSpTree
]
=
AscDFH
.
CChangesDrawingsContent
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideRemoveFromSpTree
]
=
AscDFH
.
CChangesDrawingsContent
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideAddToSpTree
]
=
AscDFH
.
CChangesDrawingsContent
Presentation
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideRemoveFromSpTree
]
=
AscDFH
.
CChangesDrawingsContent
Presentation
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideSetCSldName
]
=
AscDFH
.
CChangesDrawingsString
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_SlideSetClrMapOverride
]
=
AscDFH
.
CChangesDrawingsObject
;
AscDFH
.
changesFactory
[
AscDFH
.
historyitem_PropLockerSetId
]
=
AscDFH
.
CChangesDrawingsString
;
...
...
@@ -553,7 +553,7 @@ Slide.prototype =
{
this
.
checkDrawingUniNvPr
(
item
);
var
_pos
=
AscFormat
.
isRealNumber
(
pos
)
?
pos
:
this
.
cSld
.
spTree
.
length
;
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
(
this
,
AscDFH
.
historyitem_SlideAddToSpTree
,
_pos
,
[
item
],
true
));
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
Presentation
(
this
,
AscDFH
.
historyitem_SlideAddToSpTree
,
_pos
,
[
item
],
true
));
this
.
cSld
.
spTree
.
splice
(
_pos
,
0
,
item
);
},
...
...
@@ -620,7 +620,7 @@ Slide.prototype =
{
if
(
sp_tree
[
i
].
Get_Id
()
===
id
)
{
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
(
this
,
AscDFH
.
historyitem_SlideRemoveFromSpTree
,
i
,
[
sp_tree
[
i
]],
false
));
History
.
Add
(
new
AscDFH
.
CChangesDrawingsContent
Presentation
(
this
,
AscDFH
.
historyitem_SlideRemoveFromSpTree
,
i
,
[
sp_tree
[
i
]],
false
));
sp_tree
.
splice
(
i
,
1
);
return
i
;
}
...
...
word/Editor/CollaborativeEditing.js
View file @
62c99686
...
...
@@ -100,10 +100,7 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition
var
oChanges
=
new
AscCommon
.
CCollaborativeChanges
();
oChanges
.
Set_FromUndoRedo
(
Item
.
Class
,
Item
.
Data
,
Item
.
Binary
);
if
(
Item
.
Data
.
IsChangesClass
&&
Item
.
Data
.
IsChangesClass
())
aChanges2
.
push
(
Item
.
Data
);
else
aChanges2
.
push
(
oChanges
.
m_pDatay
);
aChanges2
.
push
(
Item
.
Data
);
aChanges
.
push
(
oChanges
.
m_pData
);
}
...
...
@@ -621,8 +618,8 @@ CWordCollaborativeEditing.prototype.private_CollectOwnChanges = function()
for
(
var
Index
=
0
;
Index
<
Point
.
Items
.
length
;
Index
++
)
{
var
Item
=
Point
.
Items
[
Index
];
if
(
Item
.
Data
.
IsChangesClass
&&
Item
.
Data
.
IsChangesClass
())
this
.
m_oOwnChanges
.
push
(
Item
.
Data
);
this
.
m_oOwnChanges
.
push
(
Item
.
Data
);
}
}
};
...
...
@@ -690,7 +687,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
for
(
var
nIndex
=
nCount
-
1
;
nIndex
>=
0
;
--
nIndex
)
{
var
oChange
=
this
.
m_aAllChanges
[
nPosition
+
nIndex
];
if
(
!
oChange
||
!
oChange
.
IsChangesClass
||
!
oChange
.
IsChangesClass
()
)
if
(
!
oChange
)
continue
;
var
oClass
=
oChange
.
GetClass
();
...
...
@@ -850,7 +847,7 @@ CWordCollaborativeEditing.prototype.private_CommutateContentChanges = function(o
for
(
var
nIndex
=
nStartPosition
,
nOverallCount
=
this
.
m_aAllChanges
.
length
;
nIndex
<
nOverallCount
;
++
nIndex
)
{
var
oTempChange
=
this
.
m_aAllChanges
[
nIndex
];
if
(
!
oTempChange
||
!
oTempChange
.
IsChangesClass
||
!
oTempChange
.
IsChangesClass
()
)
if
(
!
oTempChange
)
continue
;
if
(
oChange
.
IsRelated
(
oTempChange
))
...
...
word/Editor/History.js
View file @
62c99686
...
...
@@ -243,16 +243,11 @@ CHistory.prototype =
{
var
Item
=
Point
.
Items
[
Index
];
if
(
Item
.
Data
&&
Item
.
Data
.
IsChangesClass
&&
Item
.
Data
.
IsChangesClass
()
)
if
(
Item
.
Data
)
{
Item
.
Data
.
Undo
();
Item
.
Data
.
RefreshRecalcData
();
}
else
{
Item
.
Class
.
Undo
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
}
this
.
private_UpdateContentChangesOnUndo
(
Item
);
}
}
...
...
@@ -265,16 +260,11 @@ CHistory.prototype =
for
(
var
Index
=
Point
.
Items
.
length
-
1
;
Index
>=
0
;
Index
--
)
{
var
Item
=
Point
.
Items
[
Index
];
if
(
Item
.
Data
&&
Item
.
Data
.
IsChangesClass
&&
Item
.
Data
.
IsChangesClass
()
)
if
(
Item
.
Data
)
{
Item
.
Data
.
Undo
();
Item
.
Data
.
RefreshRecalcData
();
}
else
{
Item
.
Class
.
Undo
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
}
this
.
private_UpdateContentChangesOnUndo
(
Item
);
}
}
...
...
@@ -302,16 +292,11 @@ CHistory.prototype =
{
var
Item
=
Point
.
Items
[
Index
];
if
(
Item
.
Data
&&
Item
.
Data
.
IsChangesClass
&&
Item
.
Data
.
IsChangesClass
()
)
if
(
Item
.
Data
)
{
Item
.
Data
.
Redo
();
Item
.
Data
.
RefreshRecalcData
();
}
else
{
Item
.
Class
.
Redo
(
Item
.
Data
);
Item
.
Class
.
Refresh_RecalcData
(
Item
.
Data
);
}
this
.
private_UpdateContentChangesOnRedo
(
Item
);
}
...
...
@@ -434,21 +419,14 @@ CHistory.prototype =
var
Binary_Pos
=
this
.
BinaryWriter
.
GetCurPosition
();
var
Class
;
if
(
_Class
&&
_Class
.
IsChangesClass
&&
_Class
.
IsChangesClass
())
{
Class
=
_Class
.
GetClass
();
Data
=
_Class
;
if
(
_Class
)
{
Class
=
_Class
.
GetClass
();
Data
=
_Class
;
this
.
BinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
this
.
BinaryWriter
.
WriteLong
(
_Class
.
Type
);
_Class
.
WriteToBinary
(
this
.
BinaryWriter
);
}
else
{
Class
=
_Class
;
this
.
BinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
Class
.
Save_Changes
(
Data
,
this
.
BinaryWriter
);
}
this
.
BinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
this
.
BinaryWriter
.
WriteLong
(
_Class
.
Type
);
_Class
.
WriteToBinary
(
this
.
BinaryWriter
);
}
var
Binary_Len
=
this
.
BinaryWriter
.
GetCurPosition
()
-
Binary_Pos
;
var
Item
=
{
...
...
@@ -467,7 +445,7 @@ CHistory.prototype =
if
(
!
this
.
CollaborativeEditing
)
return
;
if
(
_Class
&&
_Class
.
IsChangesClass
&&
_Class
.
IsChangesClass
()
)
if
(
_Class
)
{
if
(
_Class
.
IsContentChange
())
{
...
...
@@ -483,55 +461,9 @@ CHistory.prototype =
else
this
.
CollaborativeEditing
.
Update_DocumentPositionsOnRemove
(
Class
,
Data
.
Pos
,
Count
);
}
}
else
{
var
bPresentation
=
!
(
typeof
CPresentation
===
"
undefined
"
);
var
bSlide
=
!
(
typeof
Slide
===
"
undefined
"
);
if
((
Class
instanceof
AscFormat
.
CDrawingDocContent
&&
(
AscDFH
.
historyitem_DocumentContent_AddItem
===
Data
.
Type
||
AscDFH
.
historyitem_DocumentContent_RemoveItem
===
Data
.
Type
)
)
||
(
bPresentation
&&
Class
instanceof
CPresentation
&&
(
AscDFH
.
historyitem_Presentation_AddSlide
===
Data
.
Type
||
AscDFH
.
historyitem_Presentation_RemoveSlide
===
Data
.
Type
))
||
(
bSlide
&&
Class
instanceof
Slide
&&
(
AscDFH
.
historyitem_SlideAddToSpTree
===
Data
.
Type
||
AscDFH
.
historyitem_SlideRemoveFromSpTree
===
Data
.
Type
))
)
{
var
bAdd
=
(
(
Class
instanceof
AscFormat
.
CDrawingDocContent
&&
AscDFH
.
historyitem_DocumentContent_AddItem
===
Data
.
Type
)
||
(
bPresentation
&&
Class
instanceof
CPresentation
&&
(
AscDFH
.
historyitem_Presentation_AddSlide
===
Data
.
Type
))
||
(
bSlide
&&
Class
instanceof
Slide
&&
(
AscDFH
.
historyitem_SlideAddToSpTree
===
Data
.
Type
))
)
?
true
:
false
;
var
Count
=
1
;
if
(
Class
instanceof
AscFormat
.
CDrawingDocContent
&&
AscDFH
.
historyitem_DocumentContent_RemoveItem
===
Data
.
Type
)
Count
=
Data
.
Items
.
length
;
var
ContentChanges
=
new
AscCommon
.
CContentChangesElement
((
bAdd
==
true
?
AscCommon
.
contentchanges_Add
:
AscCommon
.
contentchanges_Remove
),
Data
.
Pos
,
Count
,
Item
);
Class
.
Add_ContentChanges
(
ContentChanges
);
this
.
CollaborativeEditing
.
Add_NewDC
(
Class
);
if
(
true
===
bAdd
)
this
.
CollaborativeEditing
.
Update_DocumentPositionsOnAdd
(
Class
,
Data
.
Pos
);
else
this
.
CollaborativeEditing
.
Update_DocumentPositionsOnRemove
(
Class
,
Data
.
Pos
,
Count
);
}
}
if
(
this
.
CollaborativeEditing
.
AddPosExtChanges
&&
Class
instanceof
AscFormat
.
CXfrm
)
{
if
(
AscDFH
.
historyitem_Xfrm_SetOffX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetOffY
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetExtX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetExtY
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetChOffX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetChOffY
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetChExtX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetChExtY
===
Data
.
Type
)
{
this
.
CollaborativeEditing
.
AddPosExtChanges
(
Item
,
AscDFH
.
historyitem_Xfrm_SetOffX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetExtX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetChOffX
===
Data
.
Type
||
AscDFH
.
historyitem_Xfrm_SetChExtX
===
Data
.
Type
);
}
if
(
_Class
.
IsPosExtChange
()){
this
.
CollaborativeEditing
.
AddPosExtChanges
(
Item
,
_Class
);
}
}
},
...
...
word/Math/base.js
View file @
62c99686
...
...
@@ -1582,20 +1582,6 @@ CMathBase.prototype.Redo = function(Data)
{
Data
.
Redo
(
this
);
};
CMathBase
.
prototype
.
Save_Changes
=
function
(
Data
,
Writer
)
{
Writer
.
WriteLong
(
this
.
ClassType
);
WriteChanges_ToBinary
(
Data
,
Writer
);
};
CMathBase
.
prototype
.
Load_Changes
=
function
(
Reader
)
{
var
ClassType
=
Reader
.
GetLong
();
if
(
this
.
ClassType
!==
ClassType
)
return
;
ReadChanges_FromBinary
(
Reader
,
this
);
};
CMathBase
.
prototype
.
Get_AllFontNames
=
function
(
AllFonts
)
{
this
.
CtrPrp
.
Document_Get_AllFontNames
(
AllFonts
);
...
...
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