From a33df0aabeb56ddb581803de51234a0d9d415e35 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 14 May 2020 11:39:04 +0300 Subject: [PATCH 1/5] [SSE] Move Move asc_getSelectionType to cell info --- .../main/app/controller/CellEditor.js | 2 +- .../main/app/controller/DocumentHolder.js | 8 +++--- .../main/app/controller/Main.js | 2 +- .../main/app/controller/PivotTable.js | 3 +-- .../main/app/controller/RightMenu.js | 2 +- .../main/app/controller/Toolbar.js | 27 ++++++++++--------- .../mobile/app/controller/DocumentHolder.js | 6 ++--- .../mobile/app/controller/Toolbar.js | 2 +- .../mobile/app/controller/add/AddContainer.js | 4 +-- .../mobile/app/controller/add/AddLink.js | 4 +-- .../mobile/app/controller/add/AddOther.js | 2 +- .../mobile/app/controller/edit/EditCell.js | 2 +- .../app/controller/edit/EditContainer.js | 2 +- .../mobile/app/controller/edit/EditImage.js | 2 +- .../mobile/app/controller/edit/EditShape.js | 2 +- .../mobile/app/controller/edit/EditText.js | 2 +- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/CellEditor.js b/apps/spreadsheeteditor/main/app/controller/CellEditor.js index 6808260fd..837f5b986 100644 --- a/apps/spreadsheeteditor/main/app/controller/CellEditor.js +++ b/apps/spreadsheeteditor/main/app/controller/CellEditor.js @@ -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, diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index bc1a4f15d..498dcc0b5 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -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'), diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 267225973..2d716ff0b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -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'); } diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js index 1d7ea91e9..d295b33f3 100644 --- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js @@ -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]}); diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 7ea0ce290..4048a750a 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -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, diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 405ef7321..793ae20bd 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -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); diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 88ea4658a..847e79265 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -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; diff --git a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js index 44a808568..46328b544 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js @@ -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: diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddContainer.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddContainer.js index 9581680ad..4fa1563cf 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddContainer.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddContainer.js @@ -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({ diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js index 2ac49847a..793834217 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js @@ -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); diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js index 70605b823..bde23be46 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js @@ -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; } diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js index f3de7b667..16e5ce37d 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js @@ -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(), diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js index 24b694b84..3c962f9e6 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js @@ -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; diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditImage.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditImage.js index d36fe488f..d19a2dc25 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditImage.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditImage.js @@ -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(); diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js index 7d2fe608f..a6e1f2d74 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js @@ -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(); diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditText.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditText.js index cdd296b61..6232c2008 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditText.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditText.js @@ -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; From 4a282e307a766eb4c6a491217e279eebde8438db Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 14 May 2020 11:45:23 +0300 Subject: [PATCH 2/5] [SSE] Move Move asc_getMultiselect to cell info --- apps/spreadsheeteditor/main/app/controller/DataTab.js | 2 +- apps/spreadsheeteditor/main/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 +- .../spreadsheeteditor/mobile/app/controller/DocumentHolder.js | 4 ++-- .../mobile/app/controller/edit/EditContainer.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index e310cf1dc..6aa5e25db 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -117,7 +117,7 @@ define([ // special disable conditions Common.Utils.lockControls(SSE.enumLock.multiselectCols, info.asc_getSelectedColsCount()>1, {array: [this.view.btnTextToColumns]}); - Common.Utils.lockControls(SSE.enumLock.multiselect, info.asc_getFlags().asc_getMultiselect(), {array: [this.view.btnTextToColumns]}); + Common.Utils.lockControls(SSE.enumLock.multiselect, info.asc_getMultiselect(), {array: [this.view.btnTextToColumns]}); }, onUngroup: function(type) { diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 498dcc0b5..efa047a3b 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1740,7 +1740,7 @@ define([ formatTableInfo = cellinfo.asc_getFormatTableInfo(), isinsparkline = (cellinfo.asc_getSparklineInfo()!==null), isintable = (formatTableInfo !== null), - ismultiselect = cellinfo.asc_getFlags().asc_getMultiselect(); + ismultiselect = cellinfo.asc_getMultiselect(); documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; documentHolder.ssMenu.cellColor = cellinfo.asc_getFillColor(); documentHolder.ssMenu.fontColor = cellinfo.asc_getFont().asc_getColor(); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 793ae20bd..3a968a5cd 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2361,7 +2361,7 @@ define([ if (this._state.tablename !== old_name || this._state.filterapplied !== old_applied) this.getApplication().getController('Statusbar').onApiFilterInfo(!need_disable); - this._state.multiselect = info.asc_getFlags().asc_getMultiselect(); + this._state.multiselect = info.asc_getMultiselect(); toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink, toolbar.btnInsertTable]}); this._state.inpivot = !!info.asc_getPivotTableInfo(); diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 847e79265..c62fc39ab 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -430,12 +430,12 @@ define([ event: 'wrap' }); - if (cellinfo.asc_getHyperlink() && !cellinfo.asc_getFlags().asc_getMultiselect()) { + if (cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect()) { arrItems.push({ caption: me.menuOpenLink, event: 'openlink' }); - } else if (!cellinfo.asc_getHyperlink() && !cellinfo.asc_getFlags().asc_getMultiselect() && + } else if (!cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect() && !cellinfo.asc_getFlags().asc_getLockText() && !!cellinfo.asc_getText()) { arrItems.push({ caption: me.menuAddLink, diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js index 3c962f9e6..3469028f0 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js @@ -495,7 +495,7 @@ define([ // formatTableInfo = cellInfo.asc_getFormatTableInfo(), // isinsparkline = (cellInfo.asc_getSparklineInfo()!==null), // isintable = (formatTableInfo !== null), - // ismultiselect = cellInfo.asc_getFlags().asc_getMultiselect(); + // ismultiselect = cellInfo.asc_getMultiselect(); // documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; // documentHolder.ssMenu.cellColor = cellInfo.asc_getFill().asc_getColor(); // documentHolder.ssMenu.fontColor = cellInfo.asc_getFont().asc_getColor(); From f50d32b597f15335259c4b66a507336afe3d04f3 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 14 May 2020 11:50:34 +0300 Subject: [PATCH 3/5] [SSE] Move Move asc_getLockText to cell info --- apps/spreadsheeteditor/main/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 +- .../spreadsheeteditor/mobile/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js | 4 ++-- .../mobile/app/controller/edit/EditHyperlink.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index efa047a3b..5b4acbc15 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -545,7 +545,7 @@ define([ currentSheet: me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex()), props : props, text : cell.asc_getText(), - isLock : cell.asc_getFlags().asc_getLockText(), + isLock : cell.asc_getLockText(), allowInternal: item.options.inCell }); } diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 3a968a5cd..111827f50 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -923,7 +923,7 @@ define([ currentSheet: me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex()), props : props, text : cell.asc_getText(), - isLock : cell.asc_getFlags().asc_getLockText(), + isLock : cell.asc_getLockText(), allowInternal: (seltype!==Asc.c_oAscSelectionType.RangeImage && seltype!==Asc.c_oAscSelectionType.RangeShape && seltype!==Asc.c_oAscSelectionType.RangeShapeText && seltype!==Asc.c_oAscSelectionType.RangeChart && seltype!==Asc.c_oAscSelectionType.RangeChartText) diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index c62fc39ab..4f59a163c 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -436,7 +436,7 @@ define([ event: 'openlink' }); } else if (!cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect() && - !cellinfo.asc_getFlags().asc_getLockText() && !!cellinfo.asc_getText()) { + !cellinfo.asc_getLockText() && !!cellinfo.asc_getText()) { arrItems.push({ caption: me.menuAddLink, event: 'addlink' diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js index 793834217..d210ca980 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddLink.js @@ -76,7 +76,7 @@ define([ celltype!==Asc.c_oAscSelectionType.RangeShapeText && celltype!==Asc.c_oAscSelectionType.RangeChart && celltype!==Asc.c_oAscSelectionType.RangeChartText); - _view.optionDisplayText(cell.asc_getFlags().asc_getLockText() ? 'locked' : cell.asc_getText()); + _view.optionDisplayText(cell.asc_getLockText() ? 'locked' : cell.asc_getText()); _view.optionAllowInternal(allowinternal); allowinternal && _view.optionLinkType( cfgLink.type ); } @@ -163,7 +163,7 @@ define([ celltype!==Asc.c_oAscSelectionType.RangeShapeText && celltype!==Asc.c_oAscSelectionType.RangeChart && celltype!==Asc.c_oAscSelectionType.RangeChartText); - view.optionDisplayText(cell.asc_getFlags().asc_getLockText() ? 'locked' : cell.asc_getText()); + view.optionDisplayText(cell.asc_getLockText() ? 'locked' : cell.asc_getText()); view.optionAllowInternal(allowinternal); allowinternal && view.optionLinkType( cfgLink.type ); diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditHyperlink.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditHyperlink.js index c0d74b8c5..faa67a222 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditHyperlink.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditHyperlink.js @@ -133,7 +133,7 @@ define([ var cellInfo = me.api.asc_getCellInfo(), linkInfo = cellInfo.asc_getHyperlink(), - isLock = cellInfo.asc_getFlags().asc_getLockText(); + isLock = cellInfo.asc_getLockText(); me.linkType = linkInfo.asc_getType(); $('#edit-link-type .item-after').text((me.linkType == Asc.c_oAscHyperlinkType.RangeLink) ? me.textInternalLink : me.textExternalLink); From e0268a7beedd95dcf273806d761c94c75a9a646a Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 14 May 2020 12:01:20 +0300 Subject: [PATCH 4/5] [SSE] Move Move asc_getWrapText to cell info --- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 +- apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 111827f50..c3f86bb03 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2320,7 +2320,7 @@ define([ /* read cell text wrapping */ if (!toolbar.btnWrap.isDisabled()) { - val = info.asc_getFlags().asc_getWrapText(); + val = info.asc_getWrapText(); if (this._state.wrap !== val) { toolbar.btnWrap.toggle(val===true, true); this._state.wrap = val; diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 4f59a163c..fa3bc06ca 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -420,7 +420,7 @@ define([ }); arrItems.push( - cellinfo.asc_getFlags().asc_getWrapText() ? + cellinfo.asc_getWrapText() ? { caption: me.menuUnwrap, event: 'unwrap' diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js index 16e5ce37d..10a861261 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js @@ -219,7 +219,7 @@ define([ vAlign = me._cellInfo.asc_getVertAlign(), hAlignStr = 'left', vAlignStr = 'bottom', - isWrapText = me._cellInfo.asc_getFlags().asc_getWrapText(); + isWrapText = me._cellInfo.asc_getWrapText(); if (vAlign == Asc.c_oAscVAlign.Top) vAlignStr = 'top'; From 00fc3770d594315a5c07666e69894dfb36407583 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 14 May 2020 12:16:27 +0300 Subject: [PATCH 5/5] [SSE] Move Move asc_getMerge to cell info --- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 4 ++-- .../spreadsheeteditor/mobile/app/controller/DocumentHolder.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index c3f86bb03..02149319c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -750,7 +750,7 @@ define([ } if (me.api) { - var merged = me.api.asc_getCellInfo().asc_getFlags().asc_getMerge(); + var merged = me.api.asc_getCellInfo().asc_getMerge(); if ((merged !== Asc.c_oAscMergeOptions.Merge) && me.api.asc_mergeCellsDataLost(item.value)) { Common.UI.warning({ msg: me.warnMergeLostData, @@ -2312,7 +2312,7 @@ define([ // (need_disable !== toolbar.btnMerge.isDisabled()) && toolbar.btnMerge.setDisabled(need_disable); toolbar.lockToolbar(SSE.enumLock.ruleMerge, need_disable, {array:[toolbar.btnMerge, toolbar.btnInsertTable]}); - val = info.asc_getFlags().asc_getMerge(); + val = info.asc_getMerge(); if (this._state.merge !== val) { toolbar.btnMerge.toggle(val===Asc.c_oAscMergeOptions.Merge, true); this._state.merge = val; diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index fa3bc06ca..d2690e3ad 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -407,13 +407,13 @@ define([ event: 'edit' }); - (cellinfo.asc_getFlags().asc_getMerge() == Asc.c_oAscMergeOptions.None) && + (cellinfo.asc_getMerge() == Asc.c_oAscMergeOptions.None) && arrItems.push({ caption: me.menuMerge, event: 'merge' }); - (cellinfo.asc_getFlags().asc_getMerge() == Asc.c_oAscMergeOptions.Merge) && + (cellinfo.asc_getMerge() == Asc.c_oAscMergeOptions.Merge) && arrItems.push({ caption: me.menuUnmerge, event: 'unmerge'