mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
[se] By bug 60909: switch on search engine + fix only sheet option (#3305)
This commit is contained in:
31
cell/api.js
31
cell/api.js
@ -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);
|
||||
|
||||
@ -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;};
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user