#include <config.h>
-
#include "ControlThesaurus.h"
-#include "gettext.h"
#include "lyxfind.h"
-
-#include "frontends/LyXView.h"
-
+#include "funcrequest.h"
using std::string;
+namespace lyx {
+namespace frontend {
ControlThesaurus::ControlThesaurus(Dialog & parent)
: Dialog::Controller(parent)
* on a particular charpos in a paragraph that is broken on
* deletion/change !
*/
- int const replace_count =
- lyx::find::replace(kernel().bufferview(), oldstr_, newstr,
- true /*cs*/, true /*mw*/, true /*fw*/);
-
- oldstr_ = newstr;
-
- if (replace_count == 0)
- kernel().lyxview().message(_("String not found!"));
- else
- kernel().lyxview().message(_("String has been replaced."));
+ string const data =
+ find::replace2string(oldstr_, newstr,
+ true, // case sensitive
+ true, // match word
+ false, // all words
+ true); // forward
+ kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
}
-Thesaurus::Meanings const &
-ControlThesaurus::getMeanings(string const & str)
+Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str)
{
if (str != laststr_)
meanings_ = thesaurus.lookup(str);
-
return meanings_;
}
+
+} // namespace frontend
+} // namespace lyx