[PE] Fix Bug 46835

This commit is contained in:
Julia Radzhabova 2020-10-09 17:24:11 +03:00
parent 866c5af737
commit bfcffc756e
2 changed files with 13 additions and 8 deletions

View file

@ -689,6 +689,10 @@ define([
type == Asc.c_oAscTypeSelectElement.Shape && !pr.get_FromImage()) { type == Asc.c_oAscTypeSelectElement.Shape && !pr.get_FromImage()) {
no_text = false; no_text = false;
} }
if (type == Asc.c_oAscTypeSelectElement.Table ||
type == Asc.c_oAscTypeSelectElement.Shape && !pr.get_FromImage() && !pr.get_FromChart()) {
no_paragraph = false;
}
in_chart = type == Asc.c_oAscTypeSelectElement.Chart; in_chart = type == Asc.c_oAscTypeSelectElement.Chart;
} else if (type === Asc.c_oAscTypeSelectElement.Math) { } else if (type === Asc.c_oAscTypeSelectElement.Math) {
in_equation = true; in_equation = true;
@ -700,16 +704,17 @@ define([
this._state.in_chart = in_chart; this._state.in_chart = in_chart;
} }
if (paragraph_locked!==undefined && this._state.prcontrolsdisable !== paragraph_locked) { if (this._state.prcontrolsdisable !== paragraph_locked) {
if (this._state.activated) this._state.prcontrolsdisable = paragraph_locked; if (this._state.activated) this._state.prcontrolsdisable = paragraph_locked;
this.toolbar.lockToolbar(PE.enumLock.paragraphLock, paragraph_locked, {array: me.toolbar.paragraphControls.concat(me.toolbar.btnInsDateTime, me.toolbar.btnInsSlideNum)}); if (paragraph_locked!==undefined)
this.toolbar.lockToolbar(PE.enumLock.paragraphLock, paragraph_locked, {array: me.toolbar.paragraphControls});
this.toolbar.lockToolbar(PE.enumLock.paragraphLock, paragraph_locked===true, {array: [me.toolbar.btnInsDateTime, me.toolbar.btnInsSlideNum]});
} }
if (this._state.no_paragraph !== no_paragraph) { if (this._state.no_paragraph !== no_paragraph) {
if (this._state.activated) this._state.no_paragraph = no_paragraph; if (this._state.activated) this._state.no_paragraph = no_paragraph;
this.toolbar.lockToolbar(PE.enumLock.noParagraphSelected, no_paragraph, {array: me.toolbar.paragraphControls}); this.toolbar.lockToolbar(PE.enumLock.noParagraphSelected, no_paragraph, {array: me.toolbar.paragraphControls});
this.toolbar.lockToolbar(PE.enumLock.noParagraphSelected, no_paragraph, {array: [me.toolbar.btnCopyStyle]}); this.toolbar.lockToolbar(PE.enumLock.noParagraphSelected, no_paragraph, {array: [me.toolbar.btnCopyStyle]});
this.toolbar.lockToolbar(PE.enumLock.paragraphLock, !no_paragraph && this._state.prcontrolsdisable, {array: [me.toolbar.btnInsDateTime, me.toolbar.btnInsSlideNum]});
} }
if (this._state.no_text !== no_text) { if (this._state.no_text !== no_text) {

View file

@ -354,7 +354,7 @@ define([
id: 'id-toolbar-btn-markers', id: 'id-toolbar-btn-markers',
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-setmarkers', iconCls: 'toolbar__icon btn-setmarkers',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected], lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
enableToggle: true, enableToggle: true,
toggleGroup: 'markersGroup', toggleGroup: 'markersGroup',
split: true, split: true,
@ -366,7 +366,7 @@ define([
id: 'id-toolbar-btn-numbering', id: 'id-toolbar-btn-numbering',
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-numbering', iconCls: 'toolbar__icon btn-numbering',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected], lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
enableToggle: true, enableToggle: true,
toggleGroup: 'markersGroup', toggleGroup: 'markersGroup',
split: true, split: true,
@ -394,7 +394,7 @@ define([
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-align-left', iconCls: 'toolbar__icon btn-align-left',
icls: 'btn-align-left', icls: 'btn-align-left',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected], lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
items: [ items: [
{ {
@ -442,7 +442,7 @@ define([
me.btnVerticalAlign = new Common.UI.Button({ me.btnVerticalAlign = new Common.UI.Button({
id: 'id-toolbar-btn-valign', id: 'id-toolbar-btn-valign',
cls: 'btn-toolbar', cls: 'btn-toolbar',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.noObjectSelected], lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.noObjectSelected],
iconCls: 'toolbar__icon btn-align-middle', iconCls: 'toolbar__icon btn-align-middle',
icls: 'btn-align-middle', icls: 'btn-align-middle',
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
@ -500,7 +500,7 @@ define([
id: 'id-toolbar-btn-linespace', id: 'id-toolbar-btn-linespace',
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-linespace', iconCls: 'toolbar__icon btn-linespace',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected], lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected],
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
style: 'min-width: 60px;', style: 'min-width: 60px;',
items: [ items: [