[SSE] Bug 32608.

This commit is contained in:
Julia Radzhabova 2017-04-06 16:15:33 +03:00
parent b4a34cb546
commit b7f3904426
5 changed files with 71 additions and 13 deletions

View file

@ -2569,8 +2569,23 @@ define([
if (me._state.tablename) if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname); me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else else {
me.api.asc_addAutoFilter(fmtname, dlg.getSettings()); var settings = dlg.getSettings();
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_addAutoFilter(fmtname, settings.range)}, 1);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
else
me.api.asc_addAutoFilter(fmtname, settings.range);
}
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
@ -2582,14 +2597,30 @@ define([
win.show(); win.show();
win.setSettings({ win.setSettings({
api : me.api api : me.api,
selectionType: me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()
}); });
} else { } else {
me._state.filter = undefined; me._state.filter = undefined;
if (me._state.tablename) if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname); me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else else {
me.api.asc_addAutoFilter(fmtname); var selectionType = me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType();
if (selectionType == Asc.c_oAscSelectionType.RangeMax || selectionType == Asc.c_oAscSelectionType.RangeRow ||
selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_addAutoFilter(fmtname)}, 1);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
else
me.api.asc_addAutoFilter(fmtname);
}
} }
} }
}, },
@ -3022,7 +3053,9 @@ define([
txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?', txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?',
txtExpand: 'Expand and sort', txtExpand: 'Expand and sort',
txtSorting: 'Sorting', txtSorting: 'Sorting',
txtSortSelected: 'Sort selected' txtSortSelected: 'Sort selected',
textLongOperation: 'Long operation',
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?'
}, SSE.Controllers.Toolbar || {})); }, SSE.Controllers.Toolbar || {}));
}); });

View file

@ -136,7 +136,7 @@ define([
}, },
onApiRangeChanged: function(info) { onApiRangeChanged: function(info) {
this.inputRange.setValue(info); this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error')) if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error'); this.inputRange.cmpEl.removeClass('error');
}, },

View file

@ -74,6 +74,7 @@ define([
this.options.tpl = _.template(this.template, this.options); this.options.tpl = _.template(this.template, this.options);
this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable; this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable;
this.selectionType = Asc.c_oAscSelectionType.RangeCells;
Common.UI.Window.prototype.initialize.call(this, this.options); Common.UI.Window.prototype.initialize.call(this, this.options);
}, },
@ -129,6 +130,8 @@ define([
} }
if (settings.title) if (settings.title)
me.setTitle(settings.title); me.setTitle(settings.title);
if (settings.selectionType)
me.selectionType = settings.selectionType;
me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
@ -145,15 +148,16 @@ define([
if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) { if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) {
var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue()); var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());
options.asc_setIsTitle(this.cbTitle.checked); options.asc_setIsTitle(this.cbTitle.checked);
return options; return { selectionType: this.selectionType, range: options};
} else } else
return this.inputRange.getValue(); return { selectionType: this.selectionType, range: this.inputRange.getValue()};
}, },
onApiRangeChanged: function(info) { onApiRangeChanged: function(info) {
this.inputRange.setValue(info); this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error')) if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error'); this.inputRange.cmpEl.removeClass('error');
this.selectionType = info.asc_getType();
}, },
isRangeValid: function() { isRangeValid: function() {

View file

@ -478,10 +478,25 @@ define([
var handlerDlg = function(dlg, result) { var handlerDlg = function(dlg, result) {
if (result == 'ok') { if (result == 'ok') {
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None); me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
me.api.asc_changeTableRange(me._state.TableName, dlg.getSettings());
var settings = dlg.getSettings();
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_changeTableRange(me._state.TableName, settings.range)}, 1);
Common.NotificationCenter.trigger('edit:complete', me);
}
});
else
me.api.asc_changeTableRange(me._state.TableName, settings.range);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me);
}; };
var win = new SSE.Views.TableOptionsDialog({ var win = new SSE.Views.TableOptionsDialog({
handler: handlerDlg handler: handlerDlg
@ -545,7 +560,9 @@ define([
notcriticalErrorTitle : 'Warning', notcriticalErrorTitle : 'Warning',
textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.', textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.',
textAdvanced: 'Show advanced settings', textAdvanced: 'Show advanced settings',
textConvertRange: 'Convert to range' textConvertRange: 'Convert to range',
textLongOperation: 'Long operation',
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?'
}, SSE.Views.TableSettings || {})); }, SSE.Views.TableSettings || {}));
}); });

View file

@ -702,6 +702,8 @@
"SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi",
"SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta",
"SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?", "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?",
"SSE.Controllers.Toolbar.textLongOperation": "Long operation",
"SSE.Controllers.Toolbar.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter", "SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter",
"SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel", "SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel",
"SSE.Views.AutoFilterDialog.okButtonText": "OK", "SSE.Views.AutoFilterDialog.okButtonText": "OK",
@ -1483,6 +1485,8 @@
"SSE.Views.TableSettings.textTemplate": "Select From Template", "SSE.Views.TableSettings.textTemplate": "Select From Template",
"SSE.Views.TableSettings.textTotal": "Total", "SSE.Views.TableSettings.textTotal": "Total",
"SSE.Views.TableSettings.textConvertRange": "Convert to range", "SSE.Views.TableSettings.textConvertRange": "Convert to range",
"SSE.Views.TableSettings.textLongOperation": "Long operation",
"SSE.Views.TableSettings.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel", "SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel",
"SSE.Views.TableSettingsAdvanced.okButtonText": "Ok", "SSE.Views.TableSettingsAdvanced.okButtonText": "Ok",
"SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", "SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text",