Commit 1aba1e83 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил проблему с A:A при вводе формулы (теперь парсинг в одном месте реализован)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56071 954022d7-b5bf-4e40-9824-e11837661b57
parent 85d34a8f
...@@ -665,32 +665,8 @@ ...@@ -665,32 +665,8 @@
}; };
CellEditor.prototype._parseRangeStr = function (s) { CellEditor.prototype._parseRangeStr = function (s) {
var p, range, ca1, ca2; var range = asc.g_oRangeCache.getActiveRange(s);
return range ? range.clone() : null;
p = s.replace(/\$/g, "").split(":");
if (p.length > 1) {
ca1 = new CellAddress(p[0]);
ca2 = new CellAddress(p[1]);
if (!ca1 || !ca1.isValid() || !ca2 || !ca2.isValid()) { return null; }
range = asc.Range(ca1.getCol0(), ca1.getRow0(), ca2.getCol0(), ca2.getRow0());
if (range.r2 === gc_nMaxRow0) { // range вида A:C
range.r1 = 0;
range.type = c_oAscSelectionType.RangeCol;
} else if (range.c2 === gc_nMaxCol0) { // range вида 1:5
range.c1 = 0;
range.type = c_oAscSelectionType.RangeRow;
} else { // range вида A1:C5
range.type = c_oAscSelectionType.RangeCells;
}
} else { // range вида A1
ca1 = new CellAddress(p[0]);
if (!ca1 || !ca1.isValid()) { return null; }
range = asc.Range(ca1.getCol0(), ca1.getRow0(), ca1.getCol0(), ca1.getRow0());
range.type = c_oAscSelectionType.RangeCells;
}
range.startCol = range.c1;
range.startRow = range.r1;
return range;
}; };
CellEditor.prototype._parseFormulaRanges = function () { CellEditor.prototype._parseFormulaRanges = function () {
...@@ -712,7 +688,7 @@ ...@@ -712,7 +688,7 @@
range = this._parseRangeStr(m[1]); range = this._parseRangeStr(m[1]);
if (range) { if (range) {
ret = true; ret = true;
if( m[1].indexOf("$") > -1 ){ if (m[1].indexOf("$") > -1) {
range.isAbsolute = m[1]; range.isAbsolute = m[1];
} }
range.cursorePos = m.input.indexOf(m[0])+1; range.cursorePos = m.input.indexOf(m[0])+1;
......
...@@ -10429,7 +10429,7 @@ ...@@ -10429,7 +10429,7 @@
editor.enterCellRange(s); editor.enterCellRange(s);
}; };
WorksheetView.prototype.changeCellRange = function (editor,range){ WorksheetView.prototype.changeCellRange = function (editor, range){
var s = this.getActiveRange(range); var s = this.getActiveRange(range);
if( range.isAbsolute ){ if( range.isAbsolute ){
var ra = range.isAbsolute.split(":"), _s; var ra = range.isAbsolute.split(":"), _s;
...@@ -10456,7 +10456,7 @@ ...@@ -10456,7 +10456,7 @@
}) })
} }
} }
editor.changeCellRange(range,s); editor.changeCellRange(range, s);
return true; return true;
}; };
......
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