[se] By bug 60909: switch on search engine + fix only sheet option (#3305)

This commit is contained in:
Igor Zotov
2023-01-31 20:29:04 +03:00
committed by GitHub
parent 120a217d58
commit e626767bd0
3 changed files with 24 additions and 20 deletions

View File

@ -4005,27 +4005,22 @@ var editor;
spreadsheet_api.prototype.asc_findText = function(options, callback) {
var result = null;
if (window["NATIVE_EDITOR_ENJINE"]) {
if (this.wb.findCellText(options)) {
var ws = this.wb.getWorksheet();
var activeCell = this.wbModel.getActiveWs().selectionRange.activeCell;
result = [ws.getCellLeftRelative(activeCell.col, 0), ws.getCellTopRelative(activeCell.row, 0)];
}
} else {
//***searchEngine
var SearchEngine = this.wb.Search(options);
var Id = this.wb.GetSearchElementId(!options || options.scanForward);
if (null != Id) {
this.wb.SelectSearchElement(Id);
}
//***searchEngine
var SearchEngine = this.wb.Search(options);
var Id = this.wb.GetSearchElementId(!options || options.scanForward);
if (null != Id) {
this.wb.SelectSearchElement(Id);
}
if (window["NATIVE_EDITOR_ENJINE"]) {
var ws = this.wb.getWorksheet();
var activeCell = this.wbModel.getActiveWs().selectionRange.activeCell;
result = [ws.getCellLeftRelative(activeCell.col, 0), ws.getCellTopRelative(activeCell.row, 0)];
} else {
result = SearchEngine.Count;
/* var d = this.wb.findCellText(options);
this.controller.scroll(d);
result = !!d;*/
}
}
if (callback)
callback(result);

View File

@ -3131,7 +3131,16 @@
asc_CFindOptions.prototype.asc_setIsWholeCell = function (val) {this.isWholeCell = val;};
asc_CFindOptions.prototype.asc_setIsWholeWord = function (val) {this.isWholeWord = val;};
asc_CFindOptions.prototype.asc_changeSingleWord = function (val) { this.isChangeSingleWord = val; };
asc_CFindOptions.prototype.asc_setScanOnOnlySheet = function (val) {this.scanOnOnlySheet = val;};
asc_CFindOptions.prototype.asc_setScanOnOnlySheet = function (val) {
//TODO не стал менять native.js, поставил условие для scanOnOnlySheet
if (val === true) {
this.scanOnOnlySheet = Asc.c_oAscSearchBy.Sheet;
} else if (val === false) {
this.scanOnOnlySheet = Asc.c_oAscSearchBy.Workbook;
} else {
this.scanOnOnlySheet = val;
}
};
asc_CFindOptions.prototype.asc_setLookIn = function (val) {this.lookIn = val;};
asc_CFindOptions.prototype.asc_setReplaceWith = function (val) {this.replaceWith = val;};
asc_CFindOptions.prototype.asc_setIsReplaceAll = function (val) {this.isReplaceAll = val;};

View File

@ -5334,7 +5334,7 @@
var elem = this.Elements[nId];
if (elem) {
var ws = this.wb.getWorksheet();
if (elem.index !== ws.index) {
if (elem.index !== ws.model.index) {
this.wb.model.handlers.trigger('undoRedoHideSheet', elem.index);
ws = this.wb.getWorksheet(elem.index);
}