diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js
index 313d4ad2f5..47846abdbc 100644
--- a/apps/common/main/lib/view/OpenDialog.js
+++ b/apps/common/main/lib/view/OpenDialog.js
@@ -291,10 +291,12 @@ define([
}
var decimal = this.separatorOptions ? this.separatorOptions.decimal : undefined,
- thousands = this.separatorOptions ? this.separatorOptions.thousands : undefined;
+ thousands = this.separatorOptions ? this.separatorOptions.thousands : undefined,
+ qualifier = this.separatorOptions ? this.separatorOptions.qualifier : '"';
var options = new Asc.asc_CTextOptions(encoding, delimiter, delimiterChar);
decimal && options.asc_setNumberDecimalSeparator(decimal);
thousands && options.asc_setNumberGroupSeparator(thousands);
+ qualifier && options.asc_setTextQualifier(qualifier);
this.handler.call(this, state, {
textOptions: options,
range: this.txtDestRange ? this.txtDestRange.getValue() : '',
@@ -433,6 +435,7 @@ define([
if (this.separatorOptions) {
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
+ options.asc_setTextQualifier(this.separatorOptions.qualifier);
}
this.api.asc_TextImport(options, _.bind(this.previewCallback, this), this.type == Common.Utils.importTextType.Paste);
break;
@@ -441,6 +444,7 @@ define([
if (this.separatorOptions) {
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
+ options.asc_setTextQualifier(this.separatorOptions.qualifier);
}
this.api.asc_decodeBuffer(this.preview, options, _.bind(this.previewCallback, this));
break;
@@ -536,17 +540,20 @@ define([
var me = this,
decimal = this.api.asc_getDecimalSeparator(),
- thousands = this.api.asc_getGroupSeparator();
+ thousands = this.api.asc_getGroupSeparator(),
+ qualifier = this.settings ? this.settings.asc_getTextQualifier() : '"';
(new SSE.Views.AdvancedSeparatorDialog({
props: {
decimal: decimal,
- thousands: thousands
+ thousands: thousands,
+ qualifier: qualifier
},
handler: function(result, value) {
if (result == 'ok') {
me.separatorOptions = {
decimal: (value.decimal.length > 0) ? value.decimal : decimal,
- thousands: (value.thousands.length > 0) ? value.thousands : thousands
+ thousands: (value.thousands.length > 0) ? value.thousands : thousands,
+ qualifier: value.qualifier
};
}
}
diff --git a/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js b/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js
index 63a0e3d74a..0bf8e6a78b 100644
--- a/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js
+++ b/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js
@@ -66,6 +66,12 @@ define([
'
',
'
',
'
',
+ '',
+ '',
+ '
',
+ '',
''
].join('');
@@ -92,14 +98,27 @@ define([
validateOnBlur: false
});
+ this.cmbQualifier = new Common.UI.ComboBox({
+ el: $('#id-adv-separator-qualifier'),
+ style: 'width: 100px;',
+ menuStyle: 'min-width: 100px;',
+ cls: 'input-group-nr',
+ data: [
+ {value: '"', displayValue: '"'},
+ {value: '\'', displayValue: '\''},
+ {value: null, displayValue: this.txtNone}],
+ editable: false,
+ takeFocusOnClose: true
+ });
+
var $window = this.getChild();
- $window.find('.btn').on('click', _.bind(this.onBtnClick, this));
+ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.afterRender();
},
getFocusedComponents: function() {
- return [this.inputDecimalSeparator, this.inputThousandsSeparator];
+ return [this.inputDecimalSeparator, this.inputThousandsSeparator, this.cmbQualifier];
},
getDefaultFocusableComponent: function () {
@@ -114,6 +133,7 @@ define([
if (props) {
this.inputDecimalSeparator.setValue(props.decimal || '');
this.inputThousandsSeparator.setValue(props.thousands || '');
+ this.cmbQualifier.setValue(props.qualifier || null);
}
},
@@ -128,7 +148,8 @@ define([
_handleInput: function(state) {
if (this.options.handler) {
- this.options.handler.call(this, state, {decimal: this.inputDecimalSeparator.getValue(), thousands: this.inputThousandsSeparator.getValue()});
+ this.options.handler.call(this, state, {decimal: this.inputDecimalSeparator.getValue(), thousands: this.inputThousandsSeparator.getValue(),
+ qualifier: this.cmbQualifier.getValue()});
}
this.close();
@@ -137,7 +158,9 @@ define([
textTitle: 'Advanced Settings',
textLabel: 'Settings used to recognize numeric data',
strDecimalSeparator: 'Decimal separator',
- strThousandsSeparator: 'Thousands separator'
+ strThousandsSeparator: 'Thousands separator',
+ txtNone: '(none)',
+ textQualifier: 'Text qualifier'
}, SSE.Views.AdvancedSeparatorDialog || {}));
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 0a8faae975..4018673a4d 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -1432,6 +1432,8 @@
"SSE.Views.AdvancedSeparatorDialog.strThousandsSeparator": "Thousands separator",
"SSE.Views.AdvancedSeparatorDialog.textLabel": "Settings used to recognize numeric data",
"SSE.Views.AdvancedSeparatorDialog.textTitle": "Advanced Settings",
+ "SSE.Views.AdvancedSeparatorDialog.txtNone": "(none)",
+ "SSE.Views.AdvancedSeparatorDialog.textQualifier": "Text qualifier",
"SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter",
"SSE.Views.AutoFilterDialog.textAddSelection": "Add current selection to filter",
"SSE.Views.AutoFilterDialog.textEmptyItem": "{Blanks}",