]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlSearch.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlSearch.C
index 5bd503ad018d7f37971907eb9c95f0fca14a43f8..b0e46a52dcc0680f0ef0d5baa5c7f834a7bdb4c2 100644 (file)
 #include "funcrequest.h"
 #include "lyxfind.h"
 
-#include "frontends/LyXView.h"
-
 using std::string;
 
+namespace lyx {
+namespace frontend {
 
-/* The ControlSeach class is now in a fit state to derive from
-   Dialog::Controller
-*/
-ControlSearch::ControlSearch(LyXView & lv, Dialogs & d)
-       : ControlDialogBD(lv, d)
+ControlSearch::ControlSearch(Dialog & parent)
+       : Dialog::Controller(parent)
 {}
 
 
-void ControlSearch::find(string const & search,
-                        bool casesensitive, bool matchword, bool forward)
+void ControlSearch::find(string const & search, bool casesensitive,
+                        bool matchword, bool forward)
 {
-       string const data =
-               lyx::find::find2string(search,
-                                      casesensitive, matchword, forward);
-       lv_.dispatch(FuncRequest(LFUN_WORD_FIND, data));
+       string const data = find::find2string(search, casesensitive,
+                                             matchword, forward);
+       kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data));
 }
 
 
 void ControlSearch::replace(string const & search, string const & replace,
-                           bool casesensitive, bool matchword, bool forward, bool all)
+                           bool casesensitive, bool matchword,
+                           bool forward, bool all)
 {
        string const data =
-               lyx::find::replace2string(search, replace,
-                                         casesensitive, matchword, all, forward);
-       lv_.dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
+               find::replace2string(search, replace, casesensitive,
+                                    matchword, all, forward);
+       kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
 }
+
+} // namespace frontend
+} // namespace lyx