X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FWordList.cpp;h=2f8ce2bd524848245933ab5a2dad624235517f20;hb=3efc6385d7f6dbad8175411e74407c95e49b3881;hp=7dc620e0898e2fba99101d23a546021b118982bf;hpb=9b4a26a252b2da164fcd6aa84feed0a738b16c10;p=lyx.git diff --git a/src/WordList.cpp b/src/WordList.cpp index 7dc620e089..2f8ce2bd52 100644 --- a/src/WordList.cpp +++ b/src/WordList.cpp @@ -12,6 +12,8 @@ #include "WordList.h" +#include "Language.h" + #include "support/convert.h" #include "support/debug.h" #include "support/docstring.h" @@ -19,14 +21,23 @@ #include "support/lassert.h" +#include + +using namespace std; + namespace lyx { /// -WordList theGlobalWordList; +map theGlobalWordList; -WordList & theWordList() +WordList * theWordList(Language const & lang) { - return theGlobalWordList; + map::iterator it = theGlobalWordList.find(lang); + if (it != theGlobalWordList.end()) + return it->second; + else + theGlobalWordList[lang] = new WordList(); + return theGlobalWordList[lang]; } ///