X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText.cpp;h=8e0d1beefda5a64ada774e747f6f67832ca7aab7;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=16bf8995cae1342c7fe26a52cbe862de86ff20ef;hpb=b162bd6d2b4284d02d7f4ce5883ae4bef3880883;p=lyx.git diff --git a/src/Text.cpp b/src/Text.cpp index 16bf8995ca..8e0d1beefd 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -376,8 +376,8 @@ void Text::readParToken(Paragraph & par, Lexer & lex, if (added_one) { // Warn the user. docstring const s = bformat(_("Layout `%1$s' was not found."), layoutname); - errorList.push_back( - ErrorItem(_("Layout Not Found"), s, par.id(), 0, par.size())); + errorList.push_back(ErrorItem(_("Layout Not Found"), s, + {par.id(), 0}, {par.id(), -1})); } par.setLayout(bp.documentClass()[layoutname]); @@ -403,7 +403,7 @@ void Text::readParToken(Paragraph & par, Lexer & lex, lex.eatLine(); docstring line = lex.getDocString(); errorList.push_back(ErrorItem(_("Unknown Inset"), line, - par.id(), 0, par.size())); + {par.id(), 0}, {par.id(), -1})); } } else if (token == "\\family") { lex.next(); @@ -520,8 +520,7 @@ void Text::readParToken(Paragraph & par, Lexer & lex, "missing until the corresponding tracked changes " "are merged or this user edits the file again.\n"), aid), - par.id(), par.size(), par.size() + 1 - )); + {par.id(), par.size()}, {par.id(), par.size() + 1})); bp.addAuthor(Author(aid)); } if (token == "\\change_inserted") @@ -531,9 +530,10 @@ void Text::readParToken(Paragraph & par, Lexer & lex, } else { lex.eatLine(); errorList.push_back(ErrorItem(_("Unknown token"), - bformat(_("Unknown token: %1$s %2$s\n"), from_utf8(token), - lex.getDocString()), - par.id(), 0, par.size())); + bformat(_("Unknown token: %1$s %2$s\n"), + from_utf8(token), + lex.getDocString()), + {par.id(), 0}, {par.id(), -1})); } } @@ -586,7 +586,7 @@ class TextCompletionList : public CompletionList { public: /// - TextCompletionList(Cursor const & cur, WordList const * list) + TextCompletionList(Cursor const & cur, WordList const & list) : buffer_(cur.buffer()), list_(list) {} /// @@ -597,19 +597,19 @@ public: /// virtual size_t size() const { - return list_->size(); + return list_.size(); } /// virtual docstring const & data(size_t idx) const { - return list_->word(idx); + return list_.word(idx); } private: /// Buffer const * buffer_; /// - WordList const * list_; + WordList const & list_; }; @@ -2156,7 +2156,7 @@ bool Text::completionSupported(Cursor const & cur) const CompletionList const * Text::createCompletionList(Cursor const & cur) const { - WordList const * list = theWordList(cur.getFont().language()->lang()); + WordList const & list = theWordList(cur.getFont().language()->lang()); return new TextCompletionList(cur, list); }