+void ConverterCache::remove_all(string const & from_format,
+ string const & to_format) const
+{
+ if (!lyxrc.use_converter_cache)
+ return;
+ CacheType::iterator it1 = pimpl_->cache.begin();
+ while (it1 != pimpl_->cache.end()) {
+ if (it1->second.from_format != from_format) {
+ ++it1;
+ continue;
+ }
+ FormatCacheType & format_cache = it1->second.cache;
+ FormatCacheType::iterator it2 = format_cache.begin();
+ while (it2 != format_cache.end()) {
+ if (it2->first == to_format) {
+ LYXERR(Debug::FILES, "Removing file cache item "
+ << it1->first << ' ' << to_format);
+ it2->second.cache_name.removeFile();
+ format_cache.erase(it2);
+ // Have to start over again since items in a
+ // map are not ordered
+ it2 = format_cache.begin();
+ } else {
+ ++it2;
+ }
+ }
+ if (format_cache.empty()) {
+ pimpl_->cache.erase(it1);
+ // Have to start over again since items in a map are
+ // not ordered
+ it1 = pimpl_->cache.begin();
+ } else {
+ ++it1;
+ }
+ }
+ pimpl_->writeIndex();
+}
+
+