From f9ab4318e2f607f24a2e4f651b71894187e164b5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 18 Apr 2017 16:16:03 +0300 Subject: [PATCH] [SSE] Fix Bug 34790. --- .../main/app/controller/Toolbar.js | 20 +++++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 2e7dc6f1b..afcb9ede3 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -810,7 +810,20 @@ define([ props = me.api.asc_getChartObject(); if (props) { props.putType(record.get('type')); - (ischartedit) ? me.api.asc_editChartDrawingObject(props) : me.api.asc_addChartDrawingObject(props); + var range = props.getRange(), + isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, !props.getInColumns(), props.getType()); + if (isvalid == Asc.c_oAscError.ID.No) { + (ischartedit) ? me.api.asc_editChartDrawingObject(props) : me.api.asc_addChartDrawingObject(props); + } else { + Common.UI.warning({ + msg: (isvalid == Asc.c_oAscError.ID.StockChartError) ? me.errorStockChart : ((isvalid == Asc.c_oAscError.ID.MaxDataSeriesError) ? me.errorMaxRows : me.txtInvalidRange), + callback: function() { + _.defer(function(btn) { + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + }) + } + }); + } } } } @@ -3055,7 +3068,10 @@ define([ txtSorting: 'Sorting', txtSortSelected: 'Sort selected', textLongOperation: 'Long operation', - warnLongOperation: 'The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?' + warnLongOperation: 'The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?', + txtInvalidRange: 'ERROR! Invalid cells range', + errorMaxRows: 'ERROR! The maximum number of data series per chart is 255.', + errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:
opening price, max price, min price, closing price.' }, SSE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 70aaa91b8..7f399ded7 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -365,6 +365,8 @@ "SSE.Controllers.Statusbar.warnDeleteSheet": "The worksheet might contain data. Are you sure you want to proceed?", "SSE.Controllers.Statusbar.zoomText": "Zoom {0}%", "SSE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?", + "SSE.Controllers.Toolbar.errorMaxRows": "ERROR! The maximum number of data series per chart is 255", + "SSE.Controllers.Toolbar.errorStockChart": "Incorrect row order. To build a stock chart place the data on the sheet in the following order:
opening price, max price, min price, closing price.", "SSE.Controllers.Toolbar.textAccent": "Accents", "SSE.Controllers.Toolbar.textBracket": "Brackets", "SSE.Controllers.Toolbar.textCancel": "Cancel", @@ -372,6 +374,7 @@ "SSE.Controllers.Toolbar.textFraction": "Fractions", "SSE.Controllers.Toolbar.textFunction": "Functions", "SSE.Controllers.Toolbar.textIntegral": "Integrals", + "SSE.Controllers.Toolbar.txtInvalidRange": "ERROR! Invalid cells range", "SSE.Controllers.Toolbar.textLargeOperator": "Large Operators", "SSE.Controllers.Toolbar.textLimitAndLog": "Limits And Logarithms", "SSE.Controllers.Toolbar.textMatrix": "Matrices",