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

fix bug 33457

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