Commit 4cedc046 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Ускорение для _fixSelectionOfMergedCells (правки selection с учетом...

Ускорение для _fixSelectionOfMergedCells (правки selection с учетом замерженных ячеек). Для этого перешли на функцию из модели.
http://bugzserver/show_bug.cgi?id=20388
http://bugzserver/show_bug.cgi?id=20535

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50161 954022d7-b5bf-4e40-9824-e11837661b57
parent bc49f57a
......@@ -4029,7 +4029,7 @@ Woorksheet.prototype.expandRangeByMerged = function(range){
}
}
return range;
}
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
......
......@@ -5294,29 +5294,14 @@
_fixSelectionOfMergedCells: function (fixedRange) {
var t = this;
function checkRange(range) {
// ToDo ускорить эту функцию через model (баг http://bugzserver/show_bug.cgi?id=20388)
var c, r, res;
for (r = range.r1; r <= range.r2 && r < t.nRowsCount; ++r) {
for (c = range.c1; c <= range.c2 && c < t.nColsCount; ++c) {
res = t._getMergedCellsRange(c, r);
if (res === undefined) {continue;}
res = range.union(res);
if ( !range.isEqual(res) ) {return checkRange(res);}
}
}
return range;
}
var ar = fixedRange ? fixedRange : ((this.isFormulaEditMode) ?
t.arrActiveFormulaRanges[t.arrActiveFormulaRanges.length - 1].clone(true) : t.activeRange);
if( !ar ) { return; }
if (!ar) { return; }
if (ar.type && ar.type !== c_oAscSelectionType.RangeCells) { return; }
var res = checkRange(ar.clone(true));
var res = this.model.expandRangeByMerged(ar.clone(true));
if (ar.c1 !== res.c1 && ar.c1 !== res.c2) {
ar.c1 = ar.c1 <= ar.c2 ? res.c1 : Math.min(res.c2, this.nColsCount - 1);
}
......
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