Fix Bug 25918

This commit is contained in:
Julia Radzhabova 2019-02-19 15:47:50 +03:00
parent 050f82a8ab
commit e8bace41c2
3 changed files with 8 additions and 26 deletions

View file

@ -2648,18 +2648,12 @@ define([
onSetupCopyStyleButton: function () { onSetupCopyStyleButton: function () {
this.modeAlwaysSetStyle = false; this.modeAlwaysSetStyle = false;
var acsCopyFmtStyleState = {
kOff : 0,
kOn : 1,
kMultiple : 2
};
var me = this; var me = this;
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'edit:complete': function () { 'edit:complete': function () {
if (me.api && me.modeAlwaysSetStyle) { if (me.api && me.modeAlwaysSetStyle) {
me.api.SetPaintFormat(acsCopyFmtStyleState.kOff); me.api.SetPaintFormat(AscCommon.c_oAscFormatPainterState.kOff);
me.toolbar.btnCopyStyle.toggle(false, true); me.toolbar.btnCopyStyle.toggle(false, true);
me.modeAlwaysSetStyle = false; me.modeAlwaysSetStyle = false;
} }
@ -2670,7 +2664,7 @@ define([
if (me.api) { if (me.api) {
me.modeAlwaysSetStyle = true; me.modeAlwaysSetStyle = true;
me.toolbar.btnCopyStyle.toggle(true, true); me.toolbar.btnCopyStyle.toggle(true, true);
me.api.SetPaintFormat(acsCopyFmtStyleState.kMultiple); me.api.SetPaintFormat(AscCommon.c_oAscFormatPainterState.kMultiple);
} }
}); });
}, },

View file

@ -307,6 +307,8 @@ define([
toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this)); toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this));
toolbar.listTheme.on('click', _.bind(this.onListThemeSelect, this)); toolbar.listTheme.on('click', _.bind(this.onListThemeSelect, this));
toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
this.onSetupCopyStyleButton();
}, },
setApi: function(api) { setApi: function(api) {
@ -352,8 +354,6 @@ define([
this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onApiCountPages, this)); this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onApiCountPages, this));
this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this)); this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this));
this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this)); this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this));
this.onSetupCopyStyleButton();
}, },
onChangeCompactView: function(view, compact) { onChangeCompactView: function(view, compact) {
@ -1938,18 +1938,12 @@ define([
onSetupCopyStyleButton: function () { onSetupCopyStyleButton: function () {
this.modeAlwaysSetStyle = false; this.modeAlwaysSetStyle = false;
var acsCopyFmtStyleState = {
kOff : 0,
kOn : 1,
kMultiple : 2
};
var me = this; var me = this;
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'edit:complete': function () { 'edit:complete': function () {
if (me.api && me.modeAlwaysSetStyle) { if (me.api && me.modeAlwaysSetStyle) {
me.api.SetPaintFormat(acsCopyFmtStyleState.kOff); me.api.SetPaintFormat(AscCommon.c_oAscFormatPainterState.kOff);
me.toolbar.btnCopyStyle.toggle(false, true); me.toolbar.btnCopyStyle.toggle(false, true);
me.modeAlwaysSetStyle = false; me.modeAlwaysSetStyle = false;
} }
@ -1960,7 +1954,7 @@ define([
if (me.api) { if (me.api) {
me.modeAlwaysSetStyle = true; me.modeAlwaysSetStyle = true;
me.toolbar.btnCopyStyle.toggle(true, true); me.toolbar.btnCopyStyle.toggle(true, true);
me.api.SetPaintFormat(acsCopyFmtStyleState.kMultiple); me.api.SetPaintFormat(AscCommon.c_oAscFormatPainterState.kMultiple);
} }
}); });
}, },

View file

@ -2994,18 +2994,12 @@ define([
onSetupCopyStyleButton: function () { onSetupCopyStyleButton: function () {
this.modeAlwaysSetStyle = false; this.modeAlwaysSetStyle = false;
var acsCopyFmtStyleState = {
kOff : 0,
kOn : 1,
kMultiple : 2
};
var me = this; var me = this;
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'edit:complete': function () { 'edit:complete': function () {
if (me.api && me.modeAlwaysSetStyle) { if (me.api && me.modeAlwaysSetStyle) {
me.api.asc_formatPainter(acsCopyFmtStyleState.kOff); me.api.asc_formatPainter(AscCommon.c_oAscFormatPainterState.kOff);
me.toolbar.btnCopyStyle.toggle(false, true); me.toolbar.btnCopyStyle.toggle(false, true);
me.modeAlwaysSetStyle = false; me.modeAlwaysSetStyle = false;
} }
@ -3016,7 +3010,7 @@ define([
if (me.api) { if (me.api) {
me.modeAlwaysSetStyle = true; me.modeAlwaysSetStyle = true;
me.toolbar.btnCopyStyle.toggle(true, true); me.toolbar.btnCopyStyle.toggle(true, true);
me.api.asc_formatPainter(acsCopyFmtStyleState.kMultiple); me.api.asc_formatPainter(AscCommon.c_oAscFormatPainterState.kMultiple);
} }
}); });
}, },