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
ef45a769
Commit
ef45a769
authored
Oct 25, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now changes can be added in an old style like objects and in a new style like classes.
parent
5f9d129f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
205 additions
and
146 deletions
+205
-146
common/Drawings/Format/Constants.js
common/Drawings/Format/Constants.js
+15
-6
word/Editor/History.js
word/Editor/History.js
+27
-17
word/Editor/Run.js
word/Editor/Run.js
+108
-68
word/Editor/RunChanges.js
word/Editor/RunChanges.js
+55
-55
No files found.
common/Drawings/Format/Constants.js
View file @
ef45a769
...
...
@@ -2882,6 +2882,15 @@
// В большинстве случаев загрузка чужого изменения работает как простое Redo
this
.
Redo
();
};
CChangesBase
.
prototype
.
IsChangesClass
=
function
()
{
// TODO: Эта функция добавлена пока все изменения не переделаны на классы
return
true
;
};
CChangesBase
.
prototype
.
GetClass
=
function
()
{
return
this
.
Class
;
};
window
[
'
AscDFH
'
].
CChangesBase
=
CChangesBase
;
/**
* Базовый класс для изменения свойств.
...
...
@@ -2896,7 +2905,7 @@
this
.
Old
=
Old
;
this
.
New
=
New
;
}
AscCommon
.
extendClass
(
CChangesBase
,
CChangesBaseProperty
);
AscCommon
.
extendClass
(
CChangesBase
Property
,
CChangesBase
);
CChangesBaseProperty
.
prototype
.
Undo
=
function
()
{
this
.
private_SetValue
(
this
.
Old
);
...
...
@@ -2919,7 +2928,7 @@
{
CChangesBaseBoolProperty
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesBase
Property
,
CChangesBaseBool
Property
);
AscCommon
.
extendClass
(
CChangesBase
BoolProperty
,
CChangesBase
Property
);
CChangesBaseBoolProperty
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
...
...
@@ -2986,7 +2995,7 @@
{
CChangesBaseDoubleProperty
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesBase
Property
,
CChangesBaseDoubl
eProperty
);
AscCommon
.
extendClass
(
CChangesBase
DoubleProperty
,
CChangesBas
eProperty
);
CChangesBaseDoubleProperty
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
...
...
@@ -3052,7 +3061,7 @@
{
CChangesBaseObjectProperty
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesBase
Property
,
CChangesBaseObject
Property
);
AscCommon
.
extendClass
(
CChangesBase
ObjectProperty
,
CChangesBase
Property
);
CChangesBaseObjectProperty
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
...
...
@@ -3144,7 +3153,7 @@
{
CChangesBaseLongProperty
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesBase
Property
,
CChangesBaseLong
Property
);
AscCommon
.
extendClass
(
CChangesBase
LongProperty
,
CChangesBase
Property
);
CChangesBaseLongProperty
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
...
...
@@ -3210,7 +3219,7 @@
{
CChangesBaseStringProperty
.
superclass
.
constructor
.
call
(
this
,
Class
,
Old
,
New
,
Color
);
}
AscCommon
.
extendClass
(
CChangesBase
Property
,
CChangesBaseString
Property
);
AscCommon
.
extendClass
(
CChangesBase
StringProperty
,
CChangesBase
Property
);
CChangesBaseStringProperty
.
prototype
.
WriteToBinary
=
function
(
Writer
)
{
// Long : Flag
...
...
word/Editor/History.js
View file @
ef45a769
...
...
@@ -381,7 +381,7 @@ CHistory.prototype =
// Регистрируем новое изменение:
// Class - объект, в котором оно произошло
// Data - сами изменения
Add
:
function
(
Class
,
Data
)
Add
:
function
(
_
Class
,
Data
)
{
if
(
0
!==
this
.
TurnOffHistory
||
this
.
Index
<
0
)
return
;
...
...
@@ -393,25 +393,35 @@ CHistory.prototype =
if
(
this
.
RecIndex
>=
this
.
Index
)
this
.
RecIndex
=
this
.
Index
-
1
;
var
Binary_Pos
=
this
.
BinaryWriter
.
GetCurPosition
();
var
Binary_Pos
=
this
.
BinaryWriter
.
GetCurPosition
();
this
.
BinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
Class
.
Save_Changes
(
Data
,
this
.
BinaryWriter
);
var
Class
;
if
(
_Class
&&
_Class
.
IsChangesClass
&&
_Class
.
IsChangesClass
())
{
Class
=
_Class
.
GetClass
();
Data
=
_Class
;
var
Binary_Len
=
this
.
BinaryWriter
.
GetCurPosition
()
-
Binary_Pos
;
this
.
BinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
_Class
.
WriteToBinary
(
this
.
BinaryWriter
);
}
else
{
Class
=
_Class
;
this
.
BinaryWriter
.
WriteString2
(
Class
.
Get_Id
());
Class
.
Save_Changes
(
Data
,
this
.
BinaryWriter
);
}
var
Binary_Len
=
this
.
BinaryWriter
.
GetCurPosition
()
-
Binary_Pos
;
var
Item
=
{
Class
:
Class
,
Data
:
Data
,
Binary
:
{
Pos
:
Binary_Pos
,
Len
:
Binary_Len
},
var
Item
=
{
Class
:
Class
,
Data
:
Data
,
Binary
:
{
Pos
:
Binary_Pos
,
Len
:
Binary_Len
},
NeedRecalc
:
!
this
.
MinorChanges
};
NeedRecalc
:
!
this
.
MinorChanges
};
this
.
Points
[
this
.
Index
].
Items
.
push
(
Item
);
...
...
word/Editor/Run.js
View file @
ef45a769
This diff is collapsed.
Click to expand it.
word/Editor/RunChanges.js
View file @
ef45a769
This diff is collapsed.
Click to expand it.
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