Corrected replace all

This commit is contained in:
SergeyEzhin 2021-05-27 15:41:15 +03:00
parent dcfc625408
commit c254f2c93a
4 changed files with 7 additions and 7 deletions

View file

@ -151,7 +151,7 @@ class SearchView extends Component {
find: this.searchbar.query
};
if (searchOptions.usereplace) {
if (searchOptions.usereplace || searchOptions.isReplaceAll) {
params.replace = this.$replace.val();
}

View file

@ -100,7 +100,7 @@ const Search = withTranslation()(props => {
const api = Common.EditorApi.get();
if (params.find && params.find.length) {
api.asc_replaceText(params.find, params.replace, false, params.caseSensitive, params.highlight);
api.asc_replaceText(params.find, params.replace || '', false, params.caseSensitive, params.highlight);
}
}
@ -108,7 +108,7 @@ const Search = withTranslation()(props => {
const api = Common.EditorApi.get();
if (params.find && params.find.length) {
api.asc_replaceText(params.find, params.replace, true, params.caseSensitive, params.highlight);
api.asc_replaceText(params.find, params.replace || '', true, params.caseSensitive, params.highlight);
}
}

View file

@ -82,7 +82,7 @@ const Search = withTranslation()(props => {
const api = Common.EditorApi.get();
if (params.find && params.find.length) {
api.asc_replaceText(params.find, params.replace, false, params.caseSensitive);
api.asc_replaceText(params.find, params.replace || '', false, params.caseSensitive);
}
}
@ -90,7 +90,7 @@ const Search = withTranslation()(props => {
const api = Common.EditorApi.get();
if (params.find && params.find.length) {
api.asc_replaceText(params.find, params.replace, true, params.caseSensitive);
api.asc_replaceText(params.find, params.replace || '', true, params.caseSensitive);
}
}

View file

@ -167,7 +167,7 @@ const Search = withTranslation()(props => {
let options = new Asc.asc_CFindOptions();
options.asc_setFindWhat(params.find);
options.asc_setReplaceWith(params.replace);
options.asc_setReplaceWith(params.replace || '');
options.asc_setIsMatchCase(params.caseSensitive);
options.asc_setIsWholeCell(params.matchCell);
options.asc_setScanOnOnlySheet(searchIn);
@ -191,7 +191,7 @@ const Search = withTranslation()(props => {
let options = new Asc.asc_CFindOptions();
options.asc_setFindWhat(params.find);
options.asc_setReplaceWith(params.replace);
options.asc_setReplaceWith(params.replace || '');
options.asc_setIsMatchCase(params.caseSensitive);
options.asc_setIsWholeCell(params.matchCell);
options.asc_setScanOnOnlySheet(searchIn);