Commit 5fac0445 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add method getCellCoord with params col and row

parent 73ef635b
...@@ -7544,20 +7544,23 @@ ...@@ -7544,20 +7544,23 @@
// Получаем координаты активной ячейки // Получаем координаты активной ячейки
WorksheetView.prototype.getActiveCellCoord = function () { WorksheetView.prototype.getActiveCellCoord = function () {
return this.getCellCoord(this.activeRange.startCol, this.activeRange.startRow);
};
WorksheetView.prototype.getCellCoord = function (col, row) {
var offsetX = 0, offsetY = 0; var offsetX = 0, offsetY = 0;
var vrCol = this.visibleRange.c1, vrRow = this.visibleRange.r1; var vrCol = this.visibleRange.c1, vrRow = this.visibleRange.r1;
if ( this.topLeftFrozenCell ) { if ( this.topLeftFrozenCell ) {
var offsetFrozen = this.getFrozenPaneOffset(); var offsetFrozen = this.getFrozenPaneOffset();
var cFrozen = this.topLeftFrozenCell.getCol0(); var cFrozen = this.topLeftFrozenCell.getCol0();
var rFrozen = this.topLeftFrozenCell.getRow0(); var rFrozen = this.topLeftFrozenCell.getRow0();
if ( this.activeRange.startCol >= cFrozen ) { if ( col >= cFrozen ) {
offsetX = offsetFrozen.offsetX; offsetX = offsetFrozen.offsetX;
} }
else { else {
vrCol = 0; vrCol = 0;
} }
if ( this.activeRange.startRow >= rFrozen ) { if ( row >= rFrozen ) {
offsetY = offsetFrozen.offsetY; offsetY = offsetFrozen.offsetY;
} }
else { else {
...@@ -7565,8 +7568,8 @@ ...@@ -7565,8 +7568,8 @@
} }
} }
var xL = this.getCellLeft( this.activeRange.startCol, /*pt*/1 ); var xL = this.getCellLeft( col, /*pt*/1 );
var yL = this.getCellTop( this.activeRange.startRow, /*pt*/1 ); var yL = this.getCellTop( row, /*pt*/1 );
// Пересчитываем X и Y относительно видимой области // Пересчитываем X и Y относительно видимой области
xL -= (this.cols[vrCol].left - this.cellsLeft); xL -= (this.cols[vrCol].left - this.cellsLeft);
yL -= (this.rows[vrRow].top - this.cellsTop); yL -= (this.rows[vrRow].top - this.cellsTop);
...@@ -7578,8 +7581,8 @@ ...@@ -7578,8 +7581,8 @@
xL *= asc_getcvt( 1/*pt*/, 0/*px*/, this._getPPIX() ); xL *= asc_getcvt( 1/*pt*/, 0/*px*/, this._getPPIX() );
yL *= asc_getcvt( 1/*pt*/, 0/*px*/, this._getPPIY() ); yL *= asc_getcvt( 1/*pt*/, 0/*px*/, this._getPPIY() );
var width = this.getColumnWidth( this.activeRange.startCol, /*px*/0 ); var width = this.getColumnWidth( col, /*px*/0 );
var height = this.getRowHeight( this.activeRange.startRow, /*px*/0 ); var height = this.getRowHeight( row, /*px*/0 );
if ( AscBrowser.isRetina ) { if ( AscBrowser.isRetina ) {
xL >>= 1; xL >>= 1;
...@@ -12836,9 +12839,9 @@ ...@@ -12836,9 +12839,9 @@
var rangeButton = Asc.Range(autoFilter.Ref.c1 + colId, autoFilter.Ref.r1, autoFilter.Ref.c1 + colId, autoFilter.Ref.r1); var rangeButton = Asc.Range(autoFilter.Ref.c1 + colId, autoFilter.Ref.r1, autoFilter.Ref.c1 + colId, autoFilter.Ref.r1);
var cellId = ws.autoFilters._rangeToId(rangeButton); var cellId = ws.autoFilters._rangeToId(rangeButton);
var posX = (this.cols[autoFilter.Ref.c1 + colId].left + this.cols[autoFilter.Ref.c1 + colId].width) / 0.75; var posX = (this.cols[autoFilter.Ref.c1 + colId].left + this.cols[autoFilter.Ref.c1 + colId].width) / 0.75;
var posY = (this.rows[autoFilter.Ref.r1].top + this.rows[autoFilter.Ref.r1].height) / 0.75; var posY = (this.rows[autoFilter.Ref.r1].top + this.rows[autoFilter.Ref.r1].height) / 0.75;
//get filter object //get filter object
var filterObj = new Asc.AutoFilterObj(); var filterObj = new Asc.AutoFilterObj();
...@@ -12923,8 +12926,8 @@ ...@@ -12923,8 +12926,8 @@
var autoFilterObject = new Asc.AutoFiltersOptions(); var autoFilterObject = new Asc.AutoFiltersOptions();
autoFilterObject.asc_setSortState(sortVal); autoFilterObject.asc_setSortState(sortVal);
autoFilterObject.asc_setCellPosX(posX); autoFilterObject.asc_setCellPosX(posX);
autoFilterObject.asc_setCellPosY(posY); autoFilterObject.asc_setCellPosY(posY);
autoFilterObject.asc_setCellId(cellId); autoFilterObject.asc_setCellId(cellId);
autoFilterObject.asc_setValues(values); autoFilterObject.asc_setValues(values);
autoFilterObject.asc_setFilterObj(filterObj); autoFilterObject.asc_setFilterObj(filterObj);
...@@ -13017,10 +13020,10 @@ ...@@ -13017,10 +13020,10 @@
//добавляем без цвета ячейку //добавляем без цвета ячейку
if(!cell) if(!cell)
{ {
if(true !== alreadyAddColors[null]) if(true !== alreadyAddColors[null])
{ {
alreadyAddColors[null] = true; alreadyAddColors[null] = true;
res.colors.push(null); res.colors.push(null);
} }
continue; continue;
} }
......
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