diff --git a/apps/spreadsheeteditor/main/app/controller/CellEditor.js b/apps/spreadsheeteditor/main/app/controller/CellEditor.js index 7404379ca..549455637 100644 --- a/apps/spreadsheeteditor/main/app/controller/CellEditor.js +++ b/apps/spreadsheeteditor/main/app/controller/CellEditor.js @@ -280,16 +280,16 @@ define([ rangesMenu.removeItems(2, rangesMenu.items.length-1); names.sort(function(item1, item2) { - var n1 = item1.asc_getName().toLowerCase(), - n2 = item2.asc_getName().toLowerCase(); + var n1 = item1.asc_getName(true).toLowerCase(), + n2 = item2.asc_getName(true).toLowerCase(); if (n1==n2) return 0; return (n1 bname) return 1; return 0; }); _.each(funcarr, function(menuItem, index) { var type = menuItem.asc_getType(), - name = menuItem.asc_getName(), + name = menuItem.asc_getName(true), origname = me.api.asc_getFormulaNameByLocale(name), mnu = new Common.UI.MenuItem({ iconCls: (type==Asc.c_oAscPopUpSelectorType.Func) ? 'mnu-popup-func': ((type==Asc.c_oAscPopUpSelectorType.Table) ? 'mnu-popup-table' : 'mnu-popup-range') , diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 14ba415f2..697d55558 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1190,7 +1190,7 @@ define([ (new SSE.Views.NamedRangePasteDlg({ handler: function(result, settings) { if (result == 'ok' && settings) { - me.api.asc_insertFormula(settings.asc_getName(), settings.asc_getIsTable() ? Asc.c_oAscPopUpSelectorType.Table : Asc.c_oAscPopUpSelectorType.Range, false); + me.api.asc_insertFormula(settings.asc_getName(true), settings.asc_getIsTable() ? Asc.c_oAscPopUpSelectorType.Table : Asc.c_oAscPopUpSelectorType.Range, false); Common.component.Analytics.trackEvent('ToolBar', 'Paste Named Range'); } Common.NotificationCenter.trigger('edit:complete', me.toolbar); diff --git a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js index 9e0f43c21..8f7cf01c6 100644 --- a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js @@ -190,7 +190,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', var scope = this.ranges[i].asc_getScope(), id = this.ranges[i].asc_getIsLock(); arr.push({ - name: this.ranges[i].asc_getName(), + name: this.ranges[i].asc_getName(true), scope: scope, scopeName: (scope===null) ? this.textWorkbook: this.sheetNames[scope], range: this.ranges[i].asc_getRef(), @@ -233,7 +233,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', }, 50); } else if (selectedItem){ // object - var rec = store.findWhere({name: selectedItem.asc_getName(), scope: selectedItem.asc_getScope()}); + var rec = store.findWhere({name: selectedItem.asc_getName(true), scope: selectedItem.asc_getScope()}); if (rec) { this.rangeList.selectRecord(rec); setTimeout(function() { @@ -285,7 +285,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', xy = me.$window.offset(), rec = this.rangeList.getSelectedRec(), idx = _.indexOf(this.rangeList.store.models, rec[0]), - oldname = (isEdit && rec.length>0) ? new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable')) : null; + oldname = (isEdit && rec.length>0) ? new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'), undefined, undefined, undefined, true) : null; var win = new SSE.Views.NamedRangeEditDlg({ api: me.api, @@ -319,7 +319,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', var rec = this.rangeList.getSelectedRec(); if (rec.length>0) { this.currentNamedRange = _.indexOf(this.rangeList.store.models, rec[0]); - this.api.asc_delDefinedNames(new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'))); + this.api.asc_delDefinedNames(new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'), undefined, undefined, undefined, true)); } }, diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js index e4988f36d..cc638c0e4 100644 --- a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js @@ -137,7 +137,7 @@ define([ return me.textIsLocked; break; case Asc.c_oAscDefinedNameReason.Existed: - return (me.isEdit && me.props.asc_getName().toLowerCase() == value.toLowerCase()) ? true : me.textExistName; + return (me.isEdit && me.props.asc_getName(true).toLowerCase() == value.toLowerCase()) ? true : me.textExistName; case Asc.c_oAscDefinedNameReason.NameReserved: return (me.isEdit) ? me.textReservedName : true; default: @@ -204,7 +204,7 @@ define([ var val = props.asc_getScope(); this.cmbScope.setValue((val===null) ? -255 : val); - val = props.asc_getName(); + val = props.asc_getName(true); if ( !_.isEmpty(val) ) this.inputName.setValue(val); val = props.asc_getRef(); @@ -248,7 +248,7 @@ define([ }, getSettings: function() { - return (new Asc.asc_CDefName(this.inputName.getValue(), this.txtDataRange.getValue(), (this.cmbScope.getValue()==-255) ? null : this.cmbScope.getValue(), this.props.asc_getIsTable())); + return (new Asc.asc_CDefName(this.inputName.getValue(), this.txtDataRange.getValue(), (this.cmbScope.getValue()==-255) ? null : this.cmbScope.getValue(), this.props.asc_getIsTable(), undefined, undefined, undefined, true)); }, onPrimary: function() { @@ -295,7 +295,7 @@ define([ onRefreshDefNameList: function(name) { var me = this; if (this.isEdit && Common.Utils.InternalSettings.get("sse-settings-coauthmode")) { // fast co-editing - if (name && name.asc_getIsLock() && name.asc_getName().toLowerCase() == this.props.asc_getName().toLowerCase() && + if (name && name.asc_getIsLock() && name.asc_getName(true).toLowerCase() == this.props.asc_getName(true).toLowerCase() && (name.asc_getScope() === null && this.props.asc_getScope() === null || name.asc_getScope().toLowerCase() == this.props.asc_getScope().toLowerCase()) && !this._listRefreshed) { this._listRefreshed = true; Common.UI.alert({ diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js index 135349a7a..54f86f95e 100644 --- a/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js @@ -125,7 +125,7 @@ define([ if (this.ranges) { var me = this, arr = [], prev_name=''; for (var i=0; i0) ? (new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'))) : null; + return (rec.length>0) ? (new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'), undefined, undefined, undefined, true)) : null; }, onPrimary: function() {