-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team
+/**
+ * \file TextCache.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * This file is Copyright 2000-2001
- * Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
*
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include <algorithm>
-
#include "TextCache.h"
-#include "buffer.h"
+#include "lyxtext.h"
#include "bufferlist.h"
+#include "debug.h"
+
+#include <algorithm>
-using std::ostream;
-using std::for_each;
-using std::remove_if;
-using std::find_if;
using std::endl;
+using std::find_if;
+using std::for_each;
using std::make_pair;
+using std::string;
+using std::ostream;
extern BufferList bufferlist;
Cache::iterator it = find_if(cache.begin(), cache.end(),
text_fits(b, p));
if (it != cache.end()) {
- LyXText * tmp = (*it).second.second;
+ LyXText * tmp = it->second.second;
cache.erase(it);
return tmp;
}
void TextCache::add(Buffer * buf, int workwidth, LyXText * text)
{
- lyxerr.debug() << "TextCache::add " << text;
+ lyxerr[Debug::INFO] << "TextCache::add " << text;
if (bufferlist.isLoaded(buf)) {
cache[buf] = make_pair(workwidth, text);
- lyxerr.debug() << " added" << endl;
+ lyxerr[Debug::INFO] << " added" << endl;
} else {
delete text;
- lyxerr.debug() << " deleted" << endl;
+ lyxerr[Debug::INFO] << " deleted" << endl;
}
}