Commit aa38ea12 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил падение при переходе по гиперссылке (баг...

Поправил падение при переходе по гиперссылке (баг http://bugzserver/show_bug.cgi?id=24149). Копировали Range вместо ActiveRange.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56095 954022d7-b5bf-4e40-9824-e11837661b57
parent d8ec47c9
......@@ -1856,7 +1856,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Переход на диапазон в листе
_asc_setWorksheetRange: function (val) {
// Получаем sheet по имени
var ws = this.wbModel.getWorksheetByName (val.asc_getSheet());
var ws = this.wbModel.getWorksheetByName(val.asc_getSheet());
if (!ws || ws.getHidden())
return;
// Индекс листа
......@@ -1868,9 +1868,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Посылаем эвент о смене активного листа
this.handlers.trigger ("asc_onActiveSheetChanged", sheetIndex);
}
var range = ws.getRange2 (val.asc_getRange());
var range = ws.getRange2(val.asc_getRange());
if (null !== range) {
this.wb._onSetSelection (range.getBBox0(), /*validRange*/ true);
this.wb._onSetSelection(range.getBBox0(), /*validRange*/ true);
}
},
......
......@@ -571,7 +571,6 @@
WorkbookView.prototype._onSetSelection = function (range, validRange) {
var ws = this.getWorksheet();
ws._checkSelectionShape();
ws.setActiveRangeObj(range);
var d = ws.setSelectionUndoRedo(range, validRange);
if (d) {
if (d.deltaX) {this.controller.scrollHorizontal(d.deltaX);}
......
......@@ -6427,9 +6427,6 @@
WorksheetView.prototype.getActiveRangeObj = function (){
return this.activeRange.clone(true);
};
WorksheetView.prototype.setActiveRangeObj = function (val){
this.activeRange = val.clone();
};
WorksheetView.prototype.setSelection = function (range, validRange) {
// Проверка на валидность range.
if (validRange && (range.c2 >= this.nColsCount || range.r2 >= this.nRowsCount)) {
......@@ -6470,21 +6467,20 @@
};
WorksheetView.prototype.setSelectionUndoRedo = function (range, validRange) {
var ar = this.activeRange = (range instanceof asc_ActiveRange) ? range.clone() : new asc_ActiveRange(range);
// Проверка на валидность range.
if (validRange && (range.c2 >= this.nColsCount || range.r2 >= this.nRowsCount)) {
if (range.c2 >= this.nColsCount)
this.expandColsOnScroll(false, true, range.c2 + 1);
if (range.r2 >= this.nRowsCount)
this.expandRowsOnScroll(false, true, range.r2 + 1);
if (validRange && (ar.c2 >= this.nColsCount || ar.r2 >= this.nRowsCount)) {
if (ar.c2 >= this.nColsCount)
this.expandColsOnScroll(false, true, ar.c2 + 1);
if (ar.r2 >= this.nRowsCount)
this.expandRowsOnScroll(false, true, ar.r2 + 1);
}
var oRes = null;
var type = this.activeRange.type;
if(type == c_oAscSelectionType.RangeCells || type == c_oAscSelectionType.RangeCol ||
type == c_oAscSelectionType.RangeRow || type == c_oAscSelectionType.RangeMax)
{
this.cleanSelection();
this._drawSelection();
if (type == c_oAscSelectionType.RangeCells || type == c_oAscSelectionType.RangeCol ||
type == c_oAscSelectionType.RangeRow || type == c_oAscSelectionType.RangeMax) {
this.updateSelection();
this.handlers.trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
this.handlers.trigger("selectionChanged", this.getSelectionInfo());
......
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