]> git.lyx.org Git - lyx.git/blobdiff - src/Thesaurus.cpp
* cs.po
[lyx.git] / src / Thesaurus.cpp
index 7830c6e1ef225f020906820c24cc5d2d674b827a..1c1adc03b0e22cb91154ac21e396957b05997bb3 100644 (file)
 #include "support/FileNameList.h"
 #include "support/Package.h"
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/docstring_list.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 
 #include <cstdio>
 #include MYTHES_H_LOCATION
 
-#include "frontends/alert.h"
-
 #include <algorithm>
 #include <cstring>
 #include <fstream>
@@ -46,7 +44,7 @@ namespace {
 
 typedef std::map<docstring, MyThes *> Thesauri;
 
-} // namespace anon
+} // namespace
 
 struct Thesaurus::Private
 {
@@ -216,10 +214,10 @@ bool Thesaurus::thesaurusInstalled(docstring const & lang) const
 Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl)
 {
        Meanings meanings;
-       MyThes * mythes = 0;
+       MyThes * mythes = nullptr;
 
        docstring const lang_code = from_ascii(wl.lang()->code());
-       docstring const t = wl.word();
+       docstring const t = wl.word();
 
        if (!d->addThesaurus(lang_code))
                return meanings;
@@ -268,6 +266,7 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl)
                // remove silly item
                if (support::prefixIs(meaning, '-'))
                        meaning = support::ltrim(meaning, "- ");
+               ret.reserve(pm->count);
                for (int j = 0; j < pm->count; j++) {
                        ret.push_back(from_iconv_encoding(string(pm->psyns[j]), encoding));
                }