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

delete asc_ActiveRange

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