]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/XPM_Renderer.C
prepare for 1.1.6pre2
[lyx.git] / src / graphics / XPM_Renderer.C
index 93284b6644bd68608b07a61ae55128f5e23122b5..9b55160228deee2a9727ab8c9eee7a330fe5201c 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <config.h>
 #include "XPM_Renderer.h"
+#include "frontends/support/LyXImage.h"
 
 #include FORMS_H_LOCATION
 #include XPM_H_LOCATION
@@ -43,8 +44,8 @@ bool XPM_Renderer::renderImage()
        Display * display = fl_get_display();
 
 //(BE 2000-08-05)
-#warning This might be a dirty thing, but I dont know any other solution.
-       Screen * screen = DefaultScreenOfDisplay(display);
+//#warning This might be a dirty thing, but I dont know any other solution.
+       Screen * screen = ScreenOfDisplay(display, fl_screen);
 
        int status = XpmReadFileToPixmap(
                        display, 
@@ -62,7 +63,7 @@ bool XPM_Renderer::renderImage()
        // This should have been set by the XpmReadFileToPixmap call!
        Assert(attrib.valuemask & XpmSize);
 
-       setPixmap(pixmap, attrib.width, attrib.height);
+       setPixmap(new LyXImage(pixmap), attrib.width, attrib.height);
 
        XpmFreeAttributes(&attrib);
 
@@ -72,7 +73,7 @@ bool XPM_Renderer::renderImage()
 
 bool XPM_Renderer::isImageFormatOK(string const & filename) const
 {
-       std::ifstream is(filename.c_str());
+       std::ifstream is(filename.c_str(), ios::in);
 
        // The signature of the file without the spaces.
        static const char str[] = "/*XPM*/";