diff --git a/apps/common/main/lib/view/SearchPanel.js b/apps/common/main/lib/view/SearchPanel.js index 262c049149..ed4038090e 100644 --- a/apps/common/main/lib/view/SearchPanel.js +++ b/apps/common/main/lib/view/SearchPanel.js @@ -128,6 +128,15 @@ define([ dataHintOffset: 'small' }); + this.chMatchWord = new Common.UI.CheckBox({ + el: $('#search-adv-match-word'), + labelText: window.SSE ? this.textItemEntireCell : this.textWholeWords, + value: false, + dataHint: '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.buttonClose = new Common.UI.Button({ parentEl: $('#search-btn-close', this.$el), cls: 'btn-toolbar', @@ -137,15 +146,6 @@ define([ this.buttonClose.on('click', _.bind(this.onClickClosePanel, this)); if (window.SSE) { - this.chMatchWord = new Common.UI.CheckBox({ - el: $('#search-adv-match-word'), - labelText: this.options.matchwordstr || this.textWholeWords, - value: false, - dataHint: '1', - dataHintDirection: 'left', - dataHintOffset: 'small' - }); - this.cmbWithin = new Common.UI.ComboBox({ el: $('#search-adv-cmb-within'), menuStyle: 'min-width: 100%;', @@ -303,7 +303,8 @@ define([ textValues: 'Values', textSearchOptions: 'Search options', textNoMatches: 'No matches', - textNoSearchResults: 'No search results' + textNoSearchResults: 'No search results', + textItemEntireCell: 'Entire cell contents' }, Common.Views.SearchPanel || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Search.js b/apps/documenteditor/main/app/controller/Search.js index a4c1f99225..620cc35e84 100644 --- a/apps/documenteditor/main/app/controller/Search.js +++ b/apps/documenteditor/main/app/controller/Search.js @@ -89,7 +89,11 @@ define([ onQuerySearch: function (d, w, opts) { if (opts.textsearch && opts.textsearch.length) { - if (!this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase)) { + var searchSettings = new AscCommon.CSearchSettings(); + searchSettings.put_Text(opts.textsearch); + searchSettings.put_MatchCase(opts.matchcase); + searchSettings.put_WholeWords(opts.matchword); + if (!this.api.asc_findText(searchSettings, d != 'back')) { var me = this; me.view.updateResultsNumber(undefined, 0); Common.UI.info({ @@ -104,7 +108,11 @@ define([ onQueryReplace: function(w, opts) { if (!_.isEmpty(opts.textsearch)) { - if (!this.api.asc_replaceText(opts.textsearch, opts.textreplace, false, opts.matchcase)) { + var searchSettings = new AscCommon.CSearchSettings(); + searchSettings.put_Text(opts.textsearch); + searchSettings.put_MatchCase(opts.matchcase); + searchSettings.put_WholeWords(opts.matchword); + if (!this.api.asc_replaceText(searchSettings, opts.textreplace, false)) { var me = this; me.view.updateResultsNumber(undefined, 0); Common.UI.info({ @@ -119,7 +127,11 @@ define([ onQueryReplaceAll: function(w, opts) { if (!_.isEmpty(opts.textsearch)) { - this.api.asc_replaceText(opts.textsearch, opts.textreplace, true, opts.matchcase, opts.matchword); + var searchSettings = new AscCommon.CSearchSettings(); + searchSettings.put_Text(opts.textsearch); + searchSettings.put_MatchCase(opts.matchcase); + searchSettings.put_WholeWords(opts.matchword); + this.api.asc_replaceText(searchSettings, opts.textreplace, true); } }, diff --git a/apps/presentationeditor/main/app/controller/Search.js b/apps/presentationeditor/main/app/controller/Search.js index 34fa0f473a..b170b4901b 100644 --- a/apps/presentationeditor/main/app/controller/Search.js +++ b/apps/presentationeditor/main/app/controller/Search.js @@ -89,7 +89,11 @@ define([ onQuerySearch: function (d, w, opts) { if (opts.textsearch && opts.textsearch.length) { - if (!this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase)) { + var searchSettings = new AscCommon.CSearchSettings(); + searchSettings.put_Text(opts.textsearch); + searchSettings.put_MatchCase(opts.matchcase); + searchSettings.put_WholeWords(opts.matchword); + if (!this.api.asc_findText(searchSettings, d != 'back')) { var me = this; me.view.updateResultsNumber(undefined, 0); Common.UI.info({ @@ -104,7 +108,11 @@ define([ onQueryReplace: function(w, opts) { if (!_.isEmpty(opts.textsearch)) { - if (!this.api.asc_replaceText(opts.textsearch, opts.textreplace, false, opts.matchcase)) { + var searchSettings = new AscCommon.CSearchSettings(); + searchSettings.put_Text(opts.textsearch); + searchSettings.put_MatchCase(opts.matchcase); + searchSettings.put_WholeWords(opts.matchword); + if (!this.api.asc_replaceText(searchSettings, opts.textreplace, false)) { var me = this; me.view.updateResultsNumber(undefined, 0); Common.UI.info({ @@ -119,7 +127,11 @@ define([ onQueryReplaceAll: function(w, opts) { if (!_.isEmpty(opts.textsearch)) { - this.api.asc_replaceText(opts.textsearch, opts.textreplace, true, opts.matchcase); + var searchSettings = new AscCommon.CSearchSettings(); + searchSettings.put_Text(opts.textsearch); + searchSettings.put_MatchCase(opts.matchcase); + searchSettings.put_WholeWords(opts.matchword); + this.api.asc_replaceText(searchSettings, opts.textreplace, true); } },