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

fix bug 33608 🐛

parent c5828af2
...@@ -1881,6 +1881,7 @@ ...@@ -1881,6 +1881,7 @@
this.countFindAll = 0; this.countFindAll = 0;
this.countReplaceAll = 0; this.countReplaceAll = 0;
this.sheetIndex = -1; this.sheetIndex = -1;
this.error = false;
} }
asc_CFindOptions.prototype.clone = function () { asc_CFindOptions.prototype.clone = function () {
var result = new asc_CFindOptions(); var result = new asc_CFindOptions();
...@@ -1902,6 +1903,7 @@ ...@@ -1902,6 +1903,7 @@
result.countFindAll = this.countFindAll; result.countFindAll = this.countFindAll;
result.countReplaceAll = this.countReplaceAll; result.countReplaceAll = this.countReplaceAll;
result.sheetIndex = this.sheetIndex; result.sheetIndex = this.sheetIndex;
result.error = this.error;
return result; return result;
}; };
asc_CFindOptions.prototype.isEqual = function (obj) { asc_CFindOptions.prototype.isEqual = function (obj) {
...@@ -1913,6 +1915,7 @@ ...@@ -1913,6 +1915,7 @@
asc_CFindOptions.prototype.clearFindAll = function () { asc_CFindOptions.prototype.clearFindAll = function () {
this.countFindAll = 0; this.countFindAll = 0;
this.countReplaceAll = 0; this.countReplaceAll = 0;
this.error = false;
}; };
asc_CFindOptions.prototype.updateFindAll = function () { asc_CFindOptions.prototype.updateFindAll = function () {
this.countFindAll += this.countFind; this.countFindAll += this.countFind;
......
...@@ -2246,23 +2246,25 @@ ...@@ -2246,23 +2246,25 @@
ws.replaceCellText(options, false, this.fReplaceCallback); ws.replaceCellText(options, false, this.fReplaceCallback);
}; };
WorkbookView.prototype._replaceCellTextCallback = function(options) { WorkbookView.prototype._replaceCellTextCallback = function(options) {
options.updateFindAll(); if (!options.error) {
if (!options.scanOnOnlySheet && options.isReplaceAll) { options.updateFindAll();
// Замена на всей книге if (!options.scanOnOnlySheet && options.isReplaceAll) {
var i = ++options.sheetIndex; // Замена на всей книге
if (this.model.getActive() === i) { var i = ++options.sheetIndex;
i = ++options.sheetIndex; if (this.model.getActive() === i) {
} i = ++options.sheetIndex;
}
if (i < this.model.getWorksheetCount()) {
var ws = this.getWorksheet(i);
ws.replaceCellText(options, true, this.fReplaceCallback);
return;
}
}
if (i < this.model.getWorksheetCount()) { this.handlers.trigger("asc_onRenameCellTextEnd", options.countFindAll, options.countReplaceAll);
var ws = this.getWorksheet(i);
ws.replaceCellText(options, true, this.fReplaceCallback);
return;
}
} }
this.handlers.trigger("asc_onRenameCellTextEnd", options.countFindAll, options.countReplaceAll);
History.EndTransaction(); History.EndTransaction();
if (options.isReplaceAll) { if (options.isReplaceAll) {
// Заканчиваем медленную операцию // Заканчиваем медленную операцию
......
...@@ -10599,8 +10599,12 @@ ...@@ -10599,8 +10599,12 @@
newValue = []; newValue = [];
newValue[0] = new AscCommonExcel.Fragment({text: cellValue, format: v[0].format.clone()}); newValue[0] = new AscCommonExcel.Fragment({text: cellValue, format: v[0].format.clone()});
t._saveCellValueAfterEdit(oCellEdit, c, newValue, /*flags*/undefined, /*skipNLCheck*/false, if (!t._saveCellValueAfterEdit(oCellEdit, c, newValue, /*flags*/undefined, /*skipNLCheck*/false,
/*isNotHistory*/true, /*lockDraw*/true); /*isNotHistory*/true, /*lockDraw*/true)) {
options.error = true;
t.draw(lockDraw);
return callback(options);
}
} }
window.setTimeout(function () { window.setTimeout(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