2 * \file ControlThesaurus.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
12 #pragma implementation
15 #include "ControlThesaurus.h"
17 #include "ButtonControllerBase.h"
24 #include "BufferView.h"
26 #include "frontends/LyXView.h"
28 #include <boost/bind.hpp>
30 using Liason::setMinibuffer;
32 ControlThesaurus::ControlThesaurus(LyXView & lv, Dialogs & d)
33 : ControlDialogBD(lv, d)
35 d_.showThesaurus = boost::bind(&ControlThesaurus::showEntry, this, _1);
39 void ControlThesaurus::showEntry(string const & entry)
46 void ControlThesaurus::replace(string const & newstr)
48 /* FIXME: this is not suitable ! We need to have a "lock"
49 * on a particular charpos in a paragraph that is broken on
52 int const replace_count = LyXReplace(lv_.view(), oldstr_, newstr,
53 true, true, true, false, true);
57 if (replace_count == 0)
58 setMinibuffer(&lv_, _("String not found!"));
60 setMinibuffer(&lv_, _("String has been replaced."));
64 Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str)
67 meanings_ = thesaurus.lookup(str);