X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsCache.cpp;h=bf1b3fceff8476590772c89246ec0d1625576b4f;hb=c0a59871813d853ba455ec8d39be61db4f4b2848;hp=a3b8ebd3a9e835fbb106ba26586211532f0c057f;hpb=244de5d2c10a990828eafdd72283fc87742dc133;p=lyx.git diff --git a/src/graphics/GraphicsCache.cpp b/src/graphics/GraphicsCache.cpp index a3b8ebd3a9..bf1b3fceff 100644 --- a/src/graphics/GraphicsCache.cpp +++ b/src/graphics/GraphicsCache.cpp @@ -13,7 +13,6 @@ #include "GraphicsCache.h" #include "GraphicsCacheItem.h" -#include "GraphicsImage.h" #include "Format.h" @@ -21,7 +20,6 @@ #include "support/debug.h" #include "support/FileName.h" -#include "support/filetools.h" #include @@ -70,18 +68,10 @@ vector const & Cache::loadableFormats() const if (!fmts.empty()) return fmts; - // The formats recognised by LyX - Formats::const_iterator begin = formats.begin(); - Formats::const_iterator end = formats.end(); - - // The formats natively loadable. - vector nformat = frontend::loadableImageFormats(); - - vector::const_iterator it = nformat.begin(); - for (; it != nformat.end(); ++it) { - for (Formats::const_iterator fit = begin; fit != end; ++fit) { - if (fit->extension() == *it) { - fmts.push_back(fit->name()); + for (string const & native_extension : frontend::loadableImageFormats()) { + for (Format const & format : theFormats()) { + if (format.extension() == native_extension) { + fmts.push_back(format.name()); break; } } @@ -89,11 +79,8 @@ vector const & Cache::loadableFormats() const if (lyxerr.debugging()) { LYXERR(Debug::GRAPHICS, "LyX recognises the following image formats:"); - - vector::const_iterator fbegin = fmts.begin(); - vector::const_iterator fend = fmts.end(); - for (vector::const_iterator fit = fbegin; fit != fend; ++fit) { - LYXERR(Debug::GRAPHICS, *fit << ','); + for (string const & format : fmts) { + LYXERR(Debug::GRAPHICS, format << ','); } }