X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FThesaurus.cpp;h=fcec80bef55aa81afbfdc7c1bd3ef874a3a3266f;hb=55a3dd7b346d29a52ba305a4558e9e380ef50f47;hp=d21453ab0fb01dc2e75e92487509411ce4cd3a95;hpb=598d185adaca79709d5768ee2c522c44b43c206d;p=lyx.git diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp index d21453ab0f..fcec80bef5 100644 --- a/src/Thesaurus.cpp +++ b/src/Thesaurus.cpp @@ -23,7 +23,12 @@ #include "support/lstrings.h" #include "support/os.h" +#ifdef USE_EXTERNAL_MYTHES +#include MYTHES_H_LOCATION +#else +#include #include "support/mythes/mythes.hxx" +#endif #include "frontends/alert.h" @@ -222,17 +227,17 @@ Thesaurus::Meanings Thesaurus::lookup(docstring const & t, docstring const & lan // they are needed for the CleanUpAfterLookup routine mentry * pm = pmean; docstring meaning; - docstring ret; for (int i = 0; i < count; i++) { + vector ret; meaning = from_iconv_encoding(string(pm->defn), encoding); // remove silly item if (support::prefixIs(meaning, '-')) meaning = support::ltrim(meaning, "- "); for (int j = 0; j < pm->count; j++) { - ret = from_iconv_encoding(string(pm->psyns[j]), encoding); + ret.push_back(from_iconv_encoding(string(pm->psyns[j]), encoding)); } - meanings[meaning].push_back(ret); - pm++; + meanings[meaning] = ret; + ++pm; } // now clean up all allocated memory mythes->CleanUpAfterLookup(&pmean, count);