Commit 9a02aa68 authored by Alexander.Trofimov's avatar Alexander.Trofimov

bug 33479

add support matrix values for some defined names
parent 82fc9b8f
...@@ -2951,7 +2951,7 @@ var cFormulaOperators = { ...@@ -2951,7 +2951,7 @@ var cFormulaOperators = {
} }
return list; return list;
} }
function getRangeByRef(ref, ws) { function getRangeByRef(ref, ws, onlyRanges) {
// ToDo in parser formula // ToDo in parser formula
if (ref[0] === '(') { if (ref[0] === '(') {
ref = ref.slice(1); ref = ref.slice(1);
...@@ -2970,25 +2970,38 @@ var cFormulaOperators = { ...@@ -2970,25 +2970,38 @@ var cFormulaOperators = {
} }
var _f = new AscCommonExcel.parserFormula(refItem, '', ws); var _f = new AscCommonExcel.parserFormula(refItem, '', ws);
_f.parse(); if (_f.parse()) {
_f.RefPos.forEach(function (item) { _f.RefPos.forEach(function (item) {
var ref; var ref;
switch (item.oper.type) { switch (item.oper.type) {
case cElementType.table: case cElementType.table:
case cElementType.name: case cElementType.name:
ref = item.oper.toRef(); ref = item.oper.toRef();
break; break;
case cElementType.cell: case cElementType.cell:
case cElementType.cell3D: case cElementType.cell3D:
case cElementType.cellsRange: case cElementType.cellsRange:
case cElementType.cellsRange3D: case cElementType.cellsRange3D:
ref = item.oper; ref = item.oper;
break; break;
} }
if (ref && cElementType.error !== ref.type) { if (ref) {
ranges.push(ref.getRange()); switch(ref.type) {
} case cElementType.cell:
}); case cElementType.cell3D:
case cElementType.cellsRange:
case cElementType.cellsRange3D:
ranges.push(ref.getRange());
break;
case cElementType.array:
if (!onlyRanges) {
ranges = ref.getMatrix();
}
break;
}
}
});
}
}); });
return ranges; return ranges;
} }
......
...@@ -10576,7 +10576,7 @@ ...@@ -10576,7 +10576,7 @@
}; };
WorksheetView.prototype.findCell = function (reference, isViewMode) { WorksheetView.prototype.findCell = function (reference, isViewMode) {
var mc, ranges = AscCommonExcel.getRangeByRef(reference, this.model); var mc, ranges = AscCommonExcel.getRangeByRef(reference, this.model, true);
if (0 === ranges.length && !isViewMode) { if (0 === ranges.length && !isViewMode) {
/*TODO: сделать поиск по названиям автофигур, должен искать до того как вызвать поиск по именованным диапазонам*/ /*TODO: сделать поиск по названиям автофигур, должен искать до того как вызвать поиск по именованным диапазонам*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment