]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSearch.cpp
fix scrolling bug: 3320 and 3652, maybe not perfect
[lyx.git] / src / frontends / controllers / ControlSearch.cpp
1 /**
2  * \file ControlSearch.cpp
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 namespace lyx {
19 namespace frontend {
20
21 ControlSearch::ControlSearch(Dialog & parent)
22         : Dialog::Controller(parent)
23 {}
24
25
26 void ControlSearch::find(docstring const & search, bool casesensitive,
27                          bool matchword, bool forward)
28 {
29         docstring const data = find2string(search, casesensitive,
30                                               matchword, forward);
31         kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data));
32 }
33
34
35 void ControlSearch::replace(docstring const & search, docstring const & replace,
36                             bool casesensitive, bool matchword,
37                             bool forward, bool all)
38 {
39         docstring const data =
40                 replace2string(search, replace, casesensitive,
41                                      matchword, all, forward);
42         kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
43 }
44
45 } // namespace frontend
46 } // namespace lyx