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
591b909d
Commit
591b909d
authored
Jan 23, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removeDependencies in cArea3D, removeSheet formula error
parent
38ff9fb9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
24 deletions
+21
-24
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+6
-3
cell/model/Workbook.js
cell/model/Workbook.js
+15
-21
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
591b909d
...
...
@@ -1112,6 +1112,8 @@ function cArea3D( val, wsFrom, wsTo, wb ) {/*Area3D means "Sheat1!A1:E5" for exa
}
this
.
wsFrom
=
this
.
_wb
.
getWorksheetByName
(
wsFrom
).
getId
();
this
.
wsTo
=
this
.
_wb
.
getWorksheetByName
(
wsTo
).
getId
();
//dependenceRange allow change sheets and then independently removeDependencies
this
.
dependenceRange
=
null
;
}
cArea3D
.
prototype
=
Object
.
create
(
cBaseType
.
prototype
);
...
...
@@ -5267,6 +5269,7 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
this
.
wb
.
dependencyFormulas
.
startListeningRange
(
ref
.
getWsId
(),
bbox
,
this
);
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
())
{
wsR
=
ref
.
range
(
ref
.
wsRange
());
ref
.
dependenceRange
=
wsR
;
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
var
range
=
wsR
[
j
];
if
(
range
)
{
...
...
@@ -5327,8 +5330,8 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
bbox
.
setOffsetLast
({
offsetRow
:
1
,
offsetCol
:
0
});
}
this
.
wb
.
dependencyFormulas
.
endListeningRange
(
ref
.
getWsId
(),
bbox
,
this
);
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
())
{
wsR
=
ref
.
range
(
ref
.
wsRange
())
;
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
()
&&
ref
.
dependenceRange
)
{
wsR
=
ref
.
dependenceRange
;
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
var
range
=
wsR
[
j
];
if
(
range
)
{
...
...
cell/model/Workbook.js
View file @
591b909d
...
...
@@ -465,32 +465,24 @@
}
},
removeSheet
:
function
(
sheetId
,
tableNames
)
{
var
t
=
this
;
//cells
var
sheet
=
this
.
wb
.
getWorksheetById
(
sheetId
);
var
range
=
sheet
.
getRange3
(
0
,
0
,
gc_nMaxRow0
,
gc_nMaxCol0
);
range
.
_setPropertyNoEmpty
(
null
,
null
,
function
(
cell
){
if
(
cell
.
formulaParsed
)
{
cell
.
formulaParsed
.
removeDependencies
();
var
formulas
=
[];
this
.
wb
.
getWorksheetById
(
sheetId
).
getAllFormulas
(
formulas
);
for
(
var
i
=
0
;
i
<
formulas
.
length
;
++
i
)
{
formulas
[
i
].
removeDependencies
();
}
});
//defnames
var
sheetContainerFrom
=
this
.
defNames
.
sheet
[
sheetId
];
if
(
sheetContainerFrom
)
{
for
(
var
name
in
sheetContainerFrom
)
{
var
defNameOld
=
sheetContainerFrom
[
name
];
if
(
!
defNameOld
.
isTable
)
{
this
.
_removeDefName
(
sheetId
,
name
,
AscCH
.
historyitem_Workbook_DefinedNamesChangeUndo
);
}
}
this
.
_foreachDefNameSheet
(
sheetId
,
function
(
defName
){
if
(
!
defName
.
isTable
)
{
t
.
_removeDefName
(
sheetId
,
defName
.
name
,
AscCH
.
historyitem_Workbook_DefinedNamesChangeUndo
);
}
});
//tables
var
tableNamesMap
=
{};
for
(
var
i
=
0
;
i
<
tableNames
.
length
;
++
i
)
{
var
tableName
=
tableNames
[
i
];
var
defName
=
this
.
_delDefName
(
tableName
,
null
);
if
(
defName
)
{
defName
.
removeDependencies
();
}
this
.
_removeDefName
(
null
,
tableName
,
null
);
tableNamesMap
[
tableName
]
=
1
;
}
//dependence
...
...
@@ -955,9 +947,11 @@
_removeDefName
:
function
(
sheetId
,
name
,
historyType
)
{
var
defName
=
this
.
_delDefName
(
name
,
sheetId
);
if
(
defName
)
{
if
(
null
!=
historyType
)
{
History
.
Create_NewPoint
();
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoWorkbook
,
historyType
,
null
,
null
,
new
UndoRedoData_FromTo
(
defName
.
getUndoDefName
(),
null
));
}
defName
.
removeDependencies
();
this
.
addToChangedDefName
(
defName
);
...
...
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