]> git.lyx.org Git - lyx.git/blobdiff - src/Thesaurus.cpp
listerrors.lyx : Update a link.
[lyx.git] / src / Thesaurus.cpp
index d21453ab0fb01dc2e75e92487509411ce4cd3a95..fcec80bef55aa81afbfdc7c1bd3ef874a3a3266f 100644 (file)
 #include "support/lstrings.h"
 #include "support/os.h"
 
+#ifdef USE_EXTERNAL_MYTHES
+#include MYTHES_H_LOCATION
+#else
+#include <cstdio>
 #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<docstring> 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);