[DE] Fix applying formula

This commit is contained in:
Julia Radzhabova 2019-03-05 16:28:01 +03:00
parent 6da70788da
commit a957cfcaca

View file

@ -188,11 +188,9 @@ define([
arr.push({value: item, displayValue: item}); arr.push({value: item, displayValue: item});
}); });
this.cmbFormat.setData(arr); this.cmbFormat.setData(arr);
var formula = this.api.asc_GetTableFormula(), var formula = this.api.asc_ParseTableFormulaInstrLine(this.api.asc_GetTableFormula());
idx = formula.lastIndexOf('\\#'); this.inputFormula.setValue(formula[0]);
this.inputFormula.setValue(formula.substring(0, (idx>-1) ? idx : formula.length)); this.cmbFormat.setValue(formula[1]);
if (idx>-1)
this.cmbFormat.setValue(formula.substring(idx+2, formula.length));
this.checkFormulaInput(this.inputFormula, this.inputFormula.getValue()); this.checkFormulaInput(this.inputFormula, this.inputFormula.getValue());
}, },
@ -218,7 +216,7 @@ define([
}, },
getSettings: function () { getSettings: function () {
return (this.inputFormula.getValue() + '\\#' + this.cmbFormat.getValue()); return this.api.asc_CreateInstructionLine(this.inputFormula.getValue(), this.cmbFormat.getValue());
}, },
onBtnClick: function(event) { onBtnClick: function(event) {