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

Добавил функцию getAllRange для получения полного диапазона (если выделена колонка, например).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55551 954022d7-b5bf-4e40-9824-e11837661b57
parent 47844b04
......@@ -293,8 +293,7 @@
this.r2 = 0;
},
getName : function()
{
getName : function() {
var sRes;
if(0 == this.c1 && gc_nMaxCol0 == this.c2)
sRes = (this.r1 + 1) + ":" + (this.r2 + 1);
......@@ -308,8 +307,21 @@
sRes = g_oCellAddressUtils.colnumToColstr(this.c1 + 1) + (this.r1 + 1) + ":" + g_oCellAddressUtils.colnumToColstr(this.c2 + 1) + (this.r2 + 1);
}
return sRes;
}
},
getAllRange: function () {
var result;
if (c_oAscSelectionType.RangeMax === this.type)
result = new Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
else if (c_oAscSelectionType.RangeCol === this.type)
result = new Range(this.c1, 0, this.c2, gc_nMaxRow0);
else if (c_oAscSelectionType.RangeRow === this.type)
result = new Range(0, this.r1, gc_nMaxCol0, this.r2);
else
result = this.clone();
return result;
}
};
function ActiveRange(){
......
......@@ -6675,12 +6675,14 @@
WorksheetView.prototype.applyFormatPainter = function () {
var t = this;
var onApplyMoveRangeHandleCallback = function (isSuccess) {
var from = t.copyOfActiveRange.getAllRange(), to = t.activeRange.getAllRange();
var onApplyFormatPainterCallback = function (isSuccess) {
// Очищаем выделение
t.cleanSelection();
if (true === isSuccess)
t._getRange(0, 0, 0, 0).promoteFromTo(t.copyOfActiveRange, t.activeRange);
t._getRange(0, 0, 0, 0).promoteFromTo(from, to);
// Сбрасываем параметры
t._updateCellsRange(t.activeRange, /*canChangeColWidth*/c_oAscCanChangeColWidth.none, /*lockDraw*/true);
......@@ -6689,7 +6691,7 @@
t.draw();
};
this._isLockedCells (this.activeRange, null, onApplyMoveRangeHandleCallback);
this._isLockedCells (to, null, onApplyFormatPainterCallback);
};
WorksheetView.prototype.formatPainter = function () {
this.isFormatPainter = !this.isFormatPainter;
......@@ -7548,15 +7550,7 @@
if (onlyActive) {
checkRange = new asc_Range(arn.startCol, arn.startRow, arn.startCol, arn.startRow);
} else {
if (c_oAscSelectionType.RangeMax === arn.type) {
checkRange = new asc_Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
} else if (c_oAscSelectionType.RangeCol === arn.type) {
checkRange = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
} else if (c_oAscSelectionType.RangeRow === arn.type) {
checkRange = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
} else {
checkRange = arn;
}
checkRange = arn.getAllRange();
}
var onSelectionCallback = function (isSuccess) {
......@@ -9040,17 +9034,8 @@
return;
var t = this;
var checkRange = null;
var arn = t.activeRange.clone(true);
if (c_oAscSelectionType.RangeMax === arn.type) {
checkRange = new asc_Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
} else if (c_oAscSelectionType.RangeCol === arn.type) {
checkRange = new asc_Range(arn.c1, 0, arn.c2, gc_nMaxRow0);
} else if (c_oAscSelectionType.RangeRow === arn.type) {
checkRange = new asc_Range(0, arn.r1, gc_nMaxCol0, arn.r2);
} else {
checkRange = arn;
}
var checkRange = arn.getAllRange();
var range;
var fullRecalc = undefined;
......
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