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
db71e0e2
Commit
db71e0e2
authored
Oct 13, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 33134
parent
577f1638
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
78 deletions
+70
-78
cell/model/UndoRedo.js
cell/model/UndoRedo.js
+70
-78
No files found.
cell/model/UndoRedo.js
View file @
db71e0e2
...
...
@@ -158,7 +158,7 @@ UndoRedoItemSerializable.prototype = {
if
(
oData
.
Write_ToBinary2
)
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oData
.
Write_ToBinary2
(
oBinaryWriter
)});
else
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInner
(
oBinaryWriter
,
oData
,
false
,
nSheetId
,
collaborativeEditing
);});
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInner
Object
(
oBinaryWriter
,
oData
,
nSheetId
,
collaborativeEditing
);});
}
else
{
...
...
@@ -166,92 +166,84 @@ UndoRedoItemSerializable.prototype = {
oBinaryWriter
.
WriteLong
(
0
);
}
},
SerializeDataInner
:
function
(
oBinaryWriter
,
oData
,
bIsArray
,
nSheetId
,
collaborativeEditing
)
{
SerializeDataInnerObject
:
function
(
oBinaryWriter
,
oData
,
nSheetId
,
collaborativeEditing
)
{
var
oProperties
=
oData
.
getProperties
();
for
(
var
i
in
oProperties
)
{
var
nItemType
=
oProperties
[
i
];
var
oItem
=
oData
.
getProperty
(
nItemType
);
this
.
SerializeDataInner
(
oBinaryWriter
,
nItemType
,
oItem
,
nSheetId
,
collaborativeEditing
);
}
},
SerializeDataInnerArray
:
function
(
oBinaryWriter
,
oData
,
nSheetId
,
collaborativeEditing
)
{
for
(
var
i
=
0
;
i
<
oData
.
length
;
++
i
)
{
this
.
SerializeDataInner
(
oBinaryWriter
,
0
,
oData
[
i
],
nSheetId
,
collaborativeEditing
);
}
},
SerializeDataInner
:
function
(
oBinaryWriter
,
nItemType
,
oItem
,
nSheetId
,
collaborativeEditing
)
{
var
oThis
=
this
;
var
oProperties
;
if
(
bIsArray
)
oProperties
=
oData
;
var
sTypeOf
;
if
(
null
==
oItem
)
sTypeOf
=
"
null
"
;
else
if
(
oItem
instanceof
Array
)
sTypeOf
=
"
array
"
;
else
oProperties
=
oData
.
getProperties
();
for
(
var
i
in
oProperties
)
{
var
oItem
;
var
nItemType
;
if
(
bIsArray
)
{
nItemType
=
i
-
0
;
oItem
=
oProperties
[
i
];
}
else
{
nItemType
=
oProperties
[
i
];
oItem
=
oData
.
getProperty
(
nItemType
);
}
var
sTypeOf
;
if
(
null
==
oItem
)
sTypeOf
=
"
null
"
;
else
if
(
oItem
instanceof
Array
)
sTypeOf
=
"
array
"
;
else
sTypeOf
=
typeof
(
oItem
);
switch
(
sTypeOf
)
{
case
"
object
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Object
);
this
.
SerializeDataObject
(
oBinaryWriter
,
oItem
,
nSheetId
,
collaborativeEditing
);
break
;
case
"
array
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Array
);
var
oBinaryCommonWriter
=
new
AscCommon
.
BinaryCommonWriter
(
oBinaryWriter
);
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInner
(
oBinaryWriter
,
oItem
,
true
,
nSheetId
,
collaborativeEditing
);});
break
;
case
"
number
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
var
nFlorItem
=
Math
.
floor
(
oItem
);
if
(
nFlorItem
==
oItem
)
sTypeOf
=
typeof
(
oItem
);
switch
(
sTypeOf
)
{
case
"
object
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Object
);
this
.
SerializeDataObject
(
oBinaryWriter
,
oItem
,
nSheetId
,
collaborativeEditing
);
break
;
case
"
array
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Array
);
var
oBinaryCommonWriter
=
new
AscCommon
.
BinaryCommonWriter
(
oBinaryWriter
);
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInnerArray
(
oBinaryWriter
,
oItem
,
nSheetId
,
collaborativeEditing
);});
break
;
case
"
number
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
var
nFlorItem
=
Math
.
floor
(
oItem
);
if
(
nFlorItem
==
oItem
)
{
if
(
oItem
>=
0
&&
oItem
<=
255
)
{
if
(
oItem
>=
0
&&
oItem
<=
255
)
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Byte
);
oBinaryWriter
.
WriteByte
(
oItem
);
}
else
if
(
oItem
<=
0xffffffff
)
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Long
);
oBinaryWriter
.
WriteLong
(
oItem
);
}
else
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Double
);
oBinaryWriter
.
WriteDouble2
(
oItem
);
}
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Byte
);
oBinaryWriter
.
WriteByte
(
oItem
);
}
else
if
(
oItem
<=
0xffffffff
)
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Long
);
oBinaryWriter
.
WriteLong
(
oItem
);
}
else
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Double
);
oBinaryWriter
.
WriteDouble2
(
oItem
);
}
}
else
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Double
);
oBinaryWriter
.
WriteDouble2
(
oItem
);
}
break
;
case
"
boolean
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Bool
);
oBinaryWriter
.
WriteBool
(
oItem
);
break
;
case
"
string
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
String
);
oBinaryWriter
.
WriteString2
(
oItem
);
break
;
case
"
null
"
:
case
"
undefined
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Null
);
default
:
break
;
case
"
boolean
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Bool
);
oBinaryWriter
.
WriteBool
(
oItem
);
break
;
case
"
string
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
String
);
oBinaryWriter
.
WriteString2
(
oItem
);
break
;
case
"
null
"
:
case
"
undefined
"
:
oBinaryWriter
.
WriteByte
(
nItemType
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Null
);
default
:
break
;
}
}
},
...
...
@@ -363,7 +355,7 @@ UndoRedoItemSerializable.prototype = {
if
(
false
==
nUnknownType
)
{
if
(
bIsArray
)
oDataObject
[
nMemeberType
]
=
oNewValue
;
oDataObject
.
push
(
oNewValue
)
;
else
oDataObject
.
setProperty
(
nMemeberType
,
oNewValue
);
}
...
...
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