Commit 07dc2444 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add find in selection

bug 35003
parent 00af61e4
......@@ -2177,7 +2177,8 @@
this.isReplaceAll = false; // заменить все (если у нас замена)
// внутренние переменные
this.activeCell = null;
this.findInSelection = false;
this.selectionRange = null;
this.indexInArray = 0;
this.countFind = 0;
this.countReplace = 0;
......@@ -2199,7 +2200,8 @@
result.replaceWith = this.replaceWith;
result.isReplaceAll = this.isReplaceAll;
result.activeCell = this.activeCell ? this.activeCell.clone() : null;
result.findInSelection = this.findInSelection;
result.selectionRange = this.selectionRange ? this.selectionRange.clone() : null;
result.indexInArray = this.indexInArray;
result.countFind = this.countFind;
result.countReplace = this.countReplace;
......@@ -2210,7 +2212,7 @@
return result;
};
asc_CFindOptions.prototype.isEqual = function (obj) {
return null != obj && this.findWhat === obj.findWhat && this.scanByRows === obj.scanByRows &&
return obj && this.findWhat === obj.findWhat && this.scanByRows === obj.scanByRows &&
this.scanForward === obj.scanForward && this.isMatchCase === obj.isMatchCase &&
this.isWholeCell === obj.isWholeCell && this.scanOnOnlySheet === obj.scanOnOnlySheet &&
this.lookIn === obj.lookIn;
......
......@@ -2228,7 +2228,7 @@
// Поиск текста в листе
WorkbookView.prototype.findCellText = function(options) {
// Для поиска эта переменная не нужна (но она может остаться от replace)
options.activeCell = null;
options.selectionRange = null;
var ws = this.getWorksheet();
// Останавливаем ввод данных в редакторе ввода
......@@ -2290,7 +2290,9 @@
}
if (result) {
return ws.setSelection(result);
var ac = ws.model.selectionRange.activeCell;
return options.findInSelection ? ws.changeSelectionActivePoint(result.c1 - ac.col, result.r1 - ac.row) :
ws.setSelection(result);
}
this._cleanFindResults();
return null;
......
This diff is collapsed.
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