Commit 8ba0c549 authored by Alexander.Trofimov's avatar Alexander.Trofimov

delete asc_ActiveRange

parent 3aa0ad5e
...@@ -796,59 +796,59 @@ ...@@ -796,59 +796,59 @@
getAddFormatTableOptions: function(activeCells, userRange) getAddFormatTableOptions: function(activeCells, userRange)
{ {
var res; var res;
if(userRange) if(userRange)
{ {
activeCells = AscCommonExcel.g_oRangeCache.getAscRange(userRange); activeCells = AscCommonExcel.g_oRangeCache.getAscRange(userRange);
} }
//данная функция возвращает false в двух случаях - при смене стиля ф/т или при поптыке добавить ф/т к части а/ф //данная функция возвращает false в двух случаях - при смене стиля ф/т или при поптыке добавить ф/т к части а/ф
//TODO переделать взаимодействие с меню. если находимся внутри ф/т - вызывать сразу из меню смену стиля ф/т. //TODO переделать взаимодействие с меню. если находимся внутри ф/т - вызывать сразу из меню смену стиля ф/т.
//для проверки возможности добавить ф/т - попробовать использовать parserHelper.checkDataRange //для проверки возможности добавить ф/т - попробовать использовать parserHelper.checkDataRange
var bIsInFilter = this._searchRangeInFilters(activeCells); var bIsInFilter = this._searchRangeInFilters(activeCells);
var addRange; var addRange;
if(false === bIsInFilter) if(false === bIsInFilter)
{ {
bIsInFilter = null; bIsInFilter = null;
} }
if(null === bIsInFilter) if(null === bIsInFilter)
{ {
if(activeCells.r1 == activeCells.r2 && activeCells.c1 == activeCells.c2)//если ячейка выделенная одна if(activeCells.r1 == activeCells.r2 && activeCells.c1 == activeCells.c2)//если ячейка выделенная одна
{ {
addRange = this._getAdjacentCellsAF(activeCells); addRange = this._getAdjacentCellsAF(activeCells);
} }
else else
{ {
addRange = activeCells; addRange = activeCells;
} }
} }
else//range внутри а/ф или ф/т else//range внутри а/ф или ф/т
{ {
if(bIsInFilter.isAutoFilter()) if(bIsInFilter.isAutoFilter())
{ {
addRange = bIsInFilter.Ref; addRange = bIsInFilter.Ref;
} }
else else
{ {
res = false; res = false;
} }
} }
if(false !== res) if(false !== res)
{ {
res = new AddFormatTableOptions(); res = new AddFormatTableOptions();
var bIsTitle = this._isAddNameColumn(addRange); var bIsTitle = this._isAddNameColumn(addRange);
var range = addRange.clone(); var range = addRange.clone();
addRange.setAbs(true, true, true, true); addRange.setAbs(true, true, true, true);
res.asc_setIsTitle(bIsTitle); res.asc_setIsTitle(bIsTitle);
res.asc_setRange(range.getName()); res.asc_setRange(range.getName());
} }
return res; return res;
}, },
...@@ -1206,7 +1206,7 @@ ...@@ -1206,7 +1206,7 @@
{ {
var worksheet = this.worksheet; var worksheet = this.worksheet;
var t = this, selectedTableParts; var t = this, selectedTableParts;
//if first row AF in ActiveRange - delete AF //if first row AF in Range - delete AF
if(worksheet.AutoFilter && worksheet.AutoFilter.Ref && range.containsFirstLineRange(worksheet.AutoFilter.Ref)) if(worksheet.AutoFilter && worksheet.AutoFilter.Ref && range.containsFirstLineRange(worksheet.AutoFilter.Ref))
this.isEmptyAutoFilters(worksheet.AutoFilter.Ref); this.isEmptyAutoFilters(worksheet.AutoFilter.Ref);
else else
...@@ -4468,39 +4468,39 @@ ...@@ -4468,39 +4468,39 @@
return result; return result;
}, },
_searchRangeInFilters: function(range)//find filters in this range _searchRangeInFilters: function(range)//find filters in this range
{ {
var result = null; var result = null;
var worksheet = this.worksheet; var worksheet = this.worksheet;
if(worksheet.AutoFilter) if(worksheet.AutoFilter)
{ {
if(worksheet.AutoFilter.Ref.containsRange(range)) if(worksheet.AutoFilter.Ref.containsRange(range))
{ {
result = worksheet.AutoFilter; result = worksheet.AutoFilter;
} }
else if(worksheet.AutoFilter.Ref.intersection(range)) else if(worksheet.AutoFilter.Ref.intersection(range))
{ {
result = false; result = false;
} }
} }
if(worksheet.TableParts && null === result) if(worksheet.TableParts && null === result)
{ {
for(var i = 0; i < worksheet.TableParts.length; i++) for(var i = 0; i < worksheet.TableParts.length; i++)
{ {
if(worksheet.TableParts[i]) if(worksheet.TableParts[i])
{ {
if(worksheet.TableParts[i].Ref.containsRange(range)) if(worksheet.TableParts[i].Ref.containsRange(range))
{ {
result = worksheet.TableParts[i]; result = worksheet.TableParts[i];
break; break;
} }
} }
} }
} }
return result; return result;
}, },
//TODO пересмотреть! //TODO пересмотреть!
......
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
var asc_incDecFonSize = asc.incDecFonSize; var asc_incDecFonSize = asc.incDecFonSize;
var asc_debug = asc.outputDebugStr; var asc_debug = asc.outputDebugStr;
var asc_Range = asc.Range; var asc_Range = asc.Range;
var asc_ActiveRange = AscCommonExcel.ActiveRange;
var asc_CMM = AscCommonExcel.asc_CMouseMoveData; var asc_CMM = AscCommonExcel.asc_CMouseMoveData;
var asc_VR = AscCommonExcel.VisibleRange; var asc_VR = AscCommonExcel.VisibleRange;
...@@ -6680,7 +6679,7 @@ ...@@ -6680,7 +6679,7 @@
}; };
/** /**
* @param {ActiveRange} [range] * @param {Range} [range]
* @returns {{deltaX: number, deltaY: number}} * @returns {{deltaX: number, deltaY: number}}
*/ */
WorksheetView.prototype._calcActiveCellOffset = function (range) { WorksheetView.prototype._calcActiveCellOffset = function (range) {
...@@ -7282,23 +7281,21 @@ ...@@ -7282,23 +7281,21 @@
}; };
WorksheetView.prototype.setSelectionUndoRedo = function (range, validRange) { WorksheetView.prototype.setSelectionUndoRedo = function (range, validRange) {
var ar = (range instanceof asc_ActiveRange) ? range.clone() : new asc_ActiveRange(range);
// Проверка на валидность range. // Проверка на валидность range.
if (validRange && (ar.c2 >= this.nColsCount || ar.r2 >= this.nRowsCount)) { if (validRange && (range.c2 >= this.nColsCount || range.r2 >= this.nRowsCount)) {
if (ar.c2 >= this.nColsCount) { if (range.c2 >= this.nColsCount) {
this.expandColsOnScroll(false, true, ar.c2 + 1); this.expandColsOnScroll(false, true, range.c2 + 1);
} }
if (ar.r2 >= this.nRowsCount) { if (range.r2 >= this.nRowsCount) {
this.expandRowsOnScroll(false, true, ar.r2 + 1); this.expandRowsOnScroll(false, true, range.r2 + 1);
} }
} }
var oRes = null; var oRes = null;
var type = ar.type; var type = range.type;
if (type == c_oAscSelectionType.RangeCells || type == c_oAscSelectionType.RangeCol || if (type == c_oAscSelectionType.RangeCells || type == c_oAscSelectionType.RangeCol ||
type == c_oAscSelectionType.RangeRow || type == c_oAscSelectionType.RangeMax) { type == c_oAscSelectionType.RangeRow || type == c_oAscSelectionType.RangeMax) {
this.cleanSelection(); this.cleanSelection();
this.model.selectionRange.assign2(ar); this.model.selectionRange.assign2(range);
this._drawSelection(); this._drawSelection();
this._updateSelectionNameAndInfo(); this._updateSelectionNameAndInfo();
......
...@@ -1835,7 +1835,7 @@ function DrawingObjects() { ...@@ -1835,7 +1835,7 @@ function DrawingObjects() {
} }
} }
} }
return new AscCommonExcel.ActiveRange(cmin, rmin, cmax, rmax, true); return new Asc.Range(cmin, rmin, cmax, rmax, true);
}; };
_this.recalculate = function(all) _this.recalculate = function(all)
......
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