Skip to content

Commit

Permalink
[se] Default direction
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaZotov committed Dec 4, 2024
1 parent bdf1d38 commit 47f402a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cell/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;




Expand Down
11 changes: 11 additions & 0 deletions cell/model/Workbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -5573,6 +5575,15 @@
this.oGoalSeek && this.oGoalSeek.step();
};

Workbook.prototype.setDefaultDirection = function(val) {
this.defaultDirection = val;
};
Workbook.prototype.getDefaultDirection = function() {
return this.defaultDirection;
};





//-------------------------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions cell/view/WorkbookView.js
Original file line number Diff line number Diff line change
Expand Up @@ -5992,6 +5992,11 @@
}
};

WorkbookView.prototype.setDefaultDirection = function(val) {
this.model.setDefaultDirection(val);
};


//временно добавляю сюда. в идеале - использовать общий класс из документов(или сделать базовый, от него наследоваться) - CDocumentSearch
function CDocumentSearchExcel(wb) {
this.wb = wb;
Expand Down

0 comments on commit 47f402a

Please sign in to comment.