[SSE] Move

Move asc_getSelectionType to cell info
This commit is contained in:
Alexander Trofimov 2020-05-14 11:39:04 +03:00
parent d497e4b761
commit a33df0aabe
16 changed files with 36 additions and 36 deletions

View file

@ -151,7 +151,7 @@ define([
},
onApiSelectionChanged: function(info) {
var seltype = info.asc_getFlags().asc_getSelectionType(),
var seltype = info.asc_getSelectionType(),
coauth_disable = (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) ? (info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true) : false;
var is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,

View file

@ -351,7 +351,7 @@ define([
onInsertEntire: function(item) {
if (this.api) {
switch (this.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()) {
switch (this.api.asc_getCellInfo().asc_getSelectionType()) {
case Asc.c_oAscSelectionType.RangeRow:
this.api.asc_insertCells(Asc.c_oAscInsertOptions.InsertRows);
break;
@ -376,7 +376,7 @@ define([
onDeleteEntire: function(item) {
if (this.api) {
switch (this.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()) {
switch (this.api.asc_getCellInfo().asc_getSelectionType()) {
case Asc.c_oAscSelectionType.RangeRow:
this.api.asc_deleteCells(Asc.c_oAscDeleteOptions.DeleteRows);
break;
@ -1567,7 +1567,7 @@ define([
fillMenuProps: function(cellinfo, showMenu, event){
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu, isimageonly,
documentHolder = this.documentHolder,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
seltype = cellinfo.asc_getSelectionType(),
isCellLocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true,
isObjLocked = false,
@ -1863,7 +1863,7 @@ define([
fillViewMenuProps: function(cellinfo, showMenu, event){
var documentHolder = this.documentHolder,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
seltype = cellinfo.asc_getSelectionType(),
isCellLocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true,
commentsController = this.getApplication().getController('Common.Controllers.Comments'),

View file

@ -529,7 +529,7 @@ define([
},
onSelectionChanged: function(info){
if (!this._isChartDataReady && info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChart) {
if (!this._isChartDataReady && info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChart) {
this._isChartDataReady = true;
Common.Gateway.internalMessage('chartDataReady');
}

View file

@ -380,8 +380,7 @@ define([
onSelectionChanged: function(info) {
if (this.rangeSelectionMode || !this.appConfig.isEdit || !this.view) return;
var selectType = info.asc_getFlags().asc_getSelectionType(),
pivotInfo = info.asc_getPivotTableInfo();
var pivotInfo = info.asc_getPivotTableInfo();
Common.Utils.lockControls(SSE.enumLock.noPivot, !pivotInfo, {array: this.view.lockedControls});
Common.Utils.lockControls(SSE.enumLock.editPivot, !!pivotInfo, {array: [this.view.btnAddPivot]});

View file

@ -133,7 +133,7 @@ define([
if (this.rangeSelectionMode) return;
var SelectedObjects = [],
selectType = info.asc_getFlags().asc_getSelectionType(),
selectType = info.asc_getSelectionType(),
formatTableInfo = info.asc_getFormatTableInfo(),
sparkLineInfo = info.asc_getSparklineInfo(),
cellInfo = info,

View file

@ -785,7 +785,7 @@ define([
},
onTextOrientationMenu: function(menu, item) {
if (this.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeShapeText) {
if (this.api.asc_getCellInfo().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeShapeText) {
var angle = Asc.c_oAscVertDrawingText.normal;
switch (item.value) {
case 'rotateup': angle = Asc.c_oAscVertDrawingText.vert270; break;
@ -908,7 +908,7 @@ define([
};
var cell = me.api.asc_getCellInfo(),
seltype = cell.asc_getFlags().asc_getSelectionType();
seltype = cell.asc_getSelectionType();
props = cell.asc_getHyperlink();
win = new SSE.Views.HyperlinkSettingsDialog({
api: me.api,
@ -936,7 +936,8 @@ define([
onEditChart: function(btn) {
if (!this.editMode) return;
var me = this, info = me.api.asc_getCellInfo();
if (info.asc_getFlags().asc_getSelectionType()!=Asc.c_oAscSelectionType.RangeImage) {
var selectType = info.asc_getSelectionType();
if (selectType !== Asc.c_oAscSelectionType.RangeImage) {
var win, props;
if (me.api){
props = me.api.asc_getChartObject();
@ -950,7 +951,7 @@ define([
}
}
if (props) {
var ischartedit = ( me.toolbar.mode.isEditDiagram || info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChart || info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChartText);
var ischartedit = ( me.toolbar.mode.isEditDiagram || selectType === Asc.c_oAscSelectionType.RangeChart || selectType === Asc.c_oAscSelectionType.RangeChartText);
(new SSE.Views.ChartSettingsDlg(
{
@ -978,7 +979,7 @@ define([
if (!this.editMode) return;
var me = this,
info = me.api.asc_getCellInfo(),
seltype = info.asc_getFlags().asc_getSelectionType(),
seltype = info.asc_getSelectionType(),
isSpark = (group == 'menu-chart-group-sparkcolumn' || group == 'menu-chart-group-sparkline' || group == 'menu-chart-group-sparkwin');
if (me.api) {
@ -1527,7 +1528,7 @@ define([
if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditDiagram && !me.api.isCellEdited && !me._state.multiselect && !me._state.inpivot &&
!me.getApplication().getController('LeftMenu').leftMenu.menuFile.isVisible()) {
var cellinfo = me.api.asc_getCellInfo(),
selectionType = cellinfo.asc_getFlags().asc_getSelectionType();
selectionType = cellinfo.asc_getSelectionType();
if (selectionType !== Asc.c_oAscSelectionType.RangeShapeText || me.api.asc_canAddShapeHyperlink()!==false)
me.onHyperlink();
}
@ -2069,7 +2070,7 @@ define([
if ( this.toolbar.mode.isEditMailMerge )
return this.onApiSelectionChanged_MailMergeEditor(info);
var selectionType = info.asc_getFlags().asc_getSelectionType(),
var selectionType = info.asc_getSelectionType(),
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (info.asc_getLocked()===true || info.asc_getLockedTable()===true || info.asc_getLockedPivotTable()===true) : false,
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
me = this,
@ -2447,7 +2448,7 @@ define([
},
onApiSelectionChangedRestricted: function(info) {
var selectionType = info.asc_getFlags().asc_getSelectionType();
var selectionType = info.asc_getSelectionType();
this.toolbar.lockToolbar(SSE.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (info.asc_getComments().length>0 || info.asc_getLocked()) ||
this.appConfig && this.appConfig.compatibleFeatures && (selectionType != Asc.c_oAscSelectionType.RangeCells),
{ array: this.btnsComment });
@ -2497,7 +2498,7 @@ define([
return is_image;
};
var selectionType = info.asc_getFlags().asc_getSelectionType(),
var selectionType = info.asc_getSelectionType(),
coauth_disable = false;
if ( _disableEditOptions(selectionType, coauth_disable) ) return;
@ -2547,7 +2548,7 @@ define([
return is_image;
};
var selectionType = info.asc_getFlags().asc_getSelectionType(),
var selectionType = info.asc_getSelectionType(),
coauth_disable = false,
editOptionsDisabled = _disableEditOptions(selectionType, coauth_disable),
val, need_disable = false;
@ -3073,14 +3074,14 @@ define([
win.show();
win.setSettings({
api : me.api,
selectionType: me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()
selectionType: me.api.asc_getCellInfo().asc_getSelectionType()
});
} else {
me._state.filter = undefined;
if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else {
var selectionType = me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType();
var selectionType = me.api.asc_getCellInfo().asc_getSelectionType();
if (selectionType == Asc.c_oAscSelectionType.RangeMax || selectionType == Asc.c_oAscSelectionType.RangeRow ||
selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
@ -3289,7 +3290,7 @@ define([
this.btnsComment.forEach(function (btn) {
btn.updateHint( _comments.textHintAddComment );
btn.on('click', function (btn, e) {
Common.NotificationCenter.trigger('app:comment:add', 'toolbar', me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType() != Asc.c_oAscSelectionType.RangeCells);
Common.NotificationCenter.trigger('app:comment:add', 'toolbar', me.api.asc_getCellInfo().asc_getSelectionType() != Asc.c_oAscSelectionType.RangeCells);
});
if (btn.cmpEl.closest('#review-changes-panel').length>0)
btn.setCaption(me.toolbar.capBtnAddComment);

View file

@ -219,10 +219,10 @@ define([
me.api.asc_mergeCells(Asc.c_oAscMergeOptions.None);
break;
case 'hide':
me.api[info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_hideRows' : 'asc_hideColumns']();
me.api[info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_hideRows' : 'asc_hideColumns']();
break;
case 'show':
me.api[info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_showRows' : 'asc_showColumns']();
me.api[info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_showRows' : 'asc_showColumns']();
break;
case 'addlink':
me.view.hideMenu();
@ -311,7 +311,7 @@ define([
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu;
var iscelllocked = cellinfo.asc_getLocked(),
seltype = cellinfo.asc_getFlags().asc_getSelectionType();
seltype = cellinfo.asc_getSelectionType();
switch (seltype) {
case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;

View file

@ -176,7 +176,7 @@ define([
if ( !info ) info = this.api.asc_getCellInfo();
var islocked = false;
switch (info.asc_getFlags().asc_getSelectionType()) {
switch (info.asc_getSelectionType()) {
case Asc.c_oAscSelectionType.RangeChart:
case Asc.c_oAscSelectionType.RangeImage:
case Asc.c_oAscSelectionType.RangeShape:

View file

@ -82,7 +82,7 @@ define([
var cellinfo = me.api.asc_getCellInfo();
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
seltype = cellinfo.asc_getSelectionType(),
iscelllocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true;
@ -123,7 +123,7 @@ define([
var me = this,
addViews = [];
// var seltype = this.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType();
// var seltype = this.api.asc_getCellInfo().asc_getSelectionType();
if ( !options )
addViews.push({

View file

@ -71,7 +71,7 @@ define([
var _view = view || this.getView();
var cell = this.api.asc_getCellInfo(),
celltype = cell.asc_getFlags().asc_getSelectionType();
celltype = cell.asc_getSelectionType();
var allowinternal = (celltype!==Asc.c_oAscSelectionType.RangeImage && celltype!==Asc.c_oAscSelectionType.RangeShape &&
celltype!==Asc.c_oAscSelectionType.RangeShapeText && celltype!==Asc.c_oAscSelectionType.RangeChart &&
celltype!==Asc.c_oAscSelectionType.RangeChartText);
@ -158,7 +158,7 @@ define([
view.showPage(rootView, navbar);
var cell = me.api.asc_getCellInfo(),
celltype = cell.asc_getFlags().asc_getSelectionType();
celltype = cell.asc_getSelectionType();
var allowinternal = (celltype!==Asc.c_oAscSelectionType.RangeImage && celltype!==Asc.c_oAscSelectionType.RangeShape &&
celltype!==Asc.c_oAscSelectionType.RangeShapeText && celltype!==Asc.c_oAscSelectionType.RangeChart &&
celltype!==Asc.c_oAscSelectionType.RangeChartText);

View file

@ -98,7 +98,7 @@ define([
isHideInsertComment: function() {
var cellinfo = this.api.asc_getCellInfo();
var iscelllocked = cellinfo.asc_getLocked(),
seltype = cellinfo.asc_getFlags().asc_getSelectionType();
seltype = cellinfo.asc_getSelectionType();
if (seltype === Asc.c_oAscSelectionType.RangeCells && !iscelllocked) {
return false;
}

View file

@ -316,7 +316,7 @@ define([
}
var me = this,
selectionType = cellInfo.asc_getFlags().asc_getSelectionType(),
selectionType = cellInfo.asc_getSelectionType(),
// coAuthDisable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (cellInfo.asc_getLocked()===true || cellInfo.asc_getLockedTable()===true) : false,
// editOptionsDisabled = this._disableEditOptions(selectionType, coAuthDisable),
_fontInfo = cellInfo.asc_getFont(),

View file

@ -378,7 +378,7 @@ define([
_settings = [];
var isCell, isRow, isCol, isAll, isChart, isImage, isTextShape, isShape, isTextChart,
selType = cellInfo.asc_getFlags().asc_getSelectionType(),
selType = cellInfo.asc_getSelectionType(),
isCellLocked = cellInfo.asc_getLocked(),
isTableLocked = cellInfo.asc_getLockedTable()===true,
isObjLocked = false;

View file

@ -226,7 +226,7 @@ define([
var me = this,
selectedObjects = [],
selectType = info.asc_getFlags().asc_getSelectionType();
selectType = info.asc_getSelectionType();
if (selectType == Asc.c_oAscSelectionType.RangeImage) {
selectedObjects = me.api.asc_getGraphicObjectProps();

View file

@ -361,7 +361,7 @@ define([
var me = this,
selectedObjects = [],
selectType = info.asc_getFlags().asc_getSelectionType();
selectType = info.asc_getSelectionType();
if (selectType == Asc.c_oAscSelectionType.RangeShape) {
selectedObjects = me.api.asc_getGraphicObjectProps();

View file

@ -324,7 +324,7 @@ define([
_cellInfo = info;
_fontInfo = info.asc_getFont();
var selectType = info.asc_getFlags().asc_getSelectionType();
var selectType = info.asc_getSelectionType();
switch (selectType) {
case Asc.c_oAscSelectionType.RangeChartText: _textIn = TextType.inChart; break;