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 = {
}
return list;
}
function getRangeByRef(ref, ws) {
function getRangeByRef(ref, ws, onlyRanges) {
// ToDo in parser formula
if (ref[0] === '(') {
ref = ref.slice(1);
......@@ -2970,25 +2970,38 @@ var cFormulaOperators = {
}
var _f = new AscCommonExcel.parserFormula(refItem, '', ws);
_f.parse();
_f.RefPos.forEach(function (item) {
var ref;
switch (item.oper.type) {
case cElementType.table:
case cElementType.name:
ref = item.oper.toRef();
break;
case cElementType.cell:
case cElementType.cell3D:
case cElementType.cellsRange:
case cElementType.cellsRange3D:
ref = item.oper;
break;
}
if (ref && cElementType.error !== ref.type) {
ranges.push(ref.getRange());
}
});
if (_f.parse()) {
_f.RefPos.forEach(function (item) {
var ref;
switch (item.oper.type) {
case cElementType.table:
case cElementType.name:
ref = item.oper.toRef();
break;
case cElementType.cell:
case cElementType.cell3D:
case cElementType.cellsRange:
case cElementType.cellsRange3D:
ref = item.oper;
break;
}
if (ref) {
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;
}
......
......@@ -10576,7 +10576,7 @@
};
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) {
/*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