+class delete_text {
+public:
+ void operator()(TextCache::value_type & vt) {
+ delete vt.second.second;
+ }
+};
+
+} // namespace anon
+
+
+LyXText * TextCache::findFit(Buffer * b, int p)
+{
+ Cache::iterator it = find_if(cache.begin(), cache.end(),
+ text_fits(b, p));
+ if (it != cache.end()) {
+ LyXText * tmp = it->second.second;
+ cache.erase(it);
+ return tmp;
+ }
+ return 0;
+}
+
+