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
b388cd4c
Commit
b388cd4c
authored
Jun 10, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 'si' param check
parent
d07d5a60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
35 deletions
+25
-35
cell/model/Workbook.js
cell/model/Workbook.js
+25
-35
No files found.
cell/model/Workbook.js
View file @
b388cd4c
...
...
@@ -3451,36 +3451,27 @@ Woorksheet.prototype.initPostOpen = function(handlers){
var
oCell
=
elem
.
cell
;
var
sCellId
=
g_oCellAddressUtils
.
getCellId
(
oCell
.
nRow
,
oCell
.
nCol
);
var
oFormulaExt
=
elem
.
ext
;
if
(
oFormulaExt
.
t
==
Asc
.
ECellFormulaType
.
cellformulatypeShared
)
{
if
(
null
!=
oFormulaExt
.
si
){
if
(
null
!=
oFormulaExt
.
ref
){
if
(
oFormulaExt
.
v
.
length
<=
AscCommon
.
c_oAscMaxFormulaLength
)
{
formulaShared
[
oFormulaExt
.
si
]
=
{
fVal
:
new
parserFormula
(
oFormulaExt
.
v
,
""
,
this
),
fRef
:
function
(
t
)
{
var
r
=
t
.
getRange2
(
oFormulaExt
.
ref
);
return
{
c
:
r
,
first
:
r
.
first
};
}(
this
)
};
formulaShared
[
oFormulaExt
.
si
].
fVal
.
parse
();
}
if
(
oFormulaExt
.
t
===
Asc
.
ECellFormulaType
.
cellformulatypeShared
&&
null
!==
oFormulaExt
.
si
)
{
if
(
null
!==
oFormulaExt
.
ref
)
{
if
(
oFormulaExt
.
v
.
length
<=
AscCommon
.
c_oAscMaxFormulaLength
)
{
formulaShared
[
oFormulaExt
.
si
]
=
{
fVal
:
new
parserFormula
(
oFormulaExt
.
v
,
""
,
this
),
fRef
:
AscCommonExcel
.
g_oRangeCache
.
getAscRange
(
oFormulaExt
.
ref
)
};
formulaShared
[
oFormulaExt
.
si
].
fVal
.
parse
();
}
else
{
if
(
formulaShared
[
oFormulaExt
.
si
]
){
var
fr
=
formulaShared
[
oFormulaExt
.
si
].
fRef
;
if
(
fr
.
c
.
containCell2
(
oCell
)
){
if
(
formulaShared
[
oFormulaExt
.
si
].
fVal
.
isParsed
){
var
off
=
oCell
.
getOffset3
(
fr
.
first
);
formulaShared
[
oFormulaExt
.
si
].
fVal
.
changeOffset
(
off
);
oFormulaExt
.
v
=
formulaShared
[
oFormulaExt
.
si
].
fVal
.
assemble
();
off
.
offsetCol
*=-
1
;
off
.
offsetRow
*=-
1
;
formulaShared
[
oFormulaExt
.
si
].
fVal
.
changeOffset
(
off
);
}
cwf
[
sCellId
]
=
sCellId
;
}
}
else
{
var
fs
=
formulaShared
[
oFormulaExt
.
si
];
if
(
fs
&&
fs
.
fRef
.
contains
(
oCell
.
nCol
,
oCell
.
nRow
))
{
if
(
false
&&
fs
.
fVal
.
isParsed
)
{
var
off
=
oCell
.
getOffset3
(
fs
.
fRef
.
c1
,
fs
.
fRef
.
r1
);
fs
.
fVal
.
changeOffset
(
off
);
oFormulaExt
.
v
=
fs
.
fVal
.
assemble
();
off
.
offsetCol
*=
-
1
;
off
.
offsetRow
*=
-
1
;
fs
.
fVal
.
changeOffset
(
off
);
}
cwf
[
sCellId
]
=
sCellId
;
}
}
}
...
...
@@ -3804,7 +3795,7 @@ Woorksheet.prototype.setName=function(name, bFromUndoRedo){
//перестраиваем формулы, если у них были ссылки на лист со старым именем.
for
(
var
id
in
this
.
workbook
.
cwf
)
{
this
.
workbook
.
getWorksheetById
(
id
).
_ReBuildFormulas
(
this
.
workbook
.
cwf
[
id
]
,
lastName
,
this
.
sName
);
this
.
workbook
.
getWorksheetById
(
id
).
_ReBuildFormulas
(
this
.
workbook
.
cwf
[
id
]);
}
this
.
workbook
.
dependencyFormulas
.
relinkDefNameByWorksheet
(
lastName
,
name
);
...
...
@@ -6175,15 +6166,14 @@ Cell.prototype.moveVer=function(val){
this
.
nRow
+=
val
;
};
Cell
.
prototype
.
getOffset
=
function
(
cell
){
return
{
offsetCol
:(
this
.
nCol
-
cell
.
nCol
),
offsetRow
:(
this
.
nRow
-
cell
.
nRow
)}
;
return
this
.
getOffset3
(
cell
.
nCol
-
1
,
cell
.
nRow
-
1
)
;
};
Cell
.
prototype
.
getOffset2
=
function
(
cellId
){
var
cAddr2
=
new
CellAddress
(
cellId
);
return
{
offsetCol
:(
this
.
nCol
-
cAddr2
.
col
+
1
),
offsetRow
:(
this
.
nRow
-
cAddr2
.
row
+
1
)}
;
return
this
.
getOffset3
(
cAddr2
.
col
,
cAddr2
.
row
)
;
};
Cell
.
prototype
.
getOffset3
=
function
(
cellAddr
){
var
cAddr2
=
cellAddr
;
return
{
offsetCol
:(
this
.
nCol
-
cAddr2
.
col
+
1
),
offsetRow
:(
this
.
nRow
-
cAddr2
.
row
+
1
)};
Cell
.
prototype
.
getOffset3
=
function
(
col
,
row
){
return
new
AscCommonExcel
.
CRangeOffset
((
this
.
nCol
-
col
+
1
),
(
this
.
nRow
-
row
+
1
));
};
Cell
.
prototype
.
getValueData
=
function
(){
return
new
UndoRedoData_CellValueData
(
this
.
sFormula
,
this
.
oValue
.
clone
());
...
...
@@ -8517,7 +8507,7 @@ Range.prototype._shiftUpDown = function (bUp, preDeleteAction, displayNameFormat
this
.
worksheet
.
workbook
.
buildRecalc
();
return
true
;
};
Range
.
prototype
.
setOffset
=
function
(
offset
){
//offset =
{offsetCol:intNumber, offsetRow:intNumber}
Range
.
prototype
.
setOffset
=
function
(
offset
){
//offset =
AscCommonExcel.CRangeOffset
this
.
bbox
.
c1
+=
offset
.
offsetCol
;
if
(
this
.
bbox
.
c1
<
0
)
this
.
bbox
.
c1
=
0
;
...
...
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