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
ef93d280
Commit
ef93d280
authored
Apr 11, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #32043
cell editor crashes when edit formula on another sheet
parent
0f76dd3f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
+30
-9
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+11
-0
cell/view/CellEditorView.js
cell/view/CellEditorView.js
+3
-4
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+7
-5
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+9
-0
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
ef93d280
...
...
@@ -4883,6 +4883,17 @@ parserFormula.prototype.parseDiagramRef = function() {
return
res
;
};
parserFormula
.
prototype
.
getElementByPos
=
function
(
pos
)
{
var
curPos
=
0
;
for
(
var
i
=
0
;
i
<
this
.
f
.
length
;
++
i
)
{
curPos
+=
this
.
f
[
i
].
toString
().
length
;
if
(
curPos
>=
pos
)
{
return
this
.
f
[
i
];
}
}
return
null
;
};
function
parseNum
(
str
)
{
if
(
str
.
indexOf
(
"
x
"
)
>
-
1
||
str
==
""
||
str
.
match
(
/
\s
+/
))
//исключаем запись числа в 16-ричной форме из числа.
{
...
...
cell/view/CellEditorView.js
View file @
ef93d280
...
...
@@ -710,11 +710,10 @@
};
CellEditor
.
prototype
.
formulaIsOperator
=
function
()
{
var
elem
;
return
this
.
isFormula
()
&&
this
.
_formula
&&
(
this
.
_formula
.
f
.
length
>
0
&&
this
.
_formula
.
f
[
this
.
_formula
.
f
.
length
-
1
].
type
==
cElementType
.
operator
||
this
.
_formula
.
f
.
length
==
0
||
this
.
_formula
.
operand_expected
);
(
null
!==
(
elem
=
this
.
_formula
.
getElementByPos
(
this
.
cursorPos
-
1
))
&&
elem
.
type
===
cElementType
.
operator
||
null
===
elem
||
this
.
_formula
.
operand_expected
);
};
CellEditor
.
prototype
.
insertFormula
=
function
(
functionName
,
isDefName
)
{
...
...
cell/view/WorkbookView.js
View file @
ef93d280
...
...
@@ -507,11 +507,13 @@
self
.
getWorksheet
(
self
.
model
.
getWorksheetIndexByName
(
ws
)).
addFormulaRange
(
range
);
}
},
"
existedRange
"
:
function
(
range
,
ws
)
{
if
(
!
ws
)
{
self
.
getWorksheet
().
activeFormulaRange
(
range
);
}
else
{
self
.
getWorksheet
(
self
.
model
.
getWorksheetIndexByName
(
ws
)).
activeFormulaRange
(
range
);
}
var
editRangeSheet
=
ws
?
self
.
model
.
getWorksheetIndexByName
(
ws
)
:
self
.
copyActiveSheet
;
if
(
-
1
===
editRangeSheet
||
editRangeSheet
===
self
.
wsActive
)
{
self
.
getWorksheet
().
activeFormulaRange
(
range
);
}
else
{
self
.
getWorksheet
(
editRangeSheet
).
removeFormulaRange
(
range
);
self
.
getWorksheet
().
addFormulaRange
(
range
);
}
},
"
updateUndoRedoChanged
"
:
function
(
bCanUndo
,
bCanRedo
)
{
self
.
handlers
.
trigger
(
"
asc_onCanUndoChanged
"
,
bCanUndo
);
self
.
handlers
.
trigger
(
"
asc_onCanRedoChanged
"
,
bCanRedo
);
...
...
cell/view/WorksheetView.js
View file @
ef93d280
...
...
@@ -11703,6 +11703,15 @@
}
}
};
WorksheetView
.
prototype
.
removeFormulaRange
=
function
(
range
)
{
this
.
arrActiveFormulaRangesPosition
=
-
1
;
for
(
var
i
=
0
;
i
<
this
.
arrActiveFormulaRanges
.
length
;
++
i
)
{
if
(
this
.
arrActiveFormulaRanges
[
i
].
isEqual
(
range
))
{
this
.
arrActiveFormulaRanges
.
splice
(
i
,
1
);
return
;
}
}
};
WorksheetView
.
prototype
.
cleanFormulaRanges
=
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