X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText.cpp;h=5803c2d4ad07e1fca7be0574d645a9090801e26c;hb=27d580b5c057d565b9b4b50c811f6e1fab7f1246;hp=16816f34140ed7d84b7c680d2402eeaf27e1cb49;hpb=b3128dc63b2c3ae44736da5427a9469932ac522e;p=lyx.git diff --git a/src/Text.cpp b/src/Text.cpp index 16816f3414..5803c2d4ad 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -485,8 +485,8 @@ class TextCompletionList : public CompletionList { public: /// - TextCompletionList(Cursor const & cur) - : buffer_(cur.buffer()), pos_(0) + TextCompletionList(Cursor const & cur, WordList const * list) + : buffer_(cur.buffer()), pos_(0), list_(list) {} /// virtual ~TextCompletionList() {} @@ -496,12 +496,12 @@ public: /// virtual size_t size() const { - return theWordList().size(); + return list_->size(); } /// virtual docstring const & data(size_t idx) const { - return theWordList().word(idx); + return list_->word(idx); } private: @@ -509,6 +509,8 @@ private: Buffer const * buffer_; /// size_t pos_; + /// + WordList const * list_; }; @@ -1988,7 +1990,8 @@ bool Text::completionSupported(Cursor const & cur) const CompletionList const * Text::createCompletionList(Cursor const & cur) const { - return new TextCompletionList(cur); + WordList const * list = theWordList(*cur.getFont().language()); + return new TextCompletionList(cur, list); }