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
e5aa82ac
Commit
e5aa82ac
authored
Jun 09, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cwf = {cells: {}}; -> cwf = {};
parent
feb835f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
cell/model/Workbook.js
cell/model/Workbook.js
+12
-12
No files found.
cell/model/Workbook.js
View file @
e5aa82ac
...
@@ -438,12 +438,12 @@ DependencyGraph.prototype = {
...
@@ -438,12 +438,12 @@ DependencyGraph.prototype = {
if
(
cwf
)
if
(
cwf
)
{
{
if
(
!
toAdd
)
if
(
!
toAdd
)
delete
cwf
.
cells
[
sOldCellId
];
delete
cwf
[
sOldCellId
];
if
(
!
toDelete
)
if
(
!
toDelete
)
{
{
var
cell
=
node
.
returnCell
();
var
cell
=
node
.
returnCell
();
if
(
cell
&&
cell
.
formulaParsed
)
if
(
cell
&&
cell
.
formulaParsed
)
cwf
.
cells
[
node
.
cellId
]
=
node
.
cellId
;
cwf
[
node
.
cellId
]
=
node
.
cellId
;
}
}
}
}
}
}
...
@@ -2098,16 +2098,16 @@ Workbook.prototype.copyWorksheet=function(index, insertBefore, sName, sId, bFrom
...
@@ -2098,16 +2098,16 @@ Workbook.prototype.copyWorksheet=function(index, insertBefore, sName, sId, bFrom
//для формул. создаем копию this.cwf[this.Id] для нового листа.
//для формул. создаем копию this.cwf[this.Id] для нового листа.
if
(
this
.
cwf
[
wsFrom
.
getId
()]
){
if
(
this
.
cwf
[
wsFrom
.
getId
()]
){
var
cwf
=
{
cells
:{}
};
var
cwf
=
{};
var
newSheetId
=
newSheet
.
getId
();
var
newSheetId
=
newSheet
.
getId
();
var
cwfFrom
=
this
.
cwf
[
wsFrom
.
getId
()];
var
cwfFrom
=
this
.
cwf
[
wsFrom
.
getId
()];
this
.
cwf
[
newSheetId
]
=
cwf
;
this
.
cwf
[
newSheetId
]
=
cwf
;
for
(
var
id
in
cwfFrom
.
cells
){
for
(
var
id
in
cwfFrom
){
cwf
.
cells
[
id
]
=
cwfFrom
.
cells
[
id
];
cwf
[
id
]
=
cwfFrom
[
id
];
this
.
needRecalc
.
nodes
[
getVertexId
(
newSheetId
,
id
)]
=
[
newSheetId
,
id
];
this
.
needRecalc
.
nodes
[
getVertexId
(
newSheetId
,
id
)]
=
[
newSheetId
,
id
];
this
.
needRecalc
.
length
++
;
this
.
needRecalc
.
length
++
;
}
}
newSheet
.
_BuildDependencies
(
cwf
.
cells
);
newSheet
.
_BuildDependencies
(
cwf
);
}
}
if
(
!
tableNames
&&
newSheet
.
TableParts
&&
newSheet
.
TableParts
.
length
)
if
(
!
tableNames
&&
newSheet
.
TableParts
&&
newSheet
.
TableParts
.
length
)
...
@@ -2145,7 +2145,7 @@ Workbook.prototype.insertWorksheet = function (index, sheet, cwf) {
...
@@ -2145,7 +2145,7 @@ Workbook.prototype.insertWorksheet = function (index, sheet, cwf) {
this
.
_insertTablePartsName
(
sheet
);
this
.
_insertTablePartsName
(
sheet
);
//восстанавливаем список ячеек с формулами для sheet
//восстанавливаем список ячеек с формулами для sheet
this
.
cwf
[
sheet
.
getId
()]
=
cwf
;
this
.
cwf
[
sheet
.
getId
()]
=
cwf
;
sheet
.
_BuildDependencies
(
cwf
.
cells
);
sheet
.
_BuildDependencies
(
cwf
);
this
.
sortDependency
();
this
.
sortDependency
();
};
};
Workbook
.
prototype
.
_insertTablePartsName
=
function
(
sheet
)
{
Workbook
.
prototype
.
_insertTablePartsName
=
function
(
sheet
)
{
...
@@ -2737,7 +2737,7 @@ Workbook.prototype.buildDependency = function(){
...
@@ -2737,7 +2737,7 @@ Workbook.prototype.buildDependency = function(){
// this.dependencyFormulas = null;
// this.dependencyFormulas = null;
// this.dependencyFormulas = new DependencyGraph(this);
// this.dependencyFormulas = new DependencyGraph(this);
for
(
var
i
in
this
.
cwf
){
for
(
var
i
in
this
.
cwf
){
this
.
getWorksheetById
(
i
).
_BuildDependencies
(
this
.
cwf
[
i
]
.
cells
);
this
.
getWorksheetById
(
i
).
_BuildDependencies
(
this
.
cwf
[
i
]);
}
}
};
};
Workbook
.
prototype
.
recalcDependency
=
function
(
f
,
bad
,
notRecalc
){
Workbook
.
prototype
.
recalcDependency
=
function
(
f
,
bad
,
notRecalc
){
...
@@ -3443,7 +3443,7 @@ Woorksheet.prototype.copyDrawingObjects=function(oNewWs, wsFrom)
...
@@ -3443,7 +3443,7 @@ Woorksheet.prototype.copyDrawingObjects=function(oNewWs, wsFrom)
}
}
};
};
Woorksheet
.
prototype
.
initPostOpen
=
function
(
handlers
){
Woorksheet
.
prototype
.
initPostOpen
=
function
(
handlers
){
this
.
workbook
.
cwf
[
this
.
Id
]
=
{
cells
:{}
};
var
cwf
=
this
.
workbook
.
cwf
[
this
.
Id
]
=
{
};
if
(
this
.
aFormulaExt
){
if
(
this
.
aFormulaExt
){
var
formulaShared
=
{};
var
formulaShared
=
{};
for
(
var
i
=
0
;
i
<
this
.
aFormulaExt
.
length
;
++
i
){
for
(
var
i
=
0
;
i
<
this
.
aFormulaExt
.
length
;
++
i
){
...
@@ -3478,7 +3478,7 @@ Woorksheet.prototype.initPostOpen = function(handlers){
...
@@ -3478,7 +3478,7 @@ Woorksheet.prototype.initPostOpen = function(handlers){
off
.
offsetRow
*=-
1
;
off
.
offsetRow
*=-
1
;
formulaShared
[
oFormulaExt
.
si
].
fVal
.
changeOffset
(
off
);
formulaShared
[
oFormulaExt
.
si
].
fVal
.
changeOffset
(
off
);
}
}
this
.
workbook
.
cwf
[
this
.
Id
].
cells
[
sCellId
]
=
sCellId
;
cwf
[
sCellId
]
=
sCellId
;
}
}
}
}
}
}
...
@@ -3499,7 +3499,7 @@ Woorksheet.prototype.initPostOpen = function(handlers){
...
@@ -3499,7 +3499,7 @@ Woorksheet.prototype.initPostOpen = function(handlers){
Если ячейка содержит в себе формулу, то добавляем ее в список ячеек с формулами.
Если ячейка содержит в себе формулу, то добавляем ее в список ячеек с формулами.
*/
*/
if
(
oCell
.
sFormula
){
if
(
oCell
.
sFormula
){
this
.
workbook
.
cwf
[
this
.
Id
].
cells
[
sCellId
]
=
sCellId
;
cwf
[
sCellId
]
=
sCellId
;
}
}
/*
/*
Строится список ячеек, которые необходимо пересчитать при открытии. Это ячейки имеющие атрибут f.ca или значение в которых неопределено.
Строится список ячеек, которые необходимо пересчитать при открытии. Это ячейки имеющие атрибут f.ca или значение в которых неопределено.
...
@@ -3804,7 +3804,7 @@ Woorksheet.prototype.setName=function(name, bFromUndoRedo){
...
@@ -3804,7 +3804,7 @@ Woorksheet.prototype.setName=function(name, bFromUndoRedo){
//перестраиваем формулы, если у них были ссылки на лист со старым именем.
//перестраиваем формулы, если у них были ссылки на лист со старым именем.
for
(
var
id
in
this
.
workbook
.
cwf
)
{
for
(
var
id
in
this
.
workbook
.
cwf
)
{
this
.
workbook
.
getWorksheetById
(
id
).
_ReBuildFormulas
(
this
.
workbook
.
cwf
[
id
]
.
cells
,
lastName
,
this
.
sName
);
this
.
workbook
.
getWorksheetById
(
id
).
_ReBuildFormulas
(
this
.
workbook
.
cwf
[
id
],
lastName
,
this
.
sName
);
}
}
this
.
workbook
.
dependencyFormulas
.
relinkDefNameByWorksheet
(
lastName
,
name
);
this
.
workbook
.
dependencyFormulas
.
relinkDefNameByWorksheet
(
lastName
,
name
);
...
...
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