Saves some compile time by diminishing Buffer.h header dependencies:

- delete unneeded InsetList.h
- transfer the errorList to the private implementation.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18782 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-06-15 13:13:49 +00:00
parent d8040b41af
commit b025e9a249
5 changed files with 13 additions and 12 deletions

View File

@ -193,6 +193,9 @@ public:
/// ///
TocBackend toc_backend; TocBackend toc_backend;
/// Container for all sort of Buffer dependant errors.
map<string, ErrorList> errorLists;
}; };
@ -433,7 +436,7 @@ int Buffer::readHeader(Lexer & lex)
params().temp_bullet(i) = ITEMIZE_DEFAULTS[i]; params().temp_bullet(i) = ITEMIZE_DEFAULTS[i];
} }
ErrorList & errorList = errorLists_["Parse"]; ErrorList & errorList = pimpl_->errorLists["Parse"];
while (lex.isOK()) { while (lex.isOK()) {
lex.next(); lex.next();
@ -484,7 +487,7 @@ int Buffer::readHeader(Lexer & lex)
// Returns false if "\end_document" is not read (Asger) // Returns false if "\end_document" is not read (Asger)
bool Buffer::readDocument(Lexer & lex) bool Buffer::readDocument(Lexer & lex)
{ {
ErrorList & errorList = errorLists_["Parse"]; ErrorList & errorList = pimpl_->errorLists["Parse"];
errorList.clear(); errorList.clear();
lex.next(); lex.next();
@ -1211,7 +1214,7 @@ int Buffer::runChktex()
Alert::error(_("chktex failure"), Alert::error(_("chktex failure"),
_("Could not run chktex successfully.")); _("Could not run chktex successfully."));
} else if (res > 0) { } else if (res > 0) {
ErrorList & errorList = errorLists_["ChkTeX"]; ErrorList & errorList = pimpl_->errorLists["ChkTeX"];
// Clear out old errors // Clear out old errors
errorList.clear(); errorList.clear();
// Fill-in the error list with the TeX errors // Fill-in the error list with the TeX errors
@ -1774,8 +1777,8 @@ void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
ErrorList const & Buffer::errorList(string const & type) const ErrorList const & Buffer::errorList(string const & type) const
{ {
static ErrorList const emptyErrorList; static ErrorList const emptyErrorList;
std::map<string, ErrorList>::const_iterator I = errorLists_.find(type); std::map<string, ErrorList>::const_iterator I = pimpl_->errorLists.find(type);
if (I == errorLists_.end()) if (I == pimpl_->errorLists.end())
return emptyErrorList; return emptyErrorList;
return I->second; return I->second;
@ -1784,7 +1787,7 @@ ErrorList const & Buffer::errorList(string const & type) const
ErrorList & Buffer::errorList(string const & type) ErrorList & Buffer::errorList(string const & type)
{ {
return errorLists_[type]; return pimpl_->errorLists[type];
} }

View File

@ -12,9 +12,6 @@
#ifndef BUFFER_H #ifndef BUFFER_H
#define BUFFER_H #define BUFFER_H
#include "ErrorList.h"
#include "InsetList.h"
#include "DocIterator.h" #include "DocIterator.h"
#include "support/FileName.h" #include "support/FileName.h"
@ -37,6 +34,7 @@ namespace lyx {
class BufferParams; class BufferParams;
class ErrorItem; class ErrorItem;
class ErrorList;
class FuncRequest; class FuncRequest;
class Inset; class Inset;
class InsetText; class InsetText;
@ -410,9 +408,6 @@ private:
/// A cache for the bibfiles (including bibfiles of loaded child /// A cache for the bibfiles (including bibfiles of loaded child
/// documents), needed for appropriate update of natbib labels. /// documents), needed for appropriate update of natbib labels.
mutable std::vector<support::FileName> bibfilesCache_; mutable std::vector<support::FileName> bibfilesCache_;
/// Container for all sort of Buffer dependant errors.
std::map<std::string, ErrorList> errorLists_;
}; };

View File

@ -17,6 +17,7 @@
#include "buffer_funcs.h" #include "buffer_funcs.h"
#include "BufferParams.h" #include "BufferParams.h"
#include "debug.h" #include "debug.h"
#include "ErrorList.h"
#include "Format.h" #include "Format.h"
#include "gettext.h" #include "gettext.h"
#include "Language.h" #include "Language.h"

View File

@ -19,6 +19,7 @@
#include "Buffer.h" #include "Buffer.h"
#include "Converter.h" #include "Converter.h"
#include "debug.h" #include "debug.h"
#include "ErrorList.h"
#include "Exporter.h" #include "Exporter.h"
#include "Format.h" #include "Format.h"
#include "Mover.h" #include "Mover.h"

View File

@ -58,6 +58,7 @@ TODO
#include "Cursor.h" #include "Cursor.h"
#include "debug.h" #include "debug.h"
#include "DispatchResult.h" #include "DispatchResult.h"
#include "ErrorList.h"
#include "Exporter.h" #include "Exporter.h"
#include "Format.h" #include "Format.h"
#include "FuncRequest.h" #include "FuncRequest.h"