From c254f2c93a23ab1f4000bb0b1d46d0983c3264dc Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Thu, 27 May 2021 15:41:15 +0300 Subject: [PATCH] Corrected replace all --- apps/common/mobile/lib/view/Search.jsx | 2 +- apps/documenteditor/mobile/src/controller/Search.jsx | 4 ++-- apps/presentationeditor/mobile/src/controller/Search.jsx | 4 ++-- apps/spreadsheeteditor/mobile/src/controller/Search.jsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/common/mobile/lib/view/Search.jsx b/apps/common/mobile/lib/view/Search.jsx index 4bf67427d..702ad94e1 100644 --- a/apps/common/mobile/lib/view/Search.jsx +++ b/apps/common/mobile/lib/view/Search.jsx @@ -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(); } diff --git a/apps/documenteditor/mobile/src/controller/Search.jsx b/apps/documenteditor/mobile/src/controller/Search.jsx index a61230b9f..31b888efc 100644 --- a/apps/documenteditor/mobile/src/controller/Search.jsx +++ b/apps/documenteditor/mobile/src/controller/Search.jsx @@ -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); } } diff --git a/apps/presentationeditor/mobile/src/controller/Search.jsx b/apps/presentationeditor/mobile/src/controller/Search.jsx index 3f9706fb2..9cf8975d4 100644 --- a/apps/presentationeditor/mobile/src/controller/Search.jsx +++ b/apps/presentationeditor/mobile/src/controller/Search.jsx @@ -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); } } diff --git a/apps/spreadsheeteditor/mobile/src/controller/Search.jsx b/apps/spreadsheeteditor/mobile/src/controller/Search.jsx index 6deb8480e..ee4613c56 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Search.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Search.jsx @@ -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);