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 = {
...
@@ -158,7 +158,7 @@ UndoRedoItemSerializable.prototype = {
if
(
oData
.
Write_ToBinary2
)
if
(
oData
.
Write_ToBinary2
)
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oData
.
Write_ToBinary2
(
oBinaryWriter
)});
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oData
.
Write_ToBinary2
(
oBinaryWriter
)});
else
else
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInner
(
oBinaryWriter
,
oData
,
false
,
nSheetId
,
collaborativeEditing
);});
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInner
Object
(
oBinaryWriter
,
oData
,
nSheetId
,
collaborativeEditing
);});
}
}
else
else
{
{
...
@@ -166,92 +166,84 @@ UndoRedoItemSerializable.prototype = {
...
@@ -166,92 +166,84 @@ UndoRedoItemSerializable.prototype = {
oBinaryWriter
.
WriteLong
(
0
);
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
oThis
=
this
;
var
oProperties
;
var
sTypeOf
;
if
(
bIsArray
)
if
(
null
==
oItem
)
oProperties
=
oData
;
sTypeOf
=
"
null
"
;
else
if
(
oItem
instanceof
Array
)
sTypeOf
=
"
array
"
;
else
else
oProperties
=
oData
.
getProperties
();
sTypeOf
=
typeof
(
oItem
);
for
(
var
i
in
oProperties
)
switch
(
sTypeOf
)
{
{
var
oItem
;
case
"
object
"
:
var
nItemType
;
oBinaryWriter
.
WriteByte
(
nItemType
);
if
(
bIsArray
)
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Object
);
{
this
.
SerializeDataObject
(
oBinaryWriter
,
oItem
,
nSheetId
,
collaborativeEditing
);
nItemType
=
i
-
0
;
break
;
oItem
=
oProperties
[
i
];
case
"
array
"
:
}
oBinaryWriter
.
WriteByte
(
nItemType
);
else
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Array
);
{
var
oBinaryCommonWriter
=
new
AscCommon
.
BinaryCommonWriter
(
oBinaryWriter
);
nItemType
=
oProperties
[
i
];
oBinaryCommonWriter
.
WriteItemWithLength
(
function
(){
oThis
.
SerializeDataInnerArray
(
oBinaryWriter
,
oItem
,
nSheetId
,
collaborativeEditing
);});
oItem
=
oData
.
getProperty
(
nItemType
);
break
;
}
case
"
number
"
:
var
sTypeOf
;
oBinaryWriter
.
WriteByte
(
nItemType
);
if
(
null
==
oItem
)
var
nFlorItem
=
Math
.
floor
(
oItem
);
sTypeOf
=
"
null
"
;
if
(
nFlorItem
==
oItem
)
else
if
(
oItem
instanceof
Array
)
{
sTypeOf
=
"
array
"
;
if
(
oItem
>=
0
&&
oItem
<=
255
)
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
)
{
{
if
(
oItem
>=
0
&&
oItem
<=
255
)
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Byte
);
{
oBinaryWriter
.
WriteByte
(
oItem
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Byte
);
}
oBinaryWriter
.
WriteByte
(
oItem
);
else
if
(
oItem
<=
0xffffffff
)
}
{
else
if
(
oItem
<=
0xffffffff
)
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Long
);
{
oBinaryWriter
.
WriteLong
(
oItem
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Long
);
oBinaryWriter
.
WriteLong
(
oItem
);
}
else
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Double
);
oBinaryWriter
.
WriteDouble2
(
oItem
);
}
}
}
else
else
{
{
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Double
);
oBinaryWriter
.
WriteByte
(
c_oUndoRedoSerializeType
.
Double
);
oBinaryWriter
.
WriteDouble2
(
oItem
);
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
;
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 = {
...
@@ -363,7 +355,7 @@ UndoRedoItemSerializable.prototype = {
if
(
false
==
nUnknownType
)
if
(
false
==
nUnknownType
)
{
{
if
(
bIsArray
)
if
(
bIsArray
)
oDataObject
[
nMemeberType
]
=
oNewValue
;
oDataObject
.
push
(
oNewValue
)
;
else
else
oDataObject
.
setProperty
(
nMemeberType
,
oNewValue
);
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