Merge pull request #149 from ONLYOFFICE/feature/sse-print-area-translate

[SSE] Add parameter to get translated print area name
This commit is contained in:
Julia Radzhabova 2019-03-07 11:08:44 +03:00 committed by GitHub
commit 7d13e2d110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 18 deletions

View file

@ -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<n2) ? -1 : 1;
});
_.each(names, function(field, index) {
var name = field.asc_getName();
var name = field.asc_getName(true);
if (prev_name !== name) {
rangesMenu.addItem(new Common.UI.MenuItem({
caption : field.asc_getName()
caption : name
}));
}
prev_name = name;

View file

@ -1905,15 +1905,15 @@ define([
i--;
}
funcarr.sort(function (a,b) {
var aname = a.asc_getName().toLocaleUpperCase(),
bname = b.asc_getName().toLocaleUpperCase();
var aname = a.asc_getName(true).toLocaleUpperCase(),
bname = b.asc_getName(true).toLocaleUpperCase();
if (aname < bname) return -1;
if (aname > 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') ,

View file

@ -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);

View file

@ -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));
}
},

View file

@ -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({

View file

@ -125,7 +125,7 @@ define([
if (this.ranges) {
var me = this, arr = [], prev_name='';
for (var i=0; i<this.ranges.length; i++) {
var name = this.ranges[i].asc_getName();
var name = this.ranges[i].asc_getName(true);
if (name !== prev_name) {
arr.push({
name: name,
@ -150,7 +150,7 @@ define([
getSettings: function() {
var rec = this.rangeList.getSelectedRec();
return (rec.length>0) ? (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() {