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
c2876087
Commit
c2876087
authored
Nov 03, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
table names after delete sheet
parent
3092544d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+11
-6
cell/model/Workbook.js
cell/model/Workbook.js
+20
-3
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
c2876087
...
@@ -3772,17 +3772,17 @@ function parserFormula( formula, parent, _ws ) {
...
@@ -3772,17 +3772,17 @@ function parserFormula( formula, parent, _ws ) {
eventData
.
isRebuild
=
true
;
eventData
.
isRebuild
=
true
;
}
else
if
(
AscCommon
.
c_oNotifyType
.
ChangeSheet
===
data
.
type
)
{
}
else
if
(
AscCommon
.
c_oNotifyType
.
ChangeSheet
===
data
.
type
)
{
needAssemble
=
false
;
needAssemble
=
false
;
if
(
this
.
is3D
)
{
var
changeData
=
data
.
data
;
var
changeData
=
data
.
data
;
if
(
this
.
is3D
||
changeData
.
remove
)
{
if
(
changeData
.
insert
)
{
if
(
changeData
.
insert
)
{
eventData
.
isRebuild
=
this
.
insertSheet
(
changeData
.
insert
);
eventData
.
isRebuild
=
this
.
insertSheet
(
changeData
.
insert
);
}
else
if
(
changeData
.
replace
||
changeData
.
remove
)
{
}
else
if
(
changeData
.
replace
||
changeData
.
remove
)
{
eventData
.
isRebuild
=
true
;
eventData
.
isRebuild
=
true
;
var
moveSheetRes
=
0
;
var
moveSheetRes
=
0
;
if
(
changeData
.
re
plac
e
)
{
if
(
changeData
.
re
mov
e
)
{
moveSheetRes
=
this
.
moveSheet
(
changeData
.
replace
);
moveSheetRes
=
this
.
removeSheet
(
changeData
.
remove
,
changeData
.
tableNamesMap
);
}
else
{
}
else
{
moveSheetRes
=
this
.
removeSheet
(
changeData
.
remov
e
);
moveSheetRes
=
this
.
moveSheet
(
changeData
.
replac
e
);
}
}
if
(
2
===
moveSheetRes
)
{
if
(
2
===
moveSheetRes
)
{
needAssemble
=
true
;
needAssemble
=
true
;
...
@@ -4887,7 +4887,7 @@ parserFormula.prototype.calculate = function(opt_defName, opt_range) {
...
@@ -4887,7 +4887,7 @@ parserFormula.prototype.calculate = function(opt_defName, opt_range) {
}
}
return
this
;
return
this
;
};
};
parserFormula
.
prototype
.
removeSheet
=
function
(
sheetId
)
{
parserFormula
.
prototype
.
removeSheet
=
function
(
sheetId
,
tableNamesMap
)
{
var
nRes
=
0
;
var
nRes
=
0
;
var
ws
=
this
.
wb
.
getWorksheetById
(
sheetId
);
var
ws
=
this
.
wb
.
getWorksheetById
(
sheetId
);
if
(
ws
)
{
if
(
ws
)
{
...
@@ -4935,6 +4935,11 @@ parserFormula.prototype.calculate = function(opt_defName, opt_range) {
...
@@ -4935,6 +4935,11 @@ parserFormula.prototype.calculate = function(opt_defName, opt_range) {
this
.
outStack
[
i
]
=
new
cError
(
cErrorType
.
bad_reference
);
this
.
outStack
[
i
]
=
new
cError
(
cErrorType
.
bad_reference
);
nRes
=
2
;
nRes
=
2
;
}
}
}
else
if
(
cElementType
.
table
===
elem
.
type
)
{
if
(
tableNamesMap
[
elem
.
tableName
])
{
this
.
outStack
[
i
]
=
new
cError
(
cErrorType
.
bad_reference
);
nRes
=
2
;
}
}
}
}
}
}
}
...
...
cell/model/Workbook.js
View file @
c2876087
...
@@ -425,7 +425,7 @@ function getRangeType(oBBox){
...
@@ -425,7 +425,7 @@ function getRangeType(oBBox){
this
.
_shiftMoveDelete
(
AscCommon
.
c_oNotifyType
.
Move
,
sheetId
,
bboxFrom
,
offset
);
this
.
_shiftMoveDelete
(
AscCommon
.
c_oNotifyType
.
Move
,
sheetId
,
bboxFrom
,
offset
);
this
.
addToChangedRange
(
sheetId
,
bboxFrom
);
this
.
addToChangedRange
(
sheetId
,
bboxFrom
);
},
},
changeSheet
:
function
(
sheetId
,
data
)
{
changeSheet
:
function
(
sheetId
,
data
,
tableNamesMap
)
{
this
.
buildDependency
();
this
.
buildDependency
();
var
listeners
=
{};
var
listeners
=
{};
var
sheetContainer
=
this
.
sheetListeners
[
sheetId
];
var
sheetContainer
=
this
.
sheetListeners
[
sheetId
];
...
@@ -446,6 +446,17 @@ function getRangeType(oBBox){
...
@@ -446,6 +446,17 @@ function getRangeType(oBBox){
listeners
[
listenerId
]
=
sheetContainer
.
defName3d
[
listenerId
];
listeners
[
listenerId
]
=
sheetContainer
.
defName3d
[
listenerId
];
}
}
}
}
if
(
tableNamesMap
){
for
(
var
tableName
in
tableNamesMap
)
{
var
nameIndex
=
getDefNameIndex
(
tableName
);
var
container
=
this
.
defNameListeners
[
nameIndex
];
if
(
container
)
{
for
(
var
listenerId
in
container
.
listeners
)
{
listeners
[
listenerId
]
=
container
.
listeners
[
listenerId
];
}
}
}
}
var
notifyData
=
{
type
:
AscCommon
.
c_oNotifyType
.
ChangeSheet
,
data
:
data
};
var
notifyData
=
{
type
:
AscCommon
.
c_oNotifyType
.
ChangeSheet
,
data
:
data
};
for
(
var
listenerId
in
listeners
)
{
for
(
var
listenerId
in
listeners
)
{
listeners
[
listenerId
].
notify
(
notifyData
);
listeners
[
listenerId
].
notify
(
notifyData
);
...
@@ -471,11 +482,17 @@ function getRangeType(oBBox){
...
@@ -471,11 +482,17 @@ function getRangeType(oBBox){
}
}
}
}
//tables
//tables
var
tableNamesMap
=
{};
for
(
var
i
=
0
;
i
<
tableNames
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
tableNames
.
length
;
++
i
)
{
this
.
_delDefName
(
tableNames
[
i
],
null
);
var
tableName
=
tableNames
[
i
];
var
defName
=
this
.
_delDefName
(
tableName
,
null
);
if
(
defName
)
{
defName
.
removeDependencies
();
}
tableNamesMap
[
tableName
]
=
1
;
}
}
//dependence
//dependence
this
.
changeSheet
(
sheetId
,
{
remove
:
sheetId
}
);
this
.
changeSheet
(
sheetId
,
{
remove
:
sheetId
,
tableNamesMap
:
tableNamesMap
},
tableNamesMap
);
},
},
//lock
//lock
lockRecal
:
function
()
{
lockRecal
:
function
()
{
...
...
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