Commit af3ac6e5 authored by Alexander.Trofimov's avatar Alexander.Trofimov

delete argument skipNLCheck

parent 1a300e3b
......@@ -319,9 +319,9 @@
};
CellEditor.prototype.close = function (saveValue) {
var opt = this.options, ret;
var opt = this.options;
if (saveValue && "function" === typeof opt.saveValueCallback) {
if (saveValue) {
var isFormula = this.isFormula();
// Для формул делаем пересчет всегда. Для остального - только если мы изменили что-то. http://bugzilla.onlyoffice.com/show_bug.cgi?id=31889
// Сюда же добавляется и ячейка с wrap-текстом, у которой выключен wrap.
......@@ -336,8 +336,7 @@
this.noUpdateMode = false;
}
ret = opt.saveValueCallback(opt.fragments, this.textFlags, /*skip NL check*/ret);
if (!ret) {
if (!opt.saveValueCallback(opt.fragments, this.textFlags)) {
// При ошибке нужно выставить флаг, чтобы по стрелкам не закрывался редактор
this.handlers.trigger('setStrictClose', true);
return false;
......@@ -786,7 +785,7 @@
this.options.fragments), t = this, ret = false, range, wsOPEN = this.handlers.trigger(
"getCellFormulaEnterWSOpen"), ws = wsOPEN ? wsOPEN.model : this.handlers.trigger("getActiveWS");
if (s.length < 1 || s.charAt(0) !== "=" || this.options.cellNumFormat == Asc.c_oAscNumFormatType.Text) {
if (Asc.c_oAscNumFormatType.Text === this.options.cellNumFormat || s.length < 1 || s.charAt(0) !== "=") {
return ret;
}
......
......@@ -11261,8 +11261,8 @@
newValue = [];
newValue[0] = new AscCommonExcel.Fragment({text: cellValue, format: v[0].format.clone()});
if (!t._saveCellValueAfterEdit(oCellEdit, c, newValue, /*flags*/undefined, /*skipNLCheck*/false,
/*isNotHistory*/true, /*lockDraw*/true)) {
if (!t._saveCellValueAfterEdit(oCellEdit, c, newValue, /*flags*/undefined, /*isNotHistory*/true,
/*lockDraw*/true)) {
options.error = true;
t.draw(lockDraw);
return callback(options);
......@@ -11466,19 +11466,17 @@
return mergedRange ? mergedRange : new asc_Range(col, row, col, row);
};
WorksheetView.prototype._saveCellValueAfterEdit =
function (oCellEdit, c, val, flags, skipNLCheck, isNotHistory, lockDraw) {
WorksheetView.prototype._saveCellValueAfterEdit = function (oCellEdit, c, val, flags, isNotHistory, lockDraw) {
var t = this;
var oldMode = t.isFormulaEditMode;
t.isFormulaEditMode = false;
var oldMode = this.isFormulaEditMode;
this.isFormulaEditMode = false;
if (!isNotHistory) {
History.Create_NewPoint();
History.StartTransaction();
}
var isFormula = t._isFormula(val);
var isFormula = this._isFormula(val);
if (isFormula) {
var ftext = val.reduce(function (pv, cv) {
return pv + cv.text;
......@@ -11489,21 +11487,19 @@
ret = r;
});
if (!ret) {
t.isFormulaEditMode = oldMode;
this.isFormulaEditMode = oldMode;
History.EndTransaction();
return false;
}
isFormula = c.isFormula();
t.model.autoFilters.renameTableColumn(oCellEdit);
this.model.autoFilters.renameTableColumn(oCellEdit);
} else {
c.setValue2(val);
// Вызываем функцию пересчета для заголовков форматированной таблицы
t.model.autoFilters.renameTableColumn(oCellEdit);
this.model.autoFilters.renameTableColumn(oCellEdit);
}
if (!isFormula) {
// Нужно ли выставлять WrapText (ищем символ новой строки в тексте)
if (!skipNLCheck) {
for (var i = 0; i < val.length; ++i) {
if (-1 !== val[i].text.indexOf(kNewLine)) {
c.setWrap(true);
......@@ -11511,9 +11507,8 @@
}
}
}
}
t._updateCellsRange(oCellEdit, isNotHistory ? c_oAscCanChangeColWidth.none : c_oAscCanChangeColWidth.numbers,
this._updateCellsRange(oCellEdit, isNotHistory ? c_oAscCanChangeColWidth.none : c_oAscCanChangeColWidth.numbers,
lockDraw);
if (!isNotHistory) {
......@@ -11612,15 +11607,15 @@
isClearCell: isClearCell,
isHideCursor: isHideCursor,
isQuickInput: isQuickInput,
isAddPersentFormat: isQuickInput && Asc.c_oAscNumFormatType.Percent === c.getNumFormat().getType(),
isAddPersentFormat: isQuickInput && Asc.c_oAscNumFormatType.Percent === c.getNumFormatType(),
autoComplete: arrAutoComplete,
autoCompleteLC: arrAutoCompleteLC,
cellName: c.getName(),
cellNumFormat: c.getNumFormatType(),
saveValueCallback: function (val, flags, skipNLCheck) {
saveValueCallback: function (val, flags) {
var oCellEdit = isMerged ? new asc_Range(mc.c1, mc.r1, mc.c1, mc.r1) :
new asc_Range(col, row, col, row);
return t._saveCellValueAfterEdit(oCellEdit, c, val, flags, skipNLCheck, /*isNotHistory*/false,
return t._saveCellValueAfterEdit(oCellEdit, c, val, flags, /*isNotHistory*/false,
/*lockDraw*/false);
},
getSides: function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment