Commit 2161baeb authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33457

parent e560abee
...@@ -1356,21 +1356,23 @@ var editor; ...@@ -1356,21 +1356,23 @@ var editor;
}; };
// End Load document // End Load document
spreadsheet_api.prototype._openDocumentEndCallback = function() { spreadsheet_api.prototype._openDocumentEndCallback = function () {
// Не инициализируем дважды // Не инициализируем дважды
if (this.DocumentLoadComplete) { if (this.DocumentLoadComplete) {
return; return;
} }
this.wb = new AscCommonExcel.WorkbookView(this.wbModel, this.controller, this.handlers, this.HtmlElement, this.topLineEditorElement, this, this.collaborativeEditing, this.fontRenderingMode); this.wb = new AscCommonExcel.WorkbookView(this.wbModel, this.controller, this.handlers, this.HtmlElement,
this.topLineEditorElement, this, this.collaborativeEditing, this.fontRenderingMode);
if (this.isMobileVersion) { if (this.isMobileVersion) {
this.wb.defaults.worksheetView.halfSelection = true; this.wb.defaults.worksheetView.halfSelection = true;
this.wb.defaults.worksheetView.activeCellBorderColor = new CColor(79, 158, 79); this.wb.defaults.worksheetView.activeCellBorderColor = new CColor(79, 158, 79);
var _container = document.getElementById(this.HtmlElementName); var _container = document.getElementById(this.HtmlElementName);
if (_container) if (_container) {
_container.style.overflow = "hidden"; _container.style.overflow = "hidden";
this.wb.MobileTouchManager = new AscCommonExcel.CMobileTouchManager({ eventsElement : "cell_mobile_element" }); }
this.wb.MobileTouchManager = new AscCommonExcel.CMobileTouchManager({eventsElement: "cell_mobile_element"});
this.wb.MobileTouchManager.Init(this); this.wb.MobileTouchManager.Init(this);
// input context must be created!!! // input context must be created!!!
...@@ -1410,9 +1412,18 @@ var editor; ...@@ -1410,9 +1412,18 @@ var editor;
}; };
// Переход на диапазон в листе // Переход на диапазон в листе
spreadsheet_api.prototype._asc_setWorksheetRange = function(val) { spreadsheet_api.prototype._asc_setWorksheetRange = function (val) {
// Получаем sheet по имени // Получаем sheet по имени
var ws = this.wbModel.getWorksheetByName(val.asc_getSheet()); var ranges = null, ws;
var sheet = val.asc_getSheet();
if (!sheet) {
ranges = AscCommonExcel.getRangeByRef(val.asc_getLocation(), this.wbModel.getActiveWs(), true);
if (ranges = ranges[0]) {
ws = ranges.worksheet;
}
} else {
ws = this.wbModel.getWorksheetByName(sheet);
}
if (!ws) { if (!ws) {
this.handlers.trigger("asc_onHyperlinkClick", null); this.handlers.trigger("asc_onHyperlinkClick", null);
return; return;
...@@ -1428,10 +1439,16 @@ var editor; ...@@ -1428,10 +1439,16 @@ var editor;
// Посылаем эвент о смене активного листа // Посылаем эвент о смене активного листа
this.handlers.trigger("asc_onActiveSheetChanged", sheetIndex); this.handlers.trigger("asc_onActiveSheetChanged", sheetIndex);
} }
var range = ws.getRange2(val.asc_getRange()); var range;
if (null !== range) { if (ranges) {
this.wb._onSetSelection(range.getBBox0(), /*validRange*/ true); range = ranges.bbox;
} else {
range = ws.getRange2(val.asc_getRange());
if (range) {
range = range.getBBox0();
}
} }
this.wb._onSetSelection(range, /*validRange*/ true);
}; };
spreadsheet_api.prototype.onSaveCallback = function(e) { spreadsheet_api.prototype.onSaveCallback = function(e) {
......
...@@ -2356,7 +2356,7 @@ Hyperlink.prototype = { ...@@ -2356,7 +2356,7 @@ Hyperlink.prototype = {
this.Location = Location; this.Location = Location;
this.LocationSheet = this.LocationRange = null; this.LocationSheet = this.LocationRange = null;
if (null != this.Location) { if (null !== this.Location) {
var result = parserHelp.parse3DRef(this.Location); var result = parserHelp.parse3DRef(this.Location);
if (null !== result) { if (null !== result) {
this.LocationSheet = result.sheet; this.LocationSheet = result.sheet;
......
...@@ -7296,8 +7296,8 @@ ...@@ -7296,8 +7296,8 @@
} }
var oRes = null; var oRes = null;
var type = range.type; var type = range.type;
if (type == c_oAscSelectionType.RangeCells || type == c_oAscSelectionType.RangeCol || if (type === c_oAscSelectionType.RangeCells || type === c_oAscSelectionType.RangeCol ||
type == c_oAscSelectionType.RangeRow || type == c_oAscSelectionType.RangeMax) { type === c_oAscSelectionType.RangeRow || type === c_oAscSelectionType.RangeMax) {
this.cleanSelection(); this.cleanSelection();
this.model.selectionRange.assign2(range); this.model.selectionRange.assign2(range);
this._fixSelectionOfMergedCells(); this._fixSelectionOfMergedCells();
...@@ -11250,9 +11250,8 @@ ...@@ -11250,9 +11250,8 @@
// ToDo multiselect defined names // ToDo multiselect defined names
var selectionLast = this.model.selectionRange.getLast(); var selectionLast = this.model.selectionRange.getLast();
mc = selectionLast.isOneCell() ? this.model.getMergedByCell(selectionLast.r1, selectionLast.c1) : null; mc = selectionLast.isOneCell() ? this.model.getMergedByCell(selectionLast.r1, selectionLast.c1) : null;
var defName = this.model.workbook.editDefinesNames(null, var defName = this.model.workbook.editDefinesNames(null, new Asc.asc_CDefName(reference,
new Asc.asc_CDefName(reference, parserHelp.get3DRef(this.model.getName(), parserHelp.get3DRef(this.model.getName(), (mc || selectionLast).getAbsName())));
(mc || selectionLast).getAbsName())));
if (defName) { if (defName) {
this._isLockedDefNames(null, defName.getNodeId()); this._isLockedDefNames(null, defName.getNodeId());
......
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