diff --git a/cell/api.js b/cell/api.js index 3daa0d6081..151f1d4ed4 100644 --- a/cell/api.js +++ b/cell/api.js @@ -3426,6 +3426,9 @@ var editor; } this.wbModel.setActive(where); this.wb.updateWorksheetByModel(); + if (this.wbModel.getDefaultDirection()) { + this.asc_setRightToLeft(true); + } this.wb.showWorksheet(); this.wbModel.dependencyFormulas.lockRecal(); History.EndTransaction(); @@ -4484,6 +4487,10 @@ var editor; this.wb.getWorksheet().changeSheetViewSettings(AscCH.historyitem_Worksheet_SetRightToLeft, value); }; + spreadsheet_api.prototype.asc_setDefaultDirection = function (value) { + this.wb.setDefaultDirection(value); + }; + spreadsheet_api.prototype.asc_getShowFormulas = function () { let ws = this.wb.getWorksheet(); return ws.model && ws.model.getShowFormulas(); @@ -9700,6 +9707,8 @@ var editor; prot["asc_setShowFormulas"] = prot.asc_setShowFormulas; prot["asc_getShowFormulas"] = prot.asc_getShowFormulas; prot["asc_setRightToLeft"] = prot.asc_setRightToLeft; + prot["asc_setDefaultDirection"] = prot.asc_setDefaultDirection; + diff --git a/cell/model/Workbook.js b/cell/model/Workbook.js index 3add05af70..2a1fe6294f 100644 --- a/cell/model/Workbook.js +++ b/cell/model/Workbook.js @@ -2967,6 +2967,8 @@ this.TimelineStyles = null; this.metadata = null; + //true - rightToLeft, false/null - leftToRight + this.defaultDirection = null; } Workbook.prototype.init=function(tableCustomFunc, tableIds, sheetIds, bNoBuildDep, bSnapshot){ if(this.nActive < 0) @@ -5573,6 +5575,15 @@ this.oGoalSeek && this.oGoalSeek.step(); }; + Workbook.prototype.setDefaultDirection = function(val) { + this.defaultDirection = val; + }; + Workbook.prototype.getDefaultDirection = function() { + return this.defaultDirection; + }; + + + //------------------------------------------------------------------------------------------------- diff --git a/cell/view/WorkbookView.js b/cell/view/WorkbookView.js index 699ecb8284..23c3692dcc 100644 --- a/cell/view/WorkbookView.js +++ b/cell/view/WorkbookView.js @@ -5992,6 +5992,11 @@ } }; + WorkbookView.prototype.setDefaultDirection = function(val) { + this.model.setDefaultDirection(val); + }; + + //временно добавляю сюда. в идеале - использовать общий класс из документов(или сделать базовый, от него наследоваться) - CDocumentSearch function CDocumentSearchExcel(wb) { this.wb = wb;