X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FThesaurus.cpp;h=1c1adc03b0e22cb91154ac21e396957b05997bb3;hb=5be391b274f2cbf4a1da03bc5ee2136cb6c4e660;hp=e2c28183ee9499601c418153ff2d253fb966bd1f;hpb=e30f3d76d2bee0011ceaeb5f0cc221156458cbad;p=lyx.git diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp index e2c28183ee..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 @@ -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)); }