]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSearch.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlSearch.C
1 /**
2  * \file ControlSearch.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlSearch.h"
14
15 #include "funcrequest.h"
16 #include "lyxfind.h"
17
18 using std::string;
19
20 namespace lyx {
21 namespace frontend {
22
23 ControlSearch::ControlSearch(Dialog & parent)
24         : Dialog::Controller(parent)
25 {}
26
27
28 void ControlSearch::find(string const & search, bool casesensitive,
29                          bool matchword, bool forward)
30 {
31         string const data = find::find2string(search, casesensitive,
32                                               matchword, forward);
33         kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data));
34 }
35
36
37 void ControlSearch::replace(string const & search, string const & replace,
38                             bool casesensitive, bool matchword,
39                             bool forward, bool all)
40 {
41         string const data =
42                 find::replace2string(search, replace, casesensitive,
43                                      matchword, all, forward);
44         kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
45 }
46
47 } // namespace frontend
48 } // namespace lyx