From 5c264ebdf30d9cc3d3c9895c4169c32d69459260 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 12 Jun 2011 18:03:32 +0000 Subject: [PATCH] Modify r38980 in response to Vincent's comments. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39021 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 13 +------------ src/Buffer.h | 3 +-- src/frontends/qt4/GuiView.cpp | 2 +- 3 files changed, 3 insertions(+), 15 deletions(-) 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; -- 2.39.2