X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FThesaurus.cpp;h=1c1adc03b0e22cb91154ac21e396957b05997bb3;hb=210ea66d2d1113cddcc1b0f3547c1063b7dc4d47;hp=7830c6e1ef225f020906820c24cc5d2d674b827a;hpb=75bfed55079cab6b73fbea6ce4ae3f10d1af3b91;p=lyx.git diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp index 7830c6e1ef..1c1adc03b0 100644 --- a/src/Thesaurus.cpp +++ b/src/Thesaurus.cpp @@ -21,17 +21,15 @@ #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 #include MYTHES_H_LOCATION -#include "frontends/alert.h" - #include #include #include @@ -46,7 +44,7 @@ namespace { typedef std::map 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)); }