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
This commit is contained in:
Richard Heck 2011-06-12 18:03:32 +00:00
parent e607cbfbca
commit 5c264ebdf3
3 changed files with 3 additions and 15 deletions

View File

@ -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<string, ErrorList>::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];
}

View File

@ -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

View File

@ -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<ErrorList &>(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;