mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 10:59:28 +08:00
[SSE] Fix bug 56671
This commit is contained in:
@ -601,17 +601,17 @@ define([
|
||||
handler: function(dlg, result) {
|
||||
var opt;
|
||||
if (result == 'ok') {
|
||||
opt = dlg.getSettings().margins;
|
||||
Common.localStorage.setItem("sse-pgmargins-top", opt.asc_getTop());
|
||||
Common.localStorage.setItem("sse-pgmargins-left", opt.asc_getLeft());
|
||||
Common.localStorage.setItem("sse-pgmargins-bottom", opt.asc_getBottom());
|
||||
Common.localStorage.setItem("sse-pgmargins-right", opt.asc_getRight());
|
||||
Common.NotificationCenter.trigger('margins:update', opt, panel);
|
||||
me.setMargins(panel, opt);
|
||||
opt = dlg.getSettings();
|
||||
var margins = opt.margins;
|
||||
Common.localStorage.setItem("sse-pgmargins-top", margins.asc_getTop());
|
||||
Common.localStorage.setItem("sse-pgmargins-left", margins.asc_getLeft());
|
||||
Common.localStorage.setItem("sse-pgmargins-bottom", margins.asc_getBottom());
|
||||
Common.localStorage.setItem("sse-pgmargins-right", margins.asc_getRight());
|
||||
Common.NotificationCenter.trigger('margins:update', margins, panel);
|
||||
me.setMargins(panel, margins);
|
||||
var currentSheet = panel.cmbSheet.getValue();
|
||||
me._margins[currentSheet] = opt;
|
||||
me._margins[currentSheet] = margins;
|
||||
if (me._changedProps && me._changedProps[currentSheet]) {
|
||||
opt = dlg.getSettings();
|
||||
me._changedProps[currentSheet].asc_setVerticalCentered(opt.vertical);
|
||||
me._changedProps[currentSheet].asc_setHorizontalCentered(opt.horizontal);
|
||||
}
|
||||
|
||||
@ -4711,22 +4711,28 @@ define([
|
||||
if (this.api) {
|
||||
this._state.pgmargins = undefined;
|
||||
if (item.value !== 'advanced') {
|
||||
this.api.asc_changePageMargins(item.value[1], item.value[3], item.value[0], item.value[2], this.api.asc_getActiveWorksheetIndex());
|
||||
var props = new Asc.asc_CPageMargins();
|
||||
props.asc_setTop(item.value[0]);
|
||||
props.asc_setBottom(item.value[2]);
|
||||
props.asc_setLeft(item.value[1]);
|
||||
props.asc_setRight(item.value[3]);
|
||||
this.api.asc_changePageMargins(props, undefined, undefined, undefined, undefined, this.api.asc_getActiveWorksheetIndex());
|
||||
} else {
|
||||
var win, props,
|
||||
me = this;
|
||||
win = new SSE.Views.PageMarginsDialog({
|
||||
handler: function(dlg, result) {
|
||||
if (result == 'ok') {
|
||||
props = dlg.getSettings().margins;
|
||||
Common.localStorage.setItem("sse-pgmargins-top", props.asc_getTop());
|
||||
Common.localStorage.setItem("sse-pgmargins-left", props.asc_getLeft());
|
||||
Common.localStorage.setItem("sse-pgmargins-bottom", props.asc_getBottom());
|
||||
Common.localStorage.setItem("sse-pgmargins-right", props.asc_getRight());
|
||||
Common.NotificationCenter.trigger('margins:update', props);
|
||||
props = dlg.getSettings();
|
||||
var margins = props.margins;
|
||||
Common.localStorage.setItem("sse-pgmargins-top", margins.asc_getTop());
|
||||
Common.localStorage.setItem("sse-pgmargins-left", margins.asc_getLeft());
|
||||
Common.localStorage.setItem("sse-pgmargins-bottom", margins.asc_getBottom());
|
||||
Common.localStorage.setItem("sse-pgmargins-right", margins.asc_getRight());
|
||||
Common.NotificationCenter.trigger('margins:update', margins);
|
||||
me.toolbar.btnPageMargins.menu.items[0].setChecked(true);
|
||||
|
||||
me.api.asc_changePageMargins( props.asc_getLeft(), props.asc_getRight(), props.asc_getTop(), props.asc_getBottom(), me.api.asc_getActiveWorksheetIndex());
|
||||
me.api.asc_changePageMargins( margins, props.horizontal, props.vertical, undefined, undefined, me.api.asc_getActiveWorksheetIndex());
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,8 +259,6 @@ define([
|
||||
props.asc_setLeft(Common.Utils.Metric.fnRecalcToMM(this.spnLeft.getNumberValue()));
|
||||
props.asc_setRight(Common.Utils.Metric.fnRecalcToMM(this.spnRight.getNumberValue()));
|
||||
|
||||
// props.asc_setVerticalCentered(this.chVert.getValue()==='checked');
|
||||
// props.asc_setHorizontalCentered(this.chHor.getValue()==='checked');
|
||||
return {margins: props, vertical: this.chVert.getValue()==='checked', horizontal: this.chHor.getValue()==='checked'};
|
||||
},
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ class SpreadsheetSettingsController extends Component {
|
||||
case 'bottom': changeProps.asc_setBottom(marginValue); break;
|
||||
}
|
||||
|
||||
api.asc_changePageMargins(changeProps.asc_getLeft(), changeProps.asc_getRight(), changeProps.asc_getTop(), changeProps.asc_getBottom(), api.asc_getActiveWorksheetIndex());
|
||||
api.asc_changePageMargins(changeProps, undefined, undefined, undefined, undefined, api.asc_getActiveWorksheetIndex());
|
||||
}
|
||||
|
||||
onOrientationChange(value) {
|
||||
|
||||
Reference in New Issue
Block a user