Commit b7f39044 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Bug 32608.

parent b4a34cb5
......@@ -2569,8 +2569,23 @@ define([
if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else
me.api.asc_addAutoFilter(fmtname, dlg.getSettings());
else {
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);
......@@ -2582,14 +2597,30 @@ define([
win.show();
win.setSettings({
api : me.api
api : me.api,
selectionType: me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()
});
} else {
me._state.filter = undefined;
if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else
me.api.asc_addAutoFilter(fmtname);
else {
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?',
txtExpand: 'Expand and sort',
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 || {}));
});
\ No newline at end of file
......@@ -136,7 +136,7 @@ define([
},
onApiRangeChanged: function(info) {
this.inputRange.setValue(info);
this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error');
},
......
......@@ -74,6 +74,7 @@ define([
this.options.tpl = _.template(this.template, this.options);
this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable;
this.selectionType = Asc.c_oAscSelectionType.RangeCells;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
......@@ -129,6 +130,8 @@ define([
}
if (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_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
......@@ -145,15 +148,16 @@ define([
if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) {
var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());
options.asc_setIsTitle(this.cbTitle.checked);
return options;
return { selectionType: this.selectionType, range: options};
} else
return this.inputRange.getValue();
return { selectionType: this.selectionType, range: this.inputRange.getValue()};
},
onApiRangeChanged: function(info) {
this.inputRange.setValue(info);
this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error');
this.selectionType = info.asc_getType();
},
isRangeValid: function() {
......
......@@ -478,10 +478,25 @@ define([
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
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({
handler: handlerDlg
......@@ -545,7 +560,9 @@ define([
notcriticalErrorTitle : 'Warning',
textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.',
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 || {}));
});
\ No newline at end of file
......@@ -702,6 +702,8 @@
"SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi",
"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.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.cancelButtonText": "Cancel",
"SSE.Views.AutoFilterDialog.okButtonText": "OK",
......@@ -1483,6 +1485,8 @@
"SSE.Views.TableSettings.textTemplate": "Select From Template",
"SSE.Views.TableSettings.textTotal": "Total",
"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.okButtonText": "Ok",
"SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment