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
Hide 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
...
@@ -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
.
wsFrom
=
this
.
_wb
.
getWorksheetByName
(
wsFrom
).
getId
();
this
.
wsTo
=
this
.
_wb
.
getWorksheetByName
(
wsTo
).
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
);
cArea3D
.
prototype
=
Object
.
create
(
cBaseType
.
prototype
);
...
@@ -4642,7 +4644,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
...
@@ -4642,7 +4644,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
/* Referens to DefinedNames */
else
if
(
parserHelp
.
isName
.
call
(
this
,
this
.
Formula
,
this
.
pCurrPos
,
this
.
wb
,
/* Referens to DefinedNames */
else
if
(
parserHelp
.
isName
.
call
(
this
,
this
.
Formula
,
this
.
pCurrPos
,
this
.
wb
,
this
.
ws
)[
0
])
{
this
.
ws
)[
0
])
{
found_operand
=
new
cName
(
this
.
operand_str
,
this
.
wb
,
this
.
ws
);
found_operand
=
new
cName
(
this
.
operand_str
,
this
.
wb
,
this
.
ws
);
var
defName
=
found_operand
.
getDefName
();
var
defName
=
found_operand
.
getDefName
();
if
(
defName
&&
defName
.
isTable
)
{
if
(
defName
&&
defName
.
isTable
)
{
//need assemble becase source formula wrong
//need assemble becase source formula wrong
...
@@ -5267,6 +5269,7 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
...
@@ -5267,6 +5269,7 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
this
.
wb
.
dependencyFormulas
.
startListeningRange
(
ref
.
getWsId
(),
bbox
,
this
);
this
.
wb
.
dependencyFormulas
.
startListeningRange
(
ref
.
getWsId
(),
bbox
,
this
);
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
())
{
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
())
{
wsR
=
ref
.
range
(
ref
.
wsRange
());
wsR
=
ref
.
range
(
ref
.
wsRange
());
ref
.
dependenceRange
=
wsR
;
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
var
range
=
wsR
[
j
];
var
range
=
wsR
[
j
];
if
(
range
)
{
if
(
range
)
{
...
@@ -5327,8 +5330,8 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
...
@@ -5327,8 +5330,8 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
bbox
.
setOffsetLast
({
offsetRow
:
1
,
offsetCol
:
0
});
bbox
.
setOffsetLast
({
offsetRow
:
1
,
offsetCol
:
0
});
}
}
this
.
wb
.
dependencyFormulas
.
endListeningRange
(
ref
.
getWsId
(),
bbox
,
this
);
this
.
wb
.
dependencyFormulas
.
endListeningRange
(
ref
.
getWsId
(),
bbox
,
this
);
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
())
{
}
else
if
(
cElementType
.
cellsRange3D
===
ref
.
type
&&
ref
.
isValid
()
&&
ref
.
dependenceRange
)
{
wsR
=
ref
.
range
(
ref
.
wsRange
())
;
wsR
=
ref
.
dependenceRange
;
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
var
range
=
wsR
[
j
];
var
range
=
wsR
[
j
];
if
(
range
)
{
if
(
range
)
{
...
...
cell/model/Workbook.js
View file @
591b909d
...
@@ -465,32 +465,24 @@
...
@@ -465,32 +465,24 @@
}
}
},
},
removeSheet
:
function
(
sheetId
,
tableNames
)
{
removeSheet
:
function
(
sheetId
,
tableNames
)
{
var
t
=
this
;
//cells
//cells
var
sheet
=
this
.
wb
.
getWorksheetById
(
sheetId
);
var
formulas
=
[];
var
range
=
sheet
.
getRange3
(
0
,
0
,
gc_nMaxRow0
,
gc_nMaxCol0
);
this
.
wb
.
getWorksheetById
(
sheetId
).
getAllFormulas
(
formulas
);
range
.
_setPropertyNoEmpty
(
null
,
null
,
function
(
cell
){
for
(
var
i
=
0
;
i
<
formulas
.
length
;
++
i
)
{
if
(
cell
.
formulaParsed
)
{
formulas
[
i
].
removeDependencies
();
cell
.
formulaParsed
.
removeDependencies
();
}
}
});
//defnames
//defnames
var
sheetContainerFrom
=
this
.
defNames
.
sheet
[
sheetId
];
this
.
_foreachDefNameSheet
(
sheetId
,
function
(
defName
){
if
(
sheetContainerFrom
)
{
if
(
!
defName
.
isTable
)
{
for
(
var
name
in
sheetContainerFrom
)
{
t
.
_removeDefName
(
sheetId
,
defName
.
name
,
AscCH
.
historyitem_Workbook_DefinedNamesChangeUndo
);
var
defNameOld
=
sheetContainerFrom
[
name
];
if
(
!
defNameOld
.
isTable
)
{
this
.
_removeDefName
(
sheetId
,
name
,
AscCH
.
historyitem_Workbook_DefinedNamesChangeUndo
);
}
}
}
});
}
//tables
//tables
var
tableNamesMap
=
{};
var
tableNamesMap
=
{};
for
(
var
i
=
0
;
i
<
tableNames
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
tableNames
.
length
;
++
i
)
{
var
tableName
=
tableNames
[
i
];
var
tableName
=
tableNames
[
i
];
var
defName
=
this
.
_delDefName
(
tableName
,
null
);
this
.
_removeDefName
(
null
,
tableName
,
null
);
if
(
defName
)
{
defName
.
removeDependencies
();
}
tableNamesMap
[
tableName
]
=
1
;
tableNamesMap
[
tableName
]
=
1
;
}
}
//dependence
//dependence
...
@@ -955,9 +947,11 @@
...
@@ -955,9 +947,11 @@
_removeDefName
:
function
(
sheetId
,
name
,
historyType
)
{
_removeDefName
:
function
(
sheetId
,
name
,
historyType
)
{
var
defName
=
this
.
_delDefName
(
name
,
sheetId
);
var
defName
=
this
.
_delDefName
(
name
,
sheetId
);
if
(
defName
)
{
if
(
defName
)
{
History
.
Create_NewPoint
();
if
(
null
!=
historyType
)
{
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoWorkbook
,
historyType
,
null
,
null
,
History
.
Create_NewPoint
();
new
UndoRedoData_FromTo
(
defName
.
getUndoDefName
(),
null
));
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoWorkbook
,
historyType
,
null
,
null
,
new
UndoRedoData_FromTo
(
defName
.
getUndoDefName
(),
null
));
}
defName
.
removeDependencies
();
defName
.
removeDependencies
();
this
.
addToChangedDefName
(
defName
);
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