X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fgraphics%2FGraphicsCache.cpp;h=c915938884c6b80b6545b9a7b1a6989fac2d56da;hb=31adae1f23c4a2767b4307d2c3e59972826b6805;hp=d36de0fbe260257bf88627a8efffe74dd691bc69;hpb=20b45450f6abbeaceafebebc4aaacb692abf63f9;p=lyx.git diff --git a/src/graphics/GraphicsCache.cpp b/src/graphics/GraphicsCache.cpp index d36de0fbe2..c915938884 100644 --- a/src/graphics/GraphicsCache.cpp +++ b/src/graphics/GraphicsCache.cpp @@ -17,10 +17,11 @@ #include "Format.h" +#include "frontends/Application.h" + #include "support/debug.h" #include "support/FileName.h" #include "support/filetools.h" -#include "support/imagetools.h" #include @@ -70,11 +71,11 @@ vector const & Cache::loadableFormats() const return fmts; // The formats recognised by LyX - Formats::const_iterator begin = formats.begin(); - Formats::const_iterator end = formats.end(); + Formats::const_iterator begin = theFormats().begin(); + Formats::const_iterator end = theFormats().end(); // The formats natively loadable. - vector nformat = loadableImageFormats(); + vector nformat = frontend::loadableImageFormats(); vector::const_iterator it = nformat.begin(); for (; it != nformat.end(); ++it) { @@ -92,18 +93,15 @@ vector const & Cache::loadableFormats() const vector::const_iterator fbegin = fmts.begin(); vector::const_iterator fend = fmts.end(); for (vector::const_iterator fit = fbegin; fit != fend; ++fit) { - if (fit != fbegin) - LYXERR(Debug::GRAPHICS, ", "); - LYXERR(Debug::GRAPHICS, *fit); + LYXERR(Debug::GRAPHICS, *fit << ','); } - LYXERR(Debug::GRAPHICS, '\n'); } return fmts; } -void Cache::add(FileName const & file) const +void Cache::add(FileName const & file, FileName const & doc_file) const { // Is the file in the cache already? if (inCache(file)) { @@ -112,7 +110,7 @@ void Cache::add(FileName const & file) const return; } - pimpl_->cache[file] = ItemPtr(new CacheItem(file)); + pimpl_->cache[file] = ItemPtr(new CacheItem(file, doc_file)); }