From 1f62dbf053668017362b9b32e29786e65bc3be5f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Mar 2021 11:43:12 +0300 Subject: [PATCH] [SSE] Refactoring data from file --- apps/common/main/lib/view/OpenDialog.js | 3 +-- apps/spreadsheeteditor/main/app/controller/DataTab.js | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index a24aeb464..e59b5302b 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -73,7 +73,6 @@ define([ height = options.warning ? 187 : 147; break; } - // height = (options.type == Common.Utils.importTextType.CSV || options.type == Common.Utils.importTextType.Paste || options.type == Common.Utils.importTextType.Columns) ? 190 : (options.warning ? 187 : 147); } _.extend(_options, { @@ -423,7 +422,7 @@ define([ options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal); options.asc_setNumberGroupSeparator(this.separatorOptions.thousands); } - this.api.asc_TextFromFileOrUrl(options, _.bind(this.previewCallback, this), undefined, true); + this.api.asc_decodeBuffer(this.preview, options, _.bind(this.previewCallback, this)); break; } }, diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index d4748d2a0..2279c2c7a 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -253,16 +253,13 @@ define([ } }, - onDataFromTextCallback: function(data, advOptions) { - if (!data || !data.length) return; - + onDataFromTextCallback: function(advOptions) { var me = this; (new Common.Views.OpenDialog({ title: me.txtImportWizard, closable: true, type: Common.Utils.importTextType.Data, - preview: true, - previewData: data, + preview: advOptions.asc_getData(), settings: advOptions ? advOptions.asc_getRecommendedSettings() : me._state.CSVOptions, codepages: advOptions ? advOptions.asc_getCodePages() : null, api: me.api,