Merge pull request #2129 from ONLYOFFICE/fix/bug-56309

Fix/bug 56309
This commit is contained in:
Julia Radzhabova 2022-12-13 14:26:37 +03:00 committed by GitHub
commit 645f8cd55b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 5 deletions

View file

@ -696,7 +696,7 @@ define([
win.setSettings({
sheets : items,
ranges : me.api.asc_getDefinedNames(Asc.c_oAscGetDefinedNamesList.All, true),
currentSheet: me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex()),
currentSheet: me.api.asc_getActiveWorksheetIndex(),
props : props,
text : cell.asc_getText(),
isLock : cell.asc_getLockText(),

View file

@ -1047,7 +1047,7 @@ define([
win.setSettings({
sheets : items,
ranges : me.api.asc_getDefinedNames(Asc.c_oAscGetDefinedNamesList.All, true),
currentSheet: me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex()),
currentSheet: me.api.asc_getActiveWorksheetIndex(),
props : props,
text : cell.asc_getText(),
isLock : cell.asc_getLockText(),

View file

@ -169,7 +169,7 @@ define([
validation : function(value) {
if (me.inputRange.isDisabled()) // named range
return true;
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.FormatTable, value, false);
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false);
if (isvalid == Asc.c_oAscError.ID.No) {
return true;
} else {
@ -445,7 +445,7 @@ define([
}
}
store.reset(arr);
var sheet = props ? (props.asc_getSheet() || props.asc_getLocation()) : this.settings.currentSheet,
var sheet = props ? (props.asc_getSheet() || props.asc_getLocation()) : this.api.asc_getWorksheetName(this.settings.currentSheet),
rec = store.findWhere({name: sheet });
if (rec) {
this.internalList.expandRecord(rec.get('type') ? definedNames : store.at(0));
@ -531,6 +531,13 @@ define([
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
me.dataRangeValid = dlg.getSettings();
var idx = me.dataRangeValid.indexOf('!');
(idx>=0) && (me.dataRangeValid = me.dataRangeValid.substring(idx+1, me.dataRangeValid.length));
var rec = me.internalList.store.findWhere({name: me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex()) });
if (rec) {
me.internalList.expandRecord(me.internalList.store.at(0));
me.internalList.scrollToRecord(me.internalList.selectRecord(rec));
}
me.inputRange.setValue(me.dataRangeValid);
me.inputRange.checkValidate();
me.isAutoUpdate && me.inputDisplay.setValue(me.internalList.getSelectedRec().get('name') + (me.dataRangeValid!=='' ? '!' + me.dataRangeValid : ''));
@ -545,15 +552,20 @@ define([
_.delay(function(){
me.inputRange.focus();
},1);
_.delay(function(){
me.api.asc_showWorksheet(me.settings.currentSheet);
},1);
});
me.api.asc_showWorksheet(me.internalList.getSelectedRec().get('index')-1);
var xy = me.$window.offset();
me.hide();
win.show(xy.left + 160, xy.top + 125);
win.setSettings({
api : me.api,
range : (!_.isEmpty(me.inputRange.getValue()) && (me.inputRange.checkValidate()==true)) ? me.inputRange.getValue() : me.dataRangeValid,
type : Asc.c_oAscSelectionDialogType.FormatTable
type : Asc.c_oAscSelectionDialogType.Chart
});
}
},