diff --git a/src/Buffer.cpp b/src/Buffer.cpp index f7b91a682d..f14ba3e29d 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3154,18 +3154,7 @@ void Buffer::getSourceCode(odocstream & os, string const format, } -ErrorList const & Buffer::errorList(string const & type) const -{ - static const ErrorList emptyErrorList; - map::iterator it = d->errorLists.find(type); - if (it == d->errorLists.end()) - return emptyErrorList; - - return it->second; -} - - -ErrorList & Buffer::errorList(string const & type) +ErrorList & Buffer::errorList(string const & type) const { return d->errorLists[type]; } diff --git a/src/Buffer.h b/src/Buffer.h index 1aeb66fe06..9701f31913 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -562,8 +562,7 @@ public: /// errors (like parsing or LateX compilation). This method is const /// because modifying the returned ErrorList does not touch the document /// contents. - ErrorList & errorList(std::string const & type); - ErrorList const & errorList(std::string const & type) const; + ErrorList & errorList(std::string const & type) const; /// The Toc backend. /// This is useful only for screen visualisation of the Buffer. This diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 3cfc5879c6..fee9f9cb8e 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1451,7 +1451,7 @@ void GuiView::errors(string const & error_type, bool from_master) #if EXPORT_in_THREAD && (QT_VERSION >= 0x040400) // We are called with from_master == false by default, so we // have to figure out whether that is the case or not. - ErrorList & el = const_cast(bv->buffer().errorList(error_type)); + ErrorList & el = bv->buffer().errorList(error_type); if (el.empty()) { el = bv->buffer().masterBuffer()->errorList(error_type); from_master = true;