]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiImage.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiImage.cpp
index 07fdfd3d13603ad5ade0296eff903d11ea2e2f88..75c78a6ee8335b71db7728e7935a009e57a27dec 100644 (file)
 #include "GuiImage.h"
 #include "qt_helpers.h"
 
-#include "support/debug.h"
 #include "Format.h"
 
 #include "graphics/GraphicsParams.h"
 
+#include "support/debug.h"
 #include "support/FileName.h"
 #include "support/lstrings.h"       // ascii_lowercase
 
 #include <QImage>
 #include <QImageReader>
 
-#include <boost/bind.hpp>
-#include <boost/tuple/tuple.hpp>
-
-using lyx::support::ascii_lowercase;
-
-using boost::bind;
-
-using std::endl;
-using std::equal_to;
-using std::find_if;
-using std::string;
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace graphics {
@@ -60,13 +51,12 @@ Image::FormatList GuiImage::loadableFormats()
        Formats::const_iterator begin = formats.begin();
        Formats::const_iterator end   = formats.end();
 
-
-//     LYXERR(Debug::GRAPHICS,
-//             "D:/msys/home/yns/src/lyx-devel/lib/images/banner.png mis of format: "
-//             << fromqstr(Pic.pictureFormat("D:/msys/home/yns/src/lyx-devel/lib/images/banner.png")))
-//     if (Pic.pictureFormat("D:/msys/home/yns/src/lyx-devel/lib/images/banner.png"))
-//             LYXERR(Debug::GRAPHICS, "pictureFormat not returned NULL\n"
-//                     << "Supported formats are: " << Pic.inputFormats());
+       //LYXERR(Debug::GRAPHICS,
+       //      "D:/msys/home/yns/src/lyx-devel/lib/images/banner.png mis of format: "
+       //      << fromqstr(Pic.pictureFormat("D:/msys/.../banner.png")))
+       //if (Pic.pictureFormat("D:/msys/.../banner.png"))
+       //      LYXERR(Debug::GRAPHICS, "pictureFormat not returned NULL\n"
+       //              << "Supported formats are: " << Pic.inputFormats());
 
        QList<QByteArray> qt_formats = QImageReader::supportedImageFormats();
 
@@ -86,17 +76,15 @@ Image::FormatList GuiImage::loadableFormats()
                if (ext == "jpeg")
                        ext = "jpg";
 
-               Formats::const_iterator fit =
-                       find_if(begin, end,
-                               bind(equal_to<string>(),
-                                    bind(&Format::extension, _1),
-                                    ext));
-               if (fit != end)
-                       fmts.push_back(fit->name());
+               for (Formats::const_iterator fit = begin; fit != end; ++fit) 
+                       if (fit->extension() == ext) {
+                               fmts.push_back(fit->name());
+                               break;
+                       }
        }
 
        if (lyxerr.debugging()) {
-               LYXERR(Debug::GRAPHICS, "\nOf these, LyX recognises the following formats:");
+               LYXERR(Debug::GRAPHICS, "Of these, LyX recognises the following formats:");
 
                FormatList::const_iterator fbegin = fmts.begin();
                FormatList::const_iterator fend   = fmts.end();
@@ -137,7 +125,7 @@ unsigned int GuiImage::height() const
 }
 
 
-void GuiImage::load(support::FileName const & filename)
+void GuiImage::load(FileName const & filename)
 {
        if (!original_.isNull()) {
                LYXERR(Debug::GRAPHICS, "Image is loaded already!");