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
082674b0
Commit
082674b0
authored
Aug 01, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lookupandreference unused, remove read calcchain, defnames changes
parent
277b65fc
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
356 additions
and
737 deletions
+356
-737
cell/model/FormulaObjects/lookupandreferenceFunctions.js
cell/model/FormulaObjects/lookupandreferenceFunctions.js
+0
-63
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+133
-227
cell/model/History.js
cell/model/History.js
+1
-4
cell/model/Serialize.js
cell/model/Serialize.js
+3
-3
cell/model/UndoRedo.js
cell/model/UndoRedo.js
+20
-71
cell/model/Workbook.js
cell/model/Workbook.js
+194
-368
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+2
-0
common/commonDefines.js
common/commonDefines.js
+3
-1
No files found.
cell/model/FormulaObjects/lookupandreferenceFunctions.js
View file @
082674b0
...
...
@@ -636,37 +636,6 @@
found_operand
=
found_operand
.
toRef
();
}
var
cellName
=
r1
.
getFirst
().
getID
(),
wsId
=
r1
.
worksheet
.
getId
();
if
((
cElementType
.
cell
===
found_operand
.
type
||
cElementType
.
cell3D
===
found_operand
.
type
||
cElementType
.
cellsRange
===
found_operand
.
type
)
&&
found_operand
.
isValid
())
{
var
nFrom
,
nTo
;
if
(
r2
)
{
nFrom
=
r2
.
defName
;
}
else
{
nFrom
=
wb
.
dependencyFormulas
.
addNode
(
wsId
,
cellName
);
}
nTo
=
wb
.
dependencyFormulas
.
addNode
(
found_operand
.
getWsId
(),
found_operand
.
_cells
);
found_operand
.
setNode
(
nTo
);
wb
.
dependencyFormulas
.
addEdge2
(
nFrom
,
nTo
);
}
else
if
(
cElementType
.
cellsRange3D
===
found_operand
.
type
&&
found_operand
.
isValid
())
{
var
wsR
=
found_operand
.
wsRange
(),
nTo
,
_cell
=
found_operand
.
_cells
.
replace
(
/
\$
/g
,
""
);
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
if
(
r2
)
{
nTo
=
wb
.
dependencyFormulas
.
addNode
(
wsR
[
j
].
Id
,
_cell
);
wb
.
dependencyFormulas
.
addEdge2
(
r2
.
defName
,
nTo
);
}
else
{
wb
.
dependencyFormulas
.
addEdge
(
wsId
,
cellName
.
replace
(
/
\$
/g
,
""
),
wsR
[
j
].
Id
,
_cell
);
}
}
}
return
this
.
value
=
found_operand
;
}
...
...
@@ -1043,38 +1012,6 @@
this
.
value
=
new
cError
(
cErrorType
.
wrong_value_type
);
}
if
(
cElementType
.
cellsRange
===
this
.
value
.
type
||
cElementType
.
cell
===
this
.
value
.
type
||
cElementType
.
cell3D
===
this
.
value
.
type
||
cElementType
.
cellsRange3D
===
this
.
value
.
type
)
{
var
r1
=
arguments
[
1
],
r2
=
arguments
[
2
],
wb
=
r1
.
worksheet
.
workbook
,
cellName
=
r1
.
getFirst
()
.
getID
(),
wsId
=
r1
.
worksheet
.
getId
();
if
((
cElementType
.
cell
===
this
.
value
.
type
||
cElementType
.
cell3D
===
this
.
value
.
type
||
cElementType
.
cellsRange
===
this
.
value
.
type
)
&&
this
.
value
.
isValid
())
{
var
nFrom
,
nTo
;
if
(
r2
)
{
nFrom
=
r2
.
defName
;
}
else
{
nFrom
=
wb
.
dependencyFormulas
.
addNode
(
wsId
,
cellName
);
}
nTo
=
wb
.
dependencyFormulas
.
addNode
(
this
.
value
.
getWsId
(),
this
.
value
.
_cells
.
replace
(
/
\$
/g
,
""
));
this
.
value
.
setNode
(
nTo
);
wb
.
dependencyFormulas
.
addEdge2
(
nFrom
,
nTo
);
}
else
if
(
cElementType
.
cellsRange3D
===
this
.
value
.
type
&&
this
.
value
.
isValid
())
{
var
wsR
=
this
.
value
.
wsRange
(),
nTo
,
_cell
=
this
.
value
.
_cells
.
replace
(
/
\$
/g
,
""
);
for
(
var
j
=
0
;
j
<
wsR
.
length
;
j
++
)
{
if
(
r2
)
{
nTo
=
wb
.
dependencyFormulas
.
addNode
(
wsR
[
j
].
Id
,
_cell
);
wb
.
dependencyFormulas
.
addEdge2
(
r2
.
defName
,
nTo
);
}
else
{
wb
.
dependencyFormulas
.
addEdge
(
wsId
,
cellName
.
replace
(
/
\$
/g
,
""
),
wsR
[
j
].
Id
,
_cell
);
}
}
}
}
return
this
.
value
;
};
...
...
cell/model/FormulaObjects/parserFormula.js
View file @
082674b0
This diff is collapsed.
Click to expand it.
cell/model/History.js
View file @
082674b0
...
...
@@ -48,10 +48,7 @@ function (window, undefined) {
window
[
'
AscCH
'
].
historyitem_Workbook_SheetPositions
=
4
;
window
[
'
AscCH
'
].
historyitem_Workbook_ChangeColorScheme
=
5
;
window
[
'
AscCH
'
].
historyitem_Workbook_AddFont
=
6
;
window
[
'
AscCH
'
].
historyitem_Workbook_DefinedNamesAdd
=
7
;
window
[
'
AscCH
'
].
historyitem_Workbook_DefinedNamesChange
=
8
;
window
[
'
AscCH
'
].
historyitem_Workbook_DefinedNamesDelete
=
9
;
window
[
'
AscCH
'
].
historyitem_Workbook_DefinedNamesChangeRef
=
10
;
window
[
'
AscCH
'
].
historyitem_Workbook_DefinedNamesChange
=
7
;
window
[
'
AscCH
'
].
historyitem_Worksheet_RemoveCell
=
1
;
window
[
'
AscCH
'
].
historyitem_Worksheet_RemoveRows
=
2
;
...
...
cell/model/Serialize.js
View file @
082674b0
...
...
@@ -7191,9 +7191,9 @@
case
c_oSerTableTypes
.
Worksheets
:
res
=
(
new
Binary_WorksheetTableReader
(
this
.
stream
,
wb
,
aSharedStrings
,
aCellXfs
,
aDxfs
,
oMediaArray
,
this
.
copyPasteObj
)).
Read
();
break
;
case
c_oSerTableTypes
.
CalcChain
:
res
=
(
new
Binary_CalcChainTableReader
(
this
.
stream
,
wb
.
calcChain
)).
Read
();
break
;
//
case c_oSerTableTypes.CalcChain:
//
res = (new Binary_CalcChainTableReader(this.stream, wb.calcChain)).Read();
//
break;
// case c_oSerTableTypes.Other:
// res = (new Binary_OtherTableReader(this.stream, oMediaArray)).Read();
// break;
...
...
cell/model/UndoRedo.js
View file @
082674b0
...
...
@@ -2962,76 +2962,25 @@ UndoRedoWorkbook.prototype = {
this
.
wb
.
theme
.
themeElements
.
clrScheme
=
Data
.
newVal
;
this
.
wb
.
oApi
.
asc_AfterChangeColorScheme
();
}
else
if
(
AscCH
.
historyitem_Workbook_DefinedNamesAdd
===
Type
){
if
(
bUndo
){
this
.
wb
.
delDefinesNames
(
Data
.
newName
,
true
);
this
.
wb
.
handlers
.
trigger
(
"
asc_onDelDefName
"
)
}
else
{
if
(
this
.
wb
.
bCollaborativeChanges
){
var
name
=
Data
.
newName
.
Name
,
lsID
=
this
.
wb
.
getWorksheet
(
Data
.
newName
.
LocalSheetId
);
lsID
===
null
||
lsID
===
undefined
?
null
:
lsID
=
this
.
wb
.
getWorksheet
(
Data
.
newName
.
LocalSheetId
).
getId
();
var
oConflictDefName
=
this
.
wb
.
getDefinesNames
(
name
,
lsID
);
if
(
oConflictDefName
)
oConflictDefName
.
renameDefNameToCollaborate
(
this
.
wb
.
getUniqueDefinedNameFrom
(
oConflictDefName
,
true
));
this
.
wb
.
handlers
.
trigger
(
"
asc_onLockDefNameManager
"
,
Asc
.
c_oAscDefinedNameReason
.
OK
);
}
this
.
wb
.
editDefinesNames
(
null
,
Data
.
newName
,
true
);
this
.
wb
.
handlers
.
trigger
(
"
asc_onEditDefName
"
,
null
,
Data
.
newName
);
}
/*TODO
* Ввели формулу в которой есть именованный диапазон, но ИД нет в списке ИД. Результат формулы #NAME!.
* Создаем ИД с таким же именем, что и в функции. Необходимо пересчитать функцию. Предварительно перестроив
* граф зависимостей.
* */
}
else
if
(
AscCH
.
historyitem_Workbook_DefinedNamesChange
===
Type
){
else
if
(
AscCH
.
historyitem_Workbook_DefinedNamesChange
===
Type
)
{
var
oldName
,
newName
;
if
(
bUndo
)
{
if
(
bUndo
)
{
oldName
=
Data
.
newName
;
newName
=
Data
.
oldName
;
}
else
{
if
(
this
.
wb
.
bCollaborativeChanges
){
var
name
=
Data
.
newName
.
Name
,
lsID
=
this
.
wb
.
getWorksheet
(
Data
.
newName
.
LocalSheetId
);
lsID
===
null
||
lsID
===
undefined
?
null
:
lsID
=
this
.
wb
.
getWorksheet
(
Data
.
newName
.
LocalSheetId
).
getId
();
// if( this.wb.isDefinedNamesExists(name,lsID) ){
// var oConflictDefName = this.wb.getDefinesNames(name,lsID);
// if(oConflictDefName)
// oConflictDefName.renameDefNameToCollaborate(this.wb.getUniqueDefinedNameFrom(oConflictDefName, true));
// }
this
.
wb
.
handlers
.
trigger
(
"
asc_onLockDefNameManager
"
,
Asc
.
c_oAscDefinedNameReason
.
OK
);
newName
=
Data
.
oldName
;
}
else
{
if
(
this
.
wb
.
bCollaborativeChanges
)
{
this
.
wb
.
handlers
.
trigger
(
"
asc_onLockDefNameManager
"
,
Asc
.
c_oAscDefinedNameReason
.
OK
);
}
oldName
=
Data
.
oldName
;
newName
=
Data
.
newName
;
}
this
.
wb
.
editDefinesNames
(
oldName
,
newName
,
true
);
if
(
null
==
newName
)
{
this
.
wb
.
delDefinesNames
(
oldName
);
this
.
wb
.
handlers
.
trigger
(
"
asc_onDelDefName
"
)
}
else
{
this
.
wb
.
editDefinesNames
(
oldName
,
newName
);
this
.
wb
.
handlers
.
trigger
(
"
asc_onEditDefName
"
,
oldName
,
newName
);
}
else
if
(
AscCH
.
historyitem_Workbook_DefinedNamesDelete
===
Type
){
if
(
bUndo
){
this
.
wb
.
editDefinesNames
(
null
,
Data
,
true
);
if
(
Data
.
slaveEdge
){
var
n
;
for
(
var
i
=
0
;
i
<
Data
.
slaveEdge
.
length
;
i
++
){
n
=
this
.
wb
.
dependencyFormulas
.
getNode3
(
Data
.
slaveEdge
[
i
]);
if
(
n
){
this
.
wb
.
needRecalc
.
nodes
[
n
.
nodeId
]
=
[
n
.
sheetId
,
n
.
cellId
];
this
.
wb
.
needRecalc
.
length
++
;
n
=
n
.
returnCell
();
if
(
n
){
n
.
formulaParsed
=
new
AscCommonExcel
.
parserFormula
(
n
.
formulaParsed
.
Formula
,
n
.
formulaParsed
.
cellId
,
n
.
formulaParsed
.
ws
)
}
}
}
}
this
.
wb
.
handlers
.
trigger
(
"
asc_onEditDefName
"
,
null
,
Data
);
}
else
{
this
.
wb
.
delDefinesNames
(
Data
,
true
);
}
}
}
};
...
...
cell/model/Workbook.js
View file @
082674b0
This diff is collapsed.
Click to expand it.
cell/view/WorksheetView.js
View file @
082674b0
...
...
@@ -5427,6 +5427,8 @@
};
WorksheetView
.
prototype
.
prepareDepCells
=
function
(
se
)
{
//todo
return
;
var
activeCell
=
this
.
activeRange
,
mc
=
this
.
model
.
getMergedByCell
(
activeCell
.
startRow
,
activeCell
.
startCol
),
c1
=
mc
?
mc
.
c1
:
activeCell
.
startCol
,
r1
=
mc
?
mc
.
r1
:
activeCell
.
startRow
,
c
=
this
.
_getVisibleCell
(
c1
,
r1
),
nodes
=
(
se
==
AscCommonExcel
.
c_oAscDrawDepOptions
.
Master
)
?
this
.
model
.
workbook
.
dependencyFormulas
.
getMasterNodes
(
this
.
model
.
getId
(),
c
.
getName
()
)
:
this
.
model
.
workbook
.
dependencyFormulas
.
getSlaveNodes
(
this
.
model
.
getId
(),
c
.
getName
()
);
if
(
!
nodes
)
{
...
...
common/commonDefines.js
View file @
082674b0
...
...
@@ -816,7 +816,9 @@ var c_oAscPrintDefaultSettings = {
Shift
:
1
,
Move
:
2
,
Delete
:
3
,
ChangeDefName
:
4
ChangeDefName
:
4
,
Rebuild
:
5
,
ChangeSheet
:
6
};
var
c_oDashType
=
{
...
...
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