From ae071c427dad20560d1ca281bb32fb8b31d4372c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Jan 2024 21:33:07 +0300 Subject: [PATCH] [SSE] Bug 65923 --- .../main/app/view/FillSeriesDialog.js | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js index 195fcc08d7..bea22c982a 100644 --- a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js @@ -305,16 +305,6 @@ define([ }, getSettings: function () { - if (this.isStepChanged) { - var value = this.inputStep.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - this._changedProps.asc_setStepValue(value!=='' ? parseFloat(value) : null); - } - if (this.isStopChanged) { - var value = this.inputStop.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - this._changedProps.asc_setStopValue(value!=='' ? parseFloat(value) : null); - } return this._changedProps; }, @@ -338,26 +328,25 @@ define([ }, isValid: function() { - var regstr = new RegExp('^\s*[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)\s*$'); if (this.isStepChanged) { - var value = this.inputStep.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - if (value!=='' && (!regstr.test(value.trim()) || isNaN(parseFloat(value)))) { + var res = this._changedProps.asc_isValidStepValue(this.inputStep.getValue()); + if (res[0]!==Asc.c_oAscError.ID.No || res[1]===null) { this.inputStep.showError([this.txtErrorNumber]); this.inputStep.focus(); this.isInputStepFirstChange = true; return false; - } + } else + this._changedProps.asc_setStepValue(res[1]); } if (this.isStopChanged) { - var value = this.inputStop.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - if (value!=='' && (!regstr.test(value.trim()) || isNaN(parseFloat(value)))) { + var res = this._changedProps.asc_isValidStepValue(this.inputStop.getValue()); + if (res[0]!==Asc.c_oAscError.ID.No || res[1]===null) { this.inputStop.showError([this.txtErrorNumber]); this.inputStop.focus(); this.isInputStopFirstChange = true; return false; - } + } else + this._changedProps.asc_setStopValue(res[1]); } return true; },